Types
Defined in: packages/types/src/doc.ts:14
A named orientation of a piece (e.g. die face)
Properties
Section titled “Properties”name:
string
Defined in: packages/types/src/doc.ts:15
rotation
Section titled “rotation”rotation:
Vector3Tuple
Defined in: packages/types/src/doc.ts:16
GameState
Section titled “GameState”Defined in: packages/types/src/doc.ts:187
The Automerge document shape — a digital analog of the physical game. Pieces are stacked on each other and positioned relatively.
Example
Section titled “Example”// A token, sitting on a card, sitting on a chessboard{ "$schema": "https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json", "templates": {}, "children": [ { "name": "Chess Board", "position": [0, 0.1, 0], "locked": true, "src": "Chess_Board.glb", "children": [ { "name": "card", "position": [0, 0.002, 0], "children": [ { "name": "pawn", "position": [0, 0.3, 0], "children": [] } ] } ] } ]}Properties
Section titled “Properties”__automergeMoves?
Section titled “__automergeMoves?”
optional__automergeMoves:__AutomergeMoves
Defined in: packages/types/src/doc.ts:196
Tracks Automerge objectId changes when pieces are reparented.
$schema
Section titled “$schema”$schema:
"https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json"
Defined in: packages/types/src/doc.ts:188
children
Section titled “children”children:
Piece[]
Defined in: packages/types/src/doc.ts:189
templates
Section titled “templates”templates:
Templates
Defined in: packages/types/src/doc.ts:190
HashProps
Section titled “HashProps”Defined in: packages/types/src/hashroute.ts:31
Connection context passed to plugins via the URL hash.
Example
Section titled “Example”https://example.com/plugin#{"doc":"automerge:...","sync":["wss://..."],"delegation":"..."}Properties
Section titled “Properties”delegation?
Section titled “delegation?”
optionaldelegation:string
Defined in: packages/types/src/hashroute.ts:40
Will be a base64url-encoded KeyHive/Beelay
Ed25519 Signed<Delegation>.
doc:
AutomergeUrl
Defined in: packages/types/src/hashroute.ts:33
Automerge document URL
sync: [
string,...string[]]
Defined in: packages/types/src/hashroute.ts:35
Sync server WebSocket URLs
Defined in: packages/types/src/doc.ts:64
A game piece in a manifest or document
Extends
Section titled “Extends”Properties
Section titled “Properties”children?
Section titled “children?”
optionalchildren:Piece[]
Defined in: packages/types/src/doc.ts:65
color?
Section titled “color?”
optionalcolor:string|null
Defined in: packages/types/src/doc.ts:50
CSS color string, or null for no tint
Default
Section titled “Default”"#808080"Inherited from
Section titled “Inherited from”faces?
Section titled “faces?”
optionalfaces:Face[]
Defined in: packages/types/src/doc.ts:57
Named face orientations (e.g. for dice)
Inherited from
Section titled “Inherited from”locked?
Section titled “locked?”
optionallocked:boolean
Defined in: packages/types/src/doc.ts:55
Make piece non-interactive?
Default
Section titled “Default”falseInherited from
Section titled “Inherited from”
optionalname:string
Defined in: packages/types/src/doc.ts:24
Inherited from
Section titled “Inherited from”position?
Section titled “position?”
optionalposition:Vector3Tuple
Defined in: packages/types/src/doc.ts:35
World position in meters.
Default
Section titled “Default”[0, 0, 0]Inherited from
Section titled “Inherited from”rotation?
Section titled “rotation?”
optionalrotation:Vector3Tuple
Defined in: packages/types/src/doc.ts:45
Euler rotation (degrees)
Default
Section titled “Default”[0, 0, 0]Inherited from
Section titled “Inherited from”scale?
Section titled “scale?”
optionalscale:Vector3Tuple
Defined in: packages/types/src/doc.ts:40
Unitless multiplier applied to the model.
Default
Section titled “Default”[1, 1, 1]Inherited from
Section titled “Inherited from”
optionalsrc:string
Defined in: packages/types/src/doc.ts:26
Path to a glTF/GLB model
Inherited from
Section titled “Inherited from”template?
Section titled “template?”
optionaltemplate:string
Defined in: packages/types/src/doc.ts:30
Key into the sibling templates object to inherit defaults from
Inherited from
Section titled “Inherited from”PieceTemplate
Section titled “PieceTemplate”Defined in: packages/types/src/doc.ts:23
Piece template — shared fields for pieces
Extended by
Section titled “Extended by”Properties
Section titled “Properties”color?
Section titled “color?”
optionalcolor:string|null
Defined in: packages/types/src/doc.ts:50
CSS color string, or null for no tint
Default
Section titled “Default”"#808080"faces?
Section titled “faces?”
optionalfaces:Face[]
Defined in: packages/types/src/doc.ts:57
Named face orientations (e.g. for dice)
locked?
Section titled “locked?”
optionallocked:boolean
Defined in: packages/types/src/doc.ts:55
Make piece non-interactive?
Default
Section titled “Default”false
optionalname:string
Defined in: packages/types/src/doc.ts:24
position?
Section titled “position?”
optionalposition:Vector3Tuple
Defined in: packages/types/src/doc.ts:35
World position in meters.
Default
Section titled “Default”[0, 0, 0]rotation?
Section titled “rotation?”
optionalrotation:Vector3Tuple
Defined in: packages/types/src/doc.ts:45
Euler rotation (degrees)
Default
Section titled “Default”[0, 0, 0]scale?
Section titled “scale?”
optionalscale:Vector3Tuple
Defined in: packages/types/src/doc.ts:40
Unitless multiplier applied to the model.
Default
Section titled “Default”[1, 1, 1]
optionalsrc:string
Defined in: packages/types/src/doc.ts:26
Path to a glTF/GLB model
template?
Section titled “template?”
optionaltemplate:string
Defined in: packages/types/src/doc.ts:30
Key into the sibling templates object to inherit defaults from
Templates
Section titled “Templates”Templates =
Record<string,PieceTemplate>
Defined in: packages/types/src/doc.ts:89
Reusable piece defaults, keyed by template name. Templates can inherit from
other templates via the template field, and share syntax with pieces minus
a children property.
Example
Section titled “Example”{ "$schema": "https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json", "templates": { "defaults": { "scale": [0.1, 0.1, 0.1] }, "redToken": { "template": "defaults", "name": "Red token", "src": "redToken.glb" } }, "children": [ { "template": "redToken", "position": [0.0, 0, 0] }, { "template": "redToken", "position": [0.1, 0, 0] }, { "template": "redToken", "position": [0.2, 0, 0] } ]}Presence
Section titled “Presence”FocusOp
Section titled “FocusOp”Defined in: packages/types/src/presence.ts:31
Cursor focus (what the user is looking at) — no automerge equivalent
Properties
Section titled “Properties”action
Section titled “action”action:
"focus"
Defined in: packages/types/src/presence.ts:32
path:
AnchoredPath
Defined in: packages/types/src/presence.ts:33
MoveOp
Section titled “MoveOp”Defined in: packages/types/src/presence.ts:51
Move — no automerge equivalent yet (planned feature)
Properties
Section titled “Properties”action
Section titled “action”action:
"move"
Defined in: packages/types/src/presence.ts:52
path:
AnchoredPath
Defined in: packages/types/src/presence.ts:53
to:
AnchoredPath
Defined in: packages/types/src/presence.ts:54
PresenceState
Section titled “PresenceState”Defined in: packages/types/src/presence.ts:61
Presence state broadcast between peers
Properties
Section titled “Properties”client?
Section titled “client?”
optionalclient:string
Defined in: packages/types/src/presence.ts:63
color?
Section titled “color?”
optionalcolor:string
Defined in: packages/types/src/presence.ts:62
cursors?
Section titled “cursors?”
optionalcursors:Record<string, {position?:Vector3Tuple;rotation?:Vector3Tuple; }>
Defined in: packages/types/src/presence.ts:66
Defined in: packages/types/src/presence.ts:64
Defined in: packages/types/src/presence.ts:40
Anchored version of automerge’s PutPatch
Properties
Section titled “Properties”action
Section titled “action”action:
"put"
Defined in: packages/types/src/presence.ts:41
conflict?
Section titled “conflict?”
optionalconflict:boolean
Defined in: packages/types/src/presence.ts:44
path:
AnchoredPath
Defined in: packages/types/src/presence.ts:42
value:
JsonValue
Defined in: packages/types/src/presence.ts:43
Client
Section titled “Client”Client =
string
Defined in: packages/types/src/presence.ts:18
Client identifier in npm format: name@version or name#commit
(e.g. "my-plugin@1.0.0", "@garbo-succus/probability-nz#c0mM1t").
Color =
string
Defined in: packages/types/src/presence.ts:11
Any valid CSS color string (e.g. "red", "#abc", "rgb(0,0,0)").
Advanced
Section titled “Advanced”GameManifest
Section titled “GameManifest”Defined in: packages/types/src/doc.ts:149
Static game definition — imported to create a new GameState. Similar to a
GameState but with a scenarios array on the root instead of children.
Example
Section titled “Example”// 2-4 and 4-8 player scenarios{ "$schema": "https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json", "templates": { "token": { "src": "token.glb" } }, "scenarios": [ { "name": "2-4 player setup", "children": [ { "name": "Game board", "src": "gameboard.glb", "children": [ { "template": "token" }, { "template": "token" }, { "template": "token" }, { "template": "token" } ] } ] }, { "name": "4-8 player setup", "children": [ { "name": "Game board", "src": "gameboard.glb", "children": [ { "template": "token" }, { "template": "token" }, { "template": "token" }, { "template": "token" }, { "template": "token" }, { "template": "token" }, { "template": "token" }, { "template": "token" } ] } ] } ]}Properties
Section titled “Properties”$schema
Section titled “$schema”$schema:
"https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json"
Defined in: packages/types/src/doc.ts:150
scenarios
Section titled “scenarios”scenarios:
Scenario[]
Defined in: packages/types/src/doc.ts:152
templates
Section titled “templates”templates:
Templates
Defined in: packages/types/src/doc.ts:151
Scenario
Section titled “Scenario”Defined in: packages/types/src/doc.ts:95
A named starting arrangement of pieces
Properties
Section titled “Properties”children
Section titled “children”children:
Piece[]
Defined in: packages/types/src/doc.ts:97
optionalname:string
Defined in: packages/types/src/doc.ts:96
Vector3Tuple
Section titled “Vector3Tuple”Vector3Tuple = [
number,number,number]
Defined in: packages/types/src/doc.ts:8
[x, y, z] — right-handed Y-up coordinate system (from Three.js).
Type Aliases
Section titled “Type Aliases”AnchoredPath
Section titled “AnchoredPath”AnchoredPath = [
string,...Prop[]]
Defined in: packages/types/src/presence.ts:25
A path anchored to a specific Automerge object. First element is always an ObjID string.
Example
Section titled “Example”`["2@abc123", "children", 0, "position"]`AutomergeUrl
Section titled “AutomergeUrl”AutomergeUrl =
RepoAutomergeUrl&`automerge:${string}`
Defined in: packages/types/src/hashroute.ts:4
Automerge document URL (e.g. automerge:111111111111111111).
JsonValue
Section titled “JsonValue”JsonValue =
string|number|boolean|null|JsonArray|JsonObject
Defined in: packages/types/src/hashroute.ts:15
JSON-serializable value
Prop =
string|number
Defined in: node_modules/.pnpm/@automerge+automerge@3.2.4/node_modules/@automerge/automerge/dist/wasm_types.d.ts:8
Variables
Section titled “Variables”SCHEMA_URL
Section titled “SCHEMA_URL”
constSCHEMA_URL:"https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json"="https://registry.probability.nz/npm/@probability-nz/types/-/types-0.0.0.tgz/dist/analog.json"
Defined in: packages/types/src/doc.ts:1