Skip to content

IDL

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

Represents an IDL Bool

new BoolClass(): BoolClass

BoolClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is boolean

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

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

any

x is boolean

PrimitiveType.covariant

decodeValue(b, t): boolean

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

PipeArrayBuffer

Type

boolean

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array

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

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

Uint8Array

PrimitiveType.encodeType

encodeValue(x): Uint8Array

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

Internal

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

boolean

Uint8Array

PrimitiveType.encodeValue

valueToString(x): string

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

boolean

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is BoolClass

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

any

instance is BoolClass


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

Error thrown when candid decoding fails due to a type mismatch between the expected and received types.

  • Error

new CandidDecodeError(message): CandidDecodeError

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

string

CandidDecodeError

Error.constructor

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string = 'CandidDecodeError'

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

Error.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace


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

Represents an IDL type.

T = any

new ConstructType<T>(): ConstructType<T>

ConstructType<T>

Type.constructor

abstract readonly name: string

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

Type.name

abstract readonly typeName: IdlTypeName

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

Type.typeName

abstract protected _buildTypeTableImpl(typeTable): void

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

TypeTable

void

Type._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

Type.accept

buildTypeTable(typeTable): void

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

TypeTable

void

Type.buildTypeTable

checkType(t): ConstructType<T>

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

Type

ConstructType<T>

Type.checkType

abstract covariant(x): x is T

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

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

any

x is T

Type.covariant

abstract decodeValue(x, t): T

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

PipeArrayBuffer

Type

T

Type.decodeValue

display(): string

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

string

Type.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>

Type.encodeType

abstract encodeValue(x): Uint8Array

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

Internal

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

T

Uint8Array

Type.encodeValue

valueToString(x): string

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

T

string

Type.valueToString


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

Represents an IDL Empty, a type which has no inhabitants. Since no values exist for this type, it cannot be serialised or deserialised. Result types like Result<Text, Empty> should always succeed.

new EmptyClass(): EmptyClass

EmptyClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is never

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

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

any

x is never

PrimitiveType.covariant

decodeValue(): never

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

never

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array<ArrayBufferLike>

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

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

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeType

encodeValue(): never

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

Internal

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

never

PrimitiveType.encodeValue

valueToString(): never

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

never

PrimitiveType.valueToString

static [hasInstance](instance): instance is EmptyClass

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

any

instance is EmptyClass


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

Represents an IDL fixed-width Int(n)

new FixedIntClass(_bits): FixedIntClass

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

number

FixedIntClass

PrimitiveType.constructor

readonly _bits: number

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

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is bigint

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

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

any

x is bigint

PrimitiveType.covariant

decodeValue(b, t): number | bigint

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

PipeArrayBuffer

Type

number | bigint

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array<ArrayBufferLike>

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

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

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeType

encodeValue(x): Uint8Array<ArrayBufferLike>

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

Internal

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

number | bigint

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeValue

valueToString(x): string

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

number | bigint

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is FixedIntClass

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

any

instance is FixedIntClass


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

Represents an IDL fixed-width Nat(n)

new FixedNatClass(_bits): FixedNatClass

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

number

FixedNatClass

PrimitiveType.constructor

readonly _bits: number

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

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is bigint

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

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

any

x is bigint

PrimitiveType.covariant

decodeValue(b, t): number | bigint

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

PipeArrayBuffer

Type

number | bigint

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array<ArrayBufferLike>

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

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

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeType

encodeValue(x): Uint8Array<ArrayBufferLike>

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

Internal

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

number | bigint

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeValue

valueToString(x): string

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

number | bigint

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is FixedNatClass

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

any

instance is FixedNatClass


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

Represents an IDL Float

new FloatClass(_bits): FloatClass

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

number

FloatClass

PrimitiveType.constructor

readonly _bits: number

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

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is number

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

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

any

x is number

PrimitiveType.covariant

decodeValue(b, t): number

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

PipeArrayBuffer

Type

number

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array

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

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

Uint8Array

PrimitiveType.encodeType

encodeValue(x): Uint8Array<ArrayBuffer>

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

Internal

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

number

Uint8Array<ArrayBuffer>

PrimitiveType.encodeValue

valueToString(x): string

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

number

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is FloatClass

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

any

instance is FloatClass


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

Represents an IDL function reference.

Argument types.

Return types.

Function annotations.

Args extends GenericIdlFuncArgs = GenericIdlFuncArgs

Rets extends GenericIdlFuncRets = GenericIdlFuncRets

new FuncClass<Args, Rets>(argTypes, retTypes, annotations?): FuncClass<Args, Rets>

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

Args

Rets

string[] = []

FuncClass<Args, Rets>

ConstructType.constructor

annotations: string[] = []

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

argTypes: Args

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

retTypes: Rets

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

get name(): string

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

string

ConstructType.name

get typeName(): IdlTypeName

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

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(T): void

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

TypeTable

void

ConstructType._buildTypeTableImpl

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

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

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<[Principal, string]>

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

Type

ConstructType<[Principal, string]>

ConstructType.checkType

covariant(x): x is [Principal, string]

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

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

any

x is [Principal, string]

ConstructType.covariant

decodeValue(b, t): [Principal, string]

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

PipeArrayBuffer

Type

[Principal, string]

ConstructType.decodeValue

display(): string

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

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(__namedParameters): Uint8Array<ArrayBufferLike>

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

Internal

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

[Principal, string]

Uint8Array<ArrayBufferLike>

ConstructType.encodeValue

valueToString(__namedParameters): string

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

[Principal, string]

string

ConstructType.valueToString

static [hasInstance](instance): instance is FuncClass<GenericIdlFuncArgs, GenericIdlFuncRets>

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

any

instance is FuncClass<GenericIdlFuncArgs, GenericIdlFuncRets>

static argsToString(types, v): string

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

Type<any>[]

any[]

string


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

Represents an IDL Int

new IntClass(): IntClass

IntClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is bigint

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

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

any

x is bigint

PrimitiveType.covariant

decodeValue(b, t): bigint

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

PipeArrayBuffer

Type

bigint

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array<ArrayBufferLike>

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

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

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeType

encodeValue(x): Uint8Array

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

Internal

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

number | bigint

Uint8Array

PrimitiveType.encodeValue

valueToString(x): string

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

bigint

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is IntClass

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

any

instance is IntClass


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

Represents an IDL Nat

new NatClass(): NatClass

NatClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is bigint

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

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

any

x is bigint

PrimitiveType.covariant

decodeValue(b, t): bigint

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

PipeArrayBuffer

Type

bigint

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array<ArrayBufferLike>

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

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

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeType

encodeValue(x): Uint8Array

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

Internal

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

number | bigint

Uint8Array

PrimitiveType.encodeValue

valueToString(x): string

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

bigint

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is NatClass

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

any

instance is NatClass


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

Represents an IDL Null

new NullClass(): NullClass

NullClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is null

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

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

any

x is null

PrimitiveType.covariant

decodeValue(_b, t): null

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

PipeArrayBuffer

Type

null

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array

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

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

Uint8Array

PrimitiveType.encodeType

encodeValue(): Uint8Array

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

Internal

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

Uint8Array

PrimitiveType.encodeValue

valueToString(x): string

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

null

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is NullClass

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

any

instance is NullClass


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>


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

Represents an IDL type.

T = any

new PrimitiveType<T>(): PrimitiveType<T>

PrimitiveType<T>

Type.constructor

abstract readonly name: string

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

Type.name

abstract readonly typeName: IdlTypeName

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

Type.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

Type._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

Type.accept

buildTypeTable(typeTable): void

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

TypeTable

void

Type.buildTypeTable

checkType(t): Type

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

Type

Type

Type.checkType

abstract covariant(x): x is T

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

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

any

x is T

Type.covariant

abstract decodeValue(x, t): T

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

PipeArrayBuffer

Type

T

Type.decodeValue

display(): string

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

string

Type.display

abstract encodeType(typeTable): Uint8Array

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

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

TypeTable

Uint8Array

Type.encodeType

abstract encodeValue(x): Uint8Array

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

Internal

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

T

