import { IType, Type } from "./type"; import { ValueType } from "./value"; import { Serializable, Serialized } from "./serialize"; /** * @ignore */ export interface IModel { [_: string]: ValueType; version?: string; reference?: string; interface?: IModelInterface; union?: IModel[]; intersection?: IModel[]; } /** * @ignore */ export interface IModelInterface { [_: string]: ValueType; channels?: IInterfaceChannel[]; values?: IInterfaceValue[]; methods?: IInterfaceMethod[]; } /** * @ignore */ export interface IInterfaceChannel { [_: string]: ValueType; name: string; type: IType; } /** * @ignore */ export interface IInterfaceValue { [_: string]: ValueType; name: string; type: IType; default: ValueType | undefined; } /** * @ignore */ export interface IInterfaceMethod { [_: string]: ValueType; name: string; inputType: IType; outputType: IType; } /** * A hologram model defining its interface. * * The interface can contain channels, values and methods. * The model can also be a union or intersection of other models. */ export declare class Model implements Serializable { private _version?; private _reference?; private _interface?; private _intersection?; private _union?; /** * The version of the model. */ get version(): string | undefined; /** * The version of the referenced model. */ get reference(): string | undefined; /** * The interface of the model. */ get interface(): ModelInterface | undefined; /** * The models whose intersection is the model. */ get intersection(): Model[] | undefined; /** * The models whose union is the model. */ get union(): Model[] | undefined; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A hologram model interface. */ export declare class ModelInterface implements Serializable { private _channels; private _values; private _methods; /** * The channels of the interface. */ get channels(): InterfaceChannel[]; /** * The values of the interface. */ get values(): InterfaceValue[]; /** * The methods of the interface. */ get methods(): InterfaceMethod[]; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A hologram model interface channel. * * A channel is a named type that can be used to send and receive messages. */ export declare class InterfaceChannel implements Serializable { private _name?; private _type?; /** * The name of the channel. */ get name(): string; /** * The type of the channel. */ get type(): Type; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A hologram model interface value. * * A value is a named type that can be used to get and set values. * It can also have a default value. */ export declare class InterfaceValue implements Serializable { private _name?; private _type?; private _default?; /** * The name of the value. */ get name(): string; /** * The type of the value. */ get type(): Type; /** * The default value of the value. */ get default(): Serialized | undefined; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; } /** * A hologram model interface method. * * It has a name, an input type and an output type. */ export declare class InterfaceMethod implements Serializable { private _name?; private _inputType?; private _outputType?; /** * The name of the method. */ get name(): string; /** * The input type of the method. */ get inputType(): Type; /** * The output type of the method. */ get outputType(): Type; deserializeAsync(value: Serialized): Promise; deserializeSync(value: Serialized): void; serialize(): Serialized; }