Skip to content

VariantClass

Defined in: packages/candid/src/idl.ts:1288

Represents an IDL Variant

mapping of function name to Type

new VariantClass(fields): VariantClass

Defined in: packages/candid/src/idl.ts:1291

Record<string, Type> = {}

VariantClass

ConstructType.constructor

readonly _fields: [string, Type<any>][]

Defined in: packages/candid/src/idl.ts:1289

get alternativesAsObject(): Record<string, Type>

Defined in: packages/candid/src/idl.ts:1390

Record<string, Type>


get name(): string

Defined in: packages/candid/src/idl.ts:1363

string

ConstructType.name

_buildTypeTableImpl(typeTable): void

Defined in: packages/candid/src/idl.ts:1332

TypeTable

void

ConstructType._buildTypeTableImpl


accept<D, R>(v, d): R

Defined in: packages/candid/src/idl.ts:1296

D

R

Visitor<D, R>

D

R

ConstructType.accept


buildTypeTable(typeTable): void

Defined in: packages/candid/src/idl.ts:192

TypeTable

void

ConstructType.buildTypeTable


checkType(t): ConstructType<Record<string, any>>

Defined in: packages/candid/src/idl.ts:239

Type

ConstructType<Record<string, any>>

ConstructType.checkType


covariant(x): x is Record<string, any>

Defined in: packages/candid/src/idl.ts:1300

Assert that JavaScript’s x is the proper type represented by this Type.

any

x is Record<string, any>

ConstructType.covariant


decodeValue(b, t): object

Defined in: packages/candid/src/idl.ts:1344

PipeArrayBuffer

Type

object

ConstructType.decodeValue


display(): string

Defined in: packages/candid/src/idl.ts:1368

string

ConstructType.display


encodeType(typeTable): Uint8Array<ArrayBufferLike>

Defined in: packages/candid/src/idl.ts:249

Implement I in the IDL spec. Encode this type for the type table.

TypeTable

Uint8Array<ArrayBufferLike>

ConstructType.encodeType


encodeValue(x): Uint8Array<ArrayBufferLike>

Defined in: packages/candid/src/idl.ts:1318

Internal

Encode the value. This needs to be public because it is used by encodeValue() from different types.

Record<string, any>

Uint8Array<ArrayBufferLike>

ConstructType.encodeValue


valueToString(x): string

Defined in: packages/candid/src/idl.ts:1375

Record<string, any>

string

ConstructType.valueToString