import { ValueType } from "./value"; import { Model, IModel } from "./model"; import { Serializable, Serialized } from "./serialize"; /** * @ignore */ export interface IType { [_: string]: ValueType; version?: string; reference?: string; primitive?: number; special?: number; map?: ITypeMapEntry[]; list?: IType; tuple?: ITypeTupleEntry[]; optional?: IType; hologram?: IHologramType; union?: IType[]; intersection?: IType[]; } /** * @ignore */ export interface ITypeMapEntry { [_: string]: ValueType; name: string; type: IType; } /** * @ignore */ export interface ITypeTupleEntry { [_: string]: ValueType; name?: string; type: IType; } /** * @ignore */ export interface IHologramType { [_: string]: ValueType; model: IModel; } /** * A type is a description of a data structure. */ export declare class Type implements Serializable { private _version?; private _reference?; private _primitive?; private _special?; private _map?; private _list?; private _tuple?; private _optional?; private _hologram?; private _union?; private _intersection?; /** * The version of the type. * * It is a version string that is used to identify the version of the type. * * The format of the version string is a dot-separated pat, followed by an at sign and three numbers separated by dots. * * Example: `myDomain.MyType@1.0.0` */ get version(): string | undefined; /** * The reference to the type. * * This is a reference to a type within a domain. * It is a dot-separated path to the type, starting from the domain. * * Example: `myDomain.MyType@1.0.0` */ get reference(): string | undefined; /** * The primitive type. * * It is a number that represents a primitive type. */ get primitive(): number | undefined; /** * The special type. * * It is a number that represents a special type. */ get special(): number | undefined; /** * The map type. * * It is a list of map entries. */ get map(): TypeMapEntry[] | undefined; /** * The list type. * * It is a type that represents a list. */ get list(): Type | undefined; /** * The tuple type. * * It is a list of tuple entries. */ get tuple(): TypeTupleEntry[] | undefined; /** * The optional type. * * It is a type that represents an optional value. */ get optional(): Type | undefined; /** * The hologram type. * * It is a type that represents a hologram. */ get hologram(): HologramType | undefined; /** * The union type. * * It is a list of types that represents a union. */ get union(): Type[] | undefined; /** * The intersection type. * * It is a list of types that represents an intersection. */ get intersection(): Type[] | undefined; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A type map entry. */ export declare class TypeMapEntry implements Serializable { private _name?; private _type?; /** * The name of the entry. */ get name(): string; /** * The type of the entry. */ get type(): Type; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A type tuple entry. */ export declare class TypeTupleEntry implements Serializable { private _name?; private _type?; /** * The name of the entry. * * It can be undefined for unnamed entries. */ get name(): string | undefined; /** * The type of the entry. */ get type(): Type; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A hologram type. */ export declare class HologramType implements Serializable { private _model?; /** * The model of the hologram type. */ get model(): Model; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; }