Skip to content

@temporary-escape/mod-sdk / Serializable

Class: Serializable ​

Defined in: cbor.ts:705

Base class for CBOR-serializable documents. The pack/unpack members are usually generated from the field declarations by the SDK AssemblyScript transform (see sdk/transform.js), which is why this is a class with concrete defaults rather than an interface: the IDE sees the inherited members and does not flag a class Foo extends Serializable as missing them.

The defaults abort, so a document whose members were never generated fails loudly at runtime instead of silently serializing nothing.

Constructors ​

Constructor ​

ts
new Serializable(): Serializable;

Returns ​

Serializable

Methods ​

pack() ​

ts
pack(_enc: CborEncoder): void;

Defined in: cbor.ts:706

Parameters ​

ParameterType
_encCborEncoder

Returns ​

void


unpack() ​

ts
unpack(_dec: CborVisitor): void;

Defined in: cbor.ts:710

Parameters ​

ParameterType
_decCborVisitor

Returns ​

void