Here, you’ll find a comprehensive list of all types supported by the Typesync specification. Typesync’s powerful type system is designed to support a wide array of complex and useful types.
UserRole: model: alias docs: Represents a user's role within a project. type: type: enum members: - label: Owner value: owner - label: Admin value: admin - label: Member value: member
Represents a union of multiple types. Typesync supports two types of unions: simple union and discriminated union. Both are defined in the same way using variants, except a discriminated union definition has a discriminant key and requires every variant to be of object (or alias resolving to object) type.
Simple Union Example
Copy
Path: model: alias type: type: union variants: - string - type: list elementType: string
Discriminated Union Example
Copy
Cat: model: alias type: type: object fields: type: type: type: literal value: cat name: type: string lives_left: type: intDog: model: alias type: type: object fields: type: type: type: literal value: dog name: type: string breed: type: stringPet: model: alias type: type: union discriminant: type variants: - Cat - Dog