IOweb/node_modules/satteri/dist/generated/wire-constants.js
2026-07-03 15:07:38 -05:00

63 lines
3.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @generated by `cargo run -p satteri-layout-codegen`. Do not edit by hand.
// JS<->Rust wire-protocol byte values, declared once in
// `satteri-layout-codegen/src/schema.rs`. Rust twins live in
// `satteri-plugin-api/src/generated/wire_constants.rs` and
// `satteri-ast/src/generated/wire_constants.rs`.
// Op-stream op codes (JS `OpWriter` -> Rust `replay_opstream`).
export const OP_OPEN = 0x01; // [type: u8]
export const OP_CLOSE = 0x02;
export const OP_REF = 0x03; // [id: u32 LE] — splice an existing node
export const OP_KEEP_CHILDREN = 0x04; // splice the anchor node's original children
export const OP_STR = 0x05; // [field: u8][len: u32 LE][utf8]
export const OP_U8 = 0x06; // [field: u8][value: u8]
export const OP_U32 = 0x07; // [field: u8][value: u32 LE]
export const OP_BOOL = 0x08; // [field: u8][0|1]
export const OP_DATA = 0x09; // [len: u32 LE][json utf8]
export const OP_PROP = 0x0a; // [name str][kind: u8][value str] — HAST element property
export const OP_ALIGN = 0x0b; // [len: u32 LE][ColumnAlign bytes] — table column alignment
// Op-stream field ids (single namespace across OP_STR/OP_U8/OP_U32/OP_BOOL).
export const OF_VALUE = 0;
export const OF_URL = 1;
export const OF_TITLE = 2;
export const OF_ALT = 3;
export const OF_LANG = 4;
export const OF_META = 5;
export const OF_IDENTIFIER = 6;
export const OF_LABEL = 7;
export const OF_NAME = 8; // directive / MDX JSX element name
export const OF_REFERENCE_TYPE = 9;
export const OF_DEPTH = 10;
export const OF_CHECKED = 11;
export const OF_START = 12;
export const OF_ORDERED = 13;
export const OF_SPREAD = 14;
export const OF_TAGNAME = 15; // HAST element tag name
export const OF_EXPLICIT = 16; // MDX JSX `_mdxExplicitJsx` flag
// Command bytes (0x010x0F range). Each is followed by [nodeId: u32 LE];
// structural commands then carry [payloadType: u8][payload…].
export const CMD_REMOVE = 0x01;
export const CMD_INSERT_BEFORE = 0x05;
export const CMD_INSERT_AFTER = 0x06;
export const CMD_PREPEND_CHILD = 0x07;
export const CMD_APPEND_CHILD = 0x08;
export const CMD_WRAP = 0x09;
export const CMD_REPLACE = 0x0b;
export const CMD_SET_PROPERTY = 0x0c; // [valueType: u8][name str][value str], PROP_* value kinds
export const CMD_SET_CHILDREN = 0x0d; // payload is a Root-wrapped child list
// Structural-command payload types (0x10+, a range distinct from commands).
export const PAYLOAD_RAW_MARKDOWN = 0x10; // [len: u32 LE][utf8] — re-parsed as markdown
export const PAYLOAD_RAW_HTML = 0x11; // [len: u32 LE][utf8] — re-parsed as HTML/MDX
export const PAYLOAD_OPSTREAM = 0x14; // [len: u32 LE][op bytes] — replayed straight into the arena
// Property value kinds (HAST element properties and SET_PROPERTY commands).
export const PROP_STRING = 0; // UTF-8 value
export const PROP_BOOL_TRUE = 1; // no value bytes
export const PROP_BOOL_FALSE = 2; // no value bytes
export const PROP_SPACE_SEP = 3; // space-separated list (UTF-8)
export const PROP_COMMA_SEP = 4; // comma-separated list (UTF-8)
export const PROP_INT = 5; // decimal string, parsed to i64
export const PROP_NULL = 6; // no value bytes
// MDX JSX attribute kinds (MDAST and HAST MDX JSX element type_data).
export const MDX_ATTR_BOOLEAN_PROP = 0; // name only, no value
export const MDX_ATTR_LITERAL_PROP = 1; // name="literal"
export const MDX_ATTR_EXPRESSION_PROP = 2; // name={expr}
export const MDX_ATTR_SPREAD = 3; // {...expr}