Skip to content

Token API

Token is an immutable-shaped value object implementing the token schema.

new Token(props?: Partial<IToken>)

Defaults include group: null, label: null, text: "", char: "â–¡", kind: "default", and index: 0; the default ID is token-${index}.

Core fields are id, group, label, text, meta, char, kind, and index. Runtime metadata may include _rev, _tags, and _attachments. The generic merge and split actions return parent IDs in _mergedFrom and _splitFrom, respectively. See provenance for what the caller is responsible for recording.

Do not mutate a token in place. Use the token actions to produce transformed, attached, merged, or split values, then place the returned value in a game container.