Uint8Array

Type.encodeValue

valueToString(x): string

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

T

string

Type.valueToString


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

Represents an IDL principal reference

new PrincipalClass(): PrincipalClass

PrincipalClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is Principal

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

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

any

x is Principal

PrimitiveType.covariant

decodeValue(b, t): Principal

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

PipeArrayBuffer

Type

Principal

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array

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

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

Uint8Array

PrimitiveType.encodeType

encodeValue(x): Uint8Array

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

Internal

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

Principal

Uint8Array

PrimitiveType.encodeValue

valueToString(x): string

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

Principal

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is PrincipalClass

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

any

instance is PrincipalClass


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

Represents a reference to an IDL type, used for defining recursive data types.

T = any

new RecClass<T>(): RecClass<T>

RecClass<T>

ConstructType.constructor

get name(): string

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

string

ConstructType.name

get typeName(): IdlTypeName

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

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(typeTable): void

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

TypeTable

void

ConstructType._buildTypeTableImpl

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

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

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:1665

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:1688

PipeArrayBuffer

Type

T

ConstructType.decodeValue

display(): string

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

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<ArrayBufferLike>

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

Internal

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

T

Uint8Array<ArrayBufferLike>

ConstructType.encodeValue

fill(t): void

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

ConstructType<T>

void

getType(): ConstructType<T> | undefined

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

ConstructType<T> | undefined

valueToString(x): string

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

T

string

ConstructType.valueToString

static [hasInstance](instance): instance is RecClass<any>

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

any

instance is RecClass<any>


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

Represents an IDL Record

mapping of function name to Type

new RecordClass(fields?): RecordClass

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

Record<string, Type> = {}

RecordClass

ConstructType.constructor

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

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

get fieldsAsObject(): Record<number, Type>

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

Record<number, Type>

get name(): string

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

string

ConstructType.name

get typeName(): IdlTypeName

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

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(T): void

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

TypeTable

void

ConstructType._buildTypeTableImpl

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

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

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<Record<string, any>>

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

Type

ConstructType<Record<string, any>>

ConstructType.checkType

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

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

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

any

x is Record<string, any>

ConstructType.covariant

decodeValue(b, t): Record<string, any>

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

PipeArrayBuffer

Type

Record<string, any>

ConstructType.decodeValue

display(): string

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

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:1315

Internal

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

Record<string, any>

Uint8Array

ConstructType.encodeValue

tryAsTuple(): Type<any>[] | null

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

Type<any>[] | null

valueToString(x): string

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

Record<string, any>

string

ConstructType.valueToString

static [hasInstance](instance): instance is RecordClass

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

any

instance is RecordClass


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

Represents an IDL Reserved

new ReservedClass(): ReservedClass

ReservedClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(_x): _x is any

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

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

any

_x is any

PrimitiveType.covariant

decodeValue(b, t): null

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

PipeArrayBuffer

Type

null

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array

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

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

Uint8Array

PrimitiveType.encodeType

encodeValue(): Uint8Array

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

Internal

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

Uint8Array

PrimitiveType.encodeValue

valueToString(x): string

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

any

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is ReservedClass

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

any

instance is ReservedClass


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

Represents an IDL type.

K extends string = string

Fields extends GenericIdlServiceFields = GenericIdlServiceFields

new ServiceClass<K, Fields>(fields): ServiceClass<K, Fields>

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

Fields

ServiceClass<K, Fields>

ConstructType.constructor

readonly _fields: [K, Fields[K]][]

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

get name(): string

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

string

ConstructType.name

get typeName(): IdlTypeName

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

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(T): void

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

TypeTable

void

ConstructType._buildTypeTableImpl

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

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

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<Principal>

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

Type

ConstructType<Principal>

ConstructType.checkType

covariant(x): x is Principal

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

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

any

x is Principal

ConstructType.covariant

decodeValue(b, t): Principal

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

PipeArrayBuffer

Type

Principal

ConstructType.decodeValue

display(): string

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

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:1946

Internal

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

Principal

Uint8Array

ConstructType.encodeValue

fieldsAsObject(): Fields

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

Fields

valueToString(x): string

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

Principal

string

ConstructType.valueToString

static [hasInstance](instance): instance is ServiceClass<string, GenericIdlServiceFields>

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

any

instance is ServiceClass<string, GenericIdlServiceFields>


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

Represents an IDL Text

new TextClass(): TextClass

TextClass

PrimitiveType.constructor

get name(): string

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

string

PrimitiveType.name

get typeName(): IdlTypeName

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

IdlTypeName

PrimitiveType.typeName

_buildTypeTableImpl(_typeTable): void

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

TypeTable

void

PrimitiveType._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

PrimitiveType.accept

buildTypeTable(typeTable): void

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

TypeTable

void

PrimitiveType.buildTypeTable

checkType(t): Type

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

Type

Type

PrimitiveType.checkType

covariant(x): x is string

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

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

any

x is string

PrimitiveType.covariant

decodeValue(b, t): string

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

PipeArrayBuffer

Type

string

PrimitiveType.decodeValue

display(): string

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

string

PrimitiveType.display

encodeType(): Uint8Array<ArrayBufferLike>

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

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

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeType

encodeValue(x): Uint8Array<ArrayBufferLike>

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

Internal

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

string

Uint8Array<ArrayBufferLike>

PrimitiveType.encodeValue

valueToString(x): string

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

string

string

PrimitiveType.valueToString

static [hasInstance](instance): instance is TextClass

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

any

instance is TextClass


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

Represents Tuple, a syntactic sugar for Record.

T extends any[]

new TupleClass<T>(_components): TupleClass<T>

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

Type<any>[]

TupleClass<T>

RecordClass.constructor

protected readonly _components: Type<any>[]

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

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

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

RecordClass._fields

get fieldsAsObject(): Record<number, Type>

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

Record<number, Type>

RecordClass.fieldsAsObject

get name(): string

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

string

RecordClass.name

get typeName(): IdlTypeName

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

IdlTypeName

RecordClass.typeName

_buildTypeTableImpl(T): void

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

TypeTable

void

RecordClass._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

RecordClass.accept

buildTypeTable(typeTable): void

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

TypeTable

void

RecordClass.buildTypeTable

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

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

Type

ConstructType<Record<string, any>>

RecordClass.checkType

covariant(x): x is T

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

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

any

x is T

RecordClass.covariant

decodeValue(b, t): T

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

PipeArrayBuffer

Type

T

RecordClass.decodeValue

display(): string

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

string

RecordClass.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>

RecordClass.encodeType

encodeValue(x): Uint8Array

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

Internal

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

any[]

Uint8Array

RecordClass.encodeValue

tryAsTuple(): Type<any>[] | null

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

Type<any>[] | null

RecordClass.tryAsTuple

valueToString(values): string

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

any[]

string

RecordClass.valueToString

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

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

T extends any[]

any

instance is TupleClass<T>

RecordClass.[hasInstance]


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

Represents an IDL type.

T = any

new Type<T>(): Type<T>

Type<T>

abstract readonly name: string

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

abstract readonly typeName: IdlTypeName

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

abstract protected _buildTypeTableImpl(typeTable): void

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

TypeTable

void

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

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

D

R

Visitor<D, R>

D

R

buildTypeTable(typeTable): void

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

TypeTable

void

abstract checkType(t): Type

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

Type

Type

abstract covariant(x): x is T

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

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

any

x is T

abstract decodeValue(x, t): T

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

PipeArrayBuffer

Type

T

display(): string

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

string

abstract encodeType(typeTable): Uint8Array

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

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

TypeTable

Uint8Array

abstract encodeValue(x): Uint8Array

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

Internal

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

T

Uint8Array

valueToString(x): string

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

T

string


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

Represents an IDL Unknown, a placeholder type for deserialization only. When decoding a value as Unknown, all fields will be retained but the names are only available in hashed form. A deserialized unknown will offer it’s actual type by calling the type() function. Unknown cannot be serialized and attempting to do so will throw an error.

new UnknownClass(): UnknownClass

UnknownClass

Type.constructor

get name(): string

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

string

Type.name

