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. Merge/split provenance uses _mergedFrom, _mergedInto, _splitFrom, _splitInto, and related bookkeeping fields.

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 Chronicle-backed container.