Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

InterfaceFactory

InterfaceFactory: (idl: { IDL: { Bool: BoolClass; Empty: EmptyClass; Float32: FloatClass; Float64: FloatClass; Func: typeof Func; Int: IntClass; Int16: FixedIntClass; Int32: FixedIntClass; Int64: FixedIntClass; Int8: FixedIntClass; Nat: NatClass; Nat16: FixedNatClass; Nat32: FixedNatClass; Nat64: FixedNatClass; Nat8: FixedNatClass; Null: NullClass; Opt: typeof Opt; Principal: PrincipalClass; Rec: typeof Rec; Record: typeof Record; Reserved: ReservedClass; Text: TextClass; Tuple: typeof Tuple; Variant: typeof Variant; Vec: typeof Vec; Service: any } }) => ServiceClass

Type declaration

Variables

Const Bool

Bool: BoolClass = ...

Const Empty

Empty: EmptyClass = ...

Const Float32

Float32: FloatClass = ...

Const Float64

Float64: FloatClass = ...

Const Int

Int: IntClass = ...

Const Int16

Int16: FixedIntClass = ...

Const Int32

Int32: FixedIntClass = ...

Const Int64

Int64: FixedIntClass = ...

Const Int8

Int8: FixedIntClass = ...

Const Nat

Nat: NatClass = ...

Const Nat16

Nat16: FixedNatClass = ...

Const Nat32

Nat32: FixedNatClass = ...

Const Nat64

Nat64: FixedNatClass = ...

Const Nat8

Nat8: FixedNatClass = ...

Const Null

Null: NullClass = ...

Const Principal

Principal: PrincipalClass = ...

Const Reserved

Reserved: ReservedClass = ...

Const Text

Text: TextClass = ...

Functions

Func

  • Parameters

    • args: Type[]

      array of IDL Types

    • ret: Type[]

      array of IDL Types

    • annotations: string[] = []

      array of strings, [] by default

    Returns FuncClass

    new FuncClass

Opt

  • Type parameters

    • T

    Parameters

    • t: Type<T>

      IDL Type

    Returns OptClass<T>

    OptClass of Type

Rec

  • Returns RecClass

    new RecClass

Record

  • Parameters

    • t: Record<string, Type>

      Record of string and IDL Type

    Returns RecordClass

    RecordClass of string and Type

Service

  • Parameters

    • t: Record<string, FuncClass>

      Record of string and FuncClass

    Returns ServiceClass

    ServiceClass

Tuple

  • Type parameters

    • T: any[]

    Parameters

    • Rest ...types: T

      array of any types

    Returns TupleClass<T>

    TupleClass from those types

Variant

  • Parameters

    • fields: Record<string, Type>

      Record of string and IDL Type

    Returns VariantClass

    VariantClass

Vec

  • Type parameters

    • T

    Parameters

    • t: Type<T>

      IDL Type

    Returns VecClass<T>

    VecClass from that type

decode

  • decode(bytes: Buffer): JsonValue[]
  • Decode a binary value

    Parameters

    • bytes: Buffer

      hex-encoded string, or buffer.

    Returns JsonValue[]

    Value deserialised to JS type

encode

  • encode(argTypes: Type<any>[], args: any[]): BinaryBlob
  • Encode a array of values

    Parameters

    • argTypes: Type<any>[]
    • args: any[]

    Returns BinaryBlob

    serialised value

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration