VariantClass
Defined in: packages/candid/src/idl.ts:1288
Represents an IDL Variant
mapping of function name to Type
Extends
Section titled “Extends”ConstructType
<Record
<string
,any
>>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VariantClass(
fields
):VariantClass
Defined in: packages/candid/src/idl.ts:1291
Parameters
Section titled “Parameters”fields
Section titled “fields”Record
<string
, Type
> = {}
Returns
Section titled “Returns”VariantClass
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_fields
Section titled “_fields”
readonly
_fields: [string
,Type
<any
>][]
Defined in: packages/candid/src/idl.ts:1289
Accessors
Section titled “Accessors”alternativesAsObject
Section titled “alternativesAsObject”Get Signature
Section titled “Get Signature”get alternativesAsObject():
Record
<string
,Type
>
Defined in: packages/candid/src/idl.ts:1390
Returns
Section titled “Returns”Record
<string
, Type
>
Get Signature
Section titled “Get Signature”get name():
string
Defined in: packages/candid/src/idl.ts:1363
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”Methods
Section titled “Methods”_buildTypeTableImpl()
Section titled “_buildTypeTableImpl()”_buildTypeTableImpl(
typeTable
):void
Defined in: packages/candid/src/idl.ts:1332
Parameters
Section titled “Parameters”typeTable
Section titled “typeTable”TypeTable
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”ConstructType
._buildTypeTableImpl
accept()
Section titled “accept()”accept<
D
,R
>(v
,d
):R
Defined in: packages/candid/src/idl.ts:1296
Type Parameters
Section titled “Type Parameters”D
R
Parameters
Section titled “Parameters”Visitor
<D
, R
>
D
Returns
Section titled “Returns”R
Overrides
Section titled “Overrides”buildTypeTable()
Section titled “buildTypeTable()”buildTypeTable(
typeTable
):void
Defined in: packages/candid/src/idl.ts:192
Parameters
Section titled “Parameters”typeTable
Section titled “typeTable”TypeTable
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”checkType()
Section titled “checkType()”checkType(
t
):ConstructType
<Record
<string
,any
>>
Defined in: packages/candid/src/idl.ts:239
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ConstructType
<Record
<string
, any
>>
Inherited from
Section titled “Inherited from”covariant()
Section titled “covariant()”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.
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”x is Record<string, any>
Overrides
Section titled “Overrides”decodeValue()
Section titled “decodeValue()”decodeValue(
b
,t
):object
Defined in: packages/candid/src/idl.ts:1344
Parameters
Section titled “Parameters”Returns
Section titled “Returns”object
Overrides
Section titled “Overrides”display()
Section titled “display()”display():
string
Defined in: packages/candid/src/idl.ts:1368
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”encodeType()
Section titled “encodeType()”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.
Parameters
Section titled “Parameters”typeTable
Section titled “typeTable”TypeTable
Returns
Section titled “Returns”Uint8Array
<ArrayBufferLike
>
Inherited from
Section titled “Inherited from”encodeValue()
Section titled “encodeValue()”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.
Parameters
Section titled “Parameters”Record
<string
, any
>
Returns
Section titled “Returns”Uint8Array
<ArrayBufferLike
>
Overrides
Section titled “Overrides”valueToString()
Section titled “valueToString()”valueToString(
x
):string
Defined in: packages/candid/src/idl.ts:1375
Parameters
Section titled “Parameters”Record
<string
, any
>
Returns
Section titled “Returns”string