Skip to content

OptClass

Defined in: packages/core/src/candid/idl.ts:1120

Represents an IDL Option

T

new OptClass<T>(_type): OptClass<T>

Defined in: packages/core/src/candid/idl.ts:1129

Type<T>

OptClass<T>

ConstructType.constructor

_type: Type<T>

Defined in: packages/core/src/candid/idl.ts:1129

get name(): string

Defined in: packages/core/src/candid/idl.ts:1237

string

ConstructType.name


get typeName(): IdlTypeName

Defined in: packages/core/src/candid/idl.ts:1121

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(typeTable): void

Defined in: packages/core/src/candid/idl.ts:1158

TypeTable

void

ConstructType._buildTypeTableImpl


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

Defined in: packages/core/src/candid/idl.ts:1133

D

R

Visitor<D, R>

D

R

ConstructType.accept


buildTypeTable(typeTable): void

Defined in: packages/core/src/candid/idl.ts:260

TypeTable

void

ConstructType.buildTypeTable


checkType(t): ConstructType<[] | [T]>

Defined in: packages/core/src/candid/idl.ts:306

Type

ConstructType<[] | [T]>

ConstructType.checkType


covariant(x): x is [] | [T]

Defined in: packages/core/src/candid/idl.ts:1137

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

any

x is [] | [T]

ConstructType.covariant


decodeValue(b, t): [] | [T]

Defined in: packages/core/src/candid/idl.ts:1166

PipeArrayBuffer

Type

[] | [T]

ConstructType.decodeValue


display(): string

Defined in: packages/core/src/candid/idl.ts:1241

string

ConstructType.display


encodeType(typeTable): Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/candid/idl.ts:316

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

TypeTable

Uint8Array<ArrayBufferLike>

ConstructType.encodeType


encodeValue(x): Uint8Array

Defined in: packages/core/src/candid/idl.ts:1151

Internal

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

[] | [T]

Uint8Array

ConstructType.encodeValue


valueToString(x): string

Defined in: packages/core/src/candid/idl.ts:1245

[] | [T]

string

ConstructType.valueToString


static [hasInstance]<T>(instance): instance is OptClass<T>

Defined in: packages/core/src/candid/idl.ts:1125

T

any

instance is OptClass<T>