get typeName(): IdlTypeName

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

IdlTypeName

Type.typeName

protected _buildTypeTableImpl(): void

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

void

Type._buildTypeTableImpl

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

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

D

R

Visitor<D, R>

D

R

Type.accept

buildTypeTable(typeTable): void

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

TypeTable

void

Type.buildTypeTable

checkType(_t): Type

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

Type

Type

Type.checkType

covariant(x): x is any

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

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

any

x is any

Type.covariant

decodeValue(b, t): any

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

PipeArrayBuffer

Type

any

Type.decodeValue

display(): string

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

string

Type.display

encodeType(): never

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

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

never

Type.encodeType

encodeValue(): never

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

Internal

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

never

Type.encodeValue

valueToString(): never

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

never

Type.valueToString

static [hasInstance](instance): instance is UnknownClass

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

any

instance is UnknownClass


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

Represents an IDL Variant

mapping of function name to Type

new VariantClass(fields?): VariantClass

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

Record<string, Type> = {}

VariantClass

ConstructType.constructor

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

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

get alternativesAsObject(): Record<number, Type>

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

Record<number, Type>

get name(): string

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

string

ConstructType.name

get typeName(): IdlTypeName

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

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(typeTable): void

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

TypeTable

void

ConstructType._buildTypeTableImpl

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

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

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<Record<string, any>>

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

Type

ConstructType<Record<string, any>>

ConstructType.checkType

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

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

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/core/src/candid/idl.ts:1576

PipeArrayBuffer

Type

object

ConstructType.decodeValue

display(): string

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

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<ArrayBufferLike>

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

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/core/src/candid/idl.ts:1610

Record<string, any>

string

ConstructType.valueToString

static [hasInstance](instance): instance is VariantClass

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

any

instance is VariantClass


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

Represents an IDL Array

Arrays of fixed-sized nat/int type (e.g. nat8), are encoded from and decoded to TypedArrays (e.g. Uint8Array). Arrays of float or other non-primitive types are encoded/decoded as untyped array in Javascript.

T

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

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

Type<T>

VecClass<T>

ConstructType.constructor

_type: Type<T>

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

get name(): string

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

string

ConstructType.name

get typeName(): IdlTypeName

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

IdlTypeName

ConstructType.typeName

_buildTypeTableImpl(typeTable): void

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

TypeTable

void

ConstructType._buildTypeTableImpl

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

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

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:939

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:1029

PipeArrayBuffer

Type

T[]

ConstructType.decodeValue

display(): string

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

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:968

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:1110

T[]

string

ConstructType.valueToString

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

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

T

any

instance is VecClass<T>


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

D

R

new Visitor<D, R>(): Visitor<D, R>

Visitor<D, R>

visitBool(t, data): R

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

BoolClass

D

R

visitConstruct<T>(t, data): R

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

T

ConstructType<T>

D

R

visitEmpty(t, data): R

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

EmptyClass

D

R

visitFixedInt(t, data): R

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

FixedIntClass

D

R

visitFixedNat(t, data): R

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

FixedNatClass

D

R

visitFloat(t, data): R

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

FloatClass

D

R

visitFunc(t, data): R

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

FuncClass

D

R

visitInt(t, data): R

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

IntClass

D

R

visitNat(t, data): R

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

NatClass

D

R

visitNull(t, data): R

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

NullClass

D

R

visitNumber<T>(t, data): R

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

T

PrimitiveType<T>

D

R

visitOpt<T>(t, _ty, data): R

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

T

OptClass<T>

Type<T>

D

R

visitPrimitive<T>(t, data): R

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

T

PrimitiveType<T>

D

R

visitPrincipal(t, data): R

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

PrincipalClass

D

R

visitRec<T>(_t, ty, data): R

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

T

RecClass<T>

ConstructType<T>

D

R

visitRecord(t, _fields, data): R

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

RecordClass

[string, Type<any>][]

D

R

visitReserved(t, data): R

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

ReservedClass

D

R

visitService(t, data): R

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

ServiceClass

D

R

visitText(t, data): R

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

TextClass

D

R

visitTuple<T>(t, components, data): R

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

T extends any[]

TupleClass<T>

Type<any>[]

D

R

visitType<T>(_t, _data): R

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

T

Type<T>

D

R

visitVariant(t, _fields, data): R

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

VariantClass

[string, Type<any>][]

D

R

visitVec<T>(t, _ty, data): R

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

T

VecClass<T>

Type<T>

D

R

GenericIdlFuncArgs = [Type, ...Type[]] | []

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

The generic type of the arguments of an IDL Function.


GenericIdlFuncRets = [Type, ...Type[]] | []

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

The generic type of the return values of an IDL Function.


GenericIdlServiceFields = Record<string, FuncClass>

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

The generic type of the fields of an IDL Service.


InterfaceFactory = (idl) => ServiceClass

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

An Interface Factory, normally provided by a Candid code generation.

{ 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; Unknown: UnknownClass; Variant: typeof Variant; Vec: typeof Vec; Service: ServiceClass; }

BoolClass

EmptyClass

FloatClass

FloatClass

typeof Func

IntClass

FixedIntClass

FixedIntClass

FixedIntClass

FixedIntClass

NatClass

FixedNatClass

FixedNatClass

FixedNatClass

FixedNatClass

NullClass

typeof Opt

PrincipalClass

typeof Rec

typeof Record

ReservedClass

TextClass

typeof Tuple

UnknownClass

typeof Variant

typeof Vec

ServiceClass

const Bool: BoolClass

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


const Empty: EmptyClass

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


const Float32: FloatClass

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


const Float64: FloatClass

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


const Int: IntClass

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


const Int16: FixedIntClass

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


const Int32: FixedIntClass

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


const Int64: FixedIntClass

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


const Int8: FixedIntClass

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


const Nat: NatClass

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


const Nat16: FixedNatClass

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


const Nat32: FixedNatClass

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


const Nat64: FixedNatClass

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


const Nat8: FixedNatClass

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


const Null: NullClass

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


const Principal: PrincipalClass

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


const Reserved: ReservedClass

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


const Text: TextClass

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


const Unknown: UnknownClass

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

Client-only type for deserializing unknown data. Not supported by Candid, and its use is discouraged.

decode(retTypes, bytes): JsonValue[]

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

Decode a binary value

Type<any>[]

Types expected in the buffer.

Uint8Array

hex-encoded string, or buffer.

JsonValue[]

Value deserialised to JS type


encode(argTypes, args): Uint8Array

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

Encode a array of values

Type<any>[]

array of Types

any[]

array of values

Uint8Array

serialised value


Func<Args, Ret>(args, ret, annotations?): FuncClass<Args, Ret>

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

Args extends GenericIdlFuncArgs = GenericIdlFuncArgs

Ret extends GenericIdlFuncRets = GenericIdlFuncRets

Args

array of IDL Types

Ret

array of IDL Types

string[] = []

array of strings, [] by default

FuncClass<Args, Ret>

new FuncClass


Opt<T>(t): OptClass<T>

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

T

Type<T>

IDL Type

OptClass<T>

OptClass of Type


Rec(): RecClass

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

RecClass

new RecClass


Record(t): RecordClass

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

Record<string, Type>

Record of string and IDL Type

RecordClass

RecordClass of string and Type


resetSubtypeCache(): void

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

Resets the global subtyping cache

void


Service<K, Fields>(t): ServiceClass<K, Fields>

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

K extends string = string

Fields extends GenericIdlServiceFields = GenericIdlServiceFields

Fields

Record of string and FuncClass

ServiceClass<K, Fields>

ServiceClass


subtype(t1, t2): boolean

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

Subtyping on Candid types t1 <: t2 (Exported for testing)

Type

The potential subtype

Type

The potential supertype

boolean


Tuple<T>(…types): TupleClass<T>

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

T extends any[]

T

array of any types

TupleClass<T>

TupleClass from those types


Variant(fields): VariantClass

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

Record<string, Type>

Record of string and IDL Type

VariantClass

VariantClass


Vec<T>(t): VecClass<T>

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

T

Type<T>

IDL Type

VecClass<T>

VecClass from that type