[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › typed

## Call Signature

```ts
function typed<Tag>(
  tag: ValidateTypedTag<Tag>,
): StrictObjectType<TypedProps<Tag, Readonly<Record<never, never>>>>;
```

Defined in: [packages/common/src/Type.ts:8801](https://github.com/evoluhq/evolu/blob/a18269a1b822c670b507c6a9b73b23eed32551fe/packages/common/src/Type.ts#L8801)

Tagged [ObjectType](https://evolu.dev/docs/api-reference/common/Type/type-aliases/ObjectType).

The discriminator belongs to `typed`, so additional properties cannot declare
`type`. The discriminator Input is `string`, inherited from [String](https://evolu.dev/docs/api-reference/common/Type/variables/String),
while its Output is the exact tag. Without a third argument, additional
properties are rejected. Pass a [record](https://evolu.dev/docs/api-reference/common/Type/functions/record) with the predefined `String`
key Type as the third argument to validate and preserve additional
string-keyed properties, just like [object](https://evolu.dev/docs/api-reference/common/Type/functions/object).

### Example

```ts

const Pending = typed("Pending", {
  label: String,
});

const Completed = typed("Completed");
const Status = discriminatedUnion(Pending, Completed);

expectOk(Status.fromUnknown({ type: "Pending", label: "Waiting" }), {
  type: "Pending",
  label: "Waiting",
});
expectOk(Status.fromUnknown({ type: "Completed" }), {
  type: "Completed",
});
```

## Call Signature

```ts
function typed<Tag, Props>(
  tag: ValidateTypedTag<Tag>,
  props: Props,
  ...validation: [TypedValidationError<Props>] extends [never]
    ? []
    : [ValidationFailure<TypedValidationError<Props>>]
): StrictObjectType<TypedProps<Tag, Props>>;
```

Defined in: [packages/common/src/Type.ts:8804](https://github.com/evoluhq/evolu/blob/a18269a1b822c670b507c6a9b73b23eed32551fe/packages/common/src/Type.ts#L8804)

Tagged [ObjectType](https://evolu.dev/docs/api-reference/common/Type/type-aliases/ObjectType).

The discriminator belongs to `typed`, so additional properties cannot declare
`type`. The discriminator Input is `string`, inherited from [String](https://evolu.dev/docs/api-reference/common/Type/variables/String),
while its Output is the exact tag. Without a third argument, additional
properties are rejected. Pass a [record](https://evolu.dev/docs/api-reference/common/Type/functions/record) with the predefined `String`
key Type as the third argument to validate and preserve additional
string-keyed properties, just like [object](https://evolu.dev/docs/api-reference/common/Type/functions/object).

### Example

```ts

const Pending = typed("Pending", {
  label: String,
});

const Completed = typed("Completed");
const Status = discriminatedUnion(Pending, Completed);

expectOk(Status.fromUnknown({ type: "Pending", label: "Waiting" }), {
  type: "Pending",
  label: "Waiting",
});
expectOk(Status.fromUnknown({ type: "Completed" }), {
  type: "Completed",
});
```

## Call Signature

```ts
function typed<Tag, Props, Rest>(
  tag: ValidateTypedTag<Tag>,
  props: Props,
  record: Rest,
  ...validation: [
    | TypedValidationError<Props>
    | ObjectRecordValidationError<TypedProps<Tag, Props>, Rest>,
  ] extends [never]
    ? []
    : [
        ValidationFailure<
          | TypedValidationError<Props>
          | ObjectRecordValidationError<TypedProps<Tag, Props>, Rest>
        >,
      ]
): ObjectType<
  TypedProps<Tag, Props>,
  Rest extends ObjectRecordTypeNode ? Rest : never
>;
```

Defined in: [packages/common/src/Type.ts:8814](https://github.com/evoluhq/evolu/blob/a18269a1b822c670b507c6a9b73b23eed32551fe/packages/common/src/Type.ts#L8814)

Tagged [ObjectType](https://evolu.dev/docs/api-reference/common/Type/type-aliases/ObjectType).

The discriminator belongs to `typed`, so additional properties cannot declare
`type`. The discriminator Input is `string`, inherited from [String](https://evolu.dev/docs/api-reference/common/Type/variables/String),
while its Output is the exact tag. Without a third argument, additional
properties are rejected. Pass a [record](https://evolu.dev/docs/api-reference/common/Type/functions/record) with the predefined `String`
key Type as the third argument to validate and preserve additional
string-keyed properties, just like [object](https://evolu.dev/docs/api-reference/common/Type/functions/object).

### Example

```ts

const Pending = typed("Pending", {
  label: String,
});

const Completed = typed("Completed");
const Status = discriminatedUnion(Pending, Completed);

expectOk(Status.fromUnknown({ type: "Pending", label: "Waiting" }), {
  type: "Pending",
  label: "Waiting",
});
expectOk(Status.fromUnknown({ type: "Completed" }), {
  type: "Completed",
});
```