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.

any

Represents any type.

unknown

Represents an unknown type.

nil

Represents the explicit absence of a value.

string

Represents a string value.

boolean

Represents a boolean value.

int

Represents a signed integer.

double

Represents a double-precision floating point number.

timestamp

Represents a datetime value.

literal

Represents a literal type.

Literal types are not supported in Swift. Typesync currently compiles literal types to the type of the literal value in Swift.

enum

Represents an enum value.

tuple

Represents a tuple value.

list

Represents a list of items.

map

Represents a mapping from arbitrary strings to values of any type.

object

Represents an object with known fields.

union

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

Discriminated Union Example

alias

Represents an alias of another type.