@irtio/schema 4.7.0 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +124 -10
  2. package/dist/index.js +708 -62
  3. package/package.json +4 -1
package/dist/index.d.ts CHANGED
@@ -2,8 +2,11 @@
2
2
  * Type builders and runtime type descriptors.
3
3
  *
4
4
  * The type menu is exactly: bool u8 u16 u32 i32 f32 f64 str(max) enumOf(...) ref(entity)
5
- * list(T, max) struct({...}) plus `.opt` and `.default(v)` chainable on any of them.
6
- * Nothing else — the menu is deliberately closed.
5
+ * bytes(n) list(T, max) struct({...}) plus `.opt` and `.default(v)` chainable on any of them.
6
+ * Nothing else — the menu is deliberately closed. `bytes(n)` is the one deliberate addition: a
7
+ * fixed-length `Uint8Array` whose deltas carry only the byte ranges that changed, for tile chunks
8
+ * and other dense buffers that `list(u8, n)` (whole-replace, 8 bytes per element in memory) serves
9
+ * badly.
7
10
  */
8
11
  type ScalarKind = 'bool' | 'u8' | 'u16' | 'u32' | 'i32' | 'f32' | 'f64';
9
12
  /** Common flags on every descriptor. */
@@ -25,6 +28,9 @@ type TypeDesc = (DescBase & {
25
28
  }) | (DescBase & {
26
29
  readonly kind: 'ref';
27
30
  readonly entity: string;
31
+ }) | (DescBase & {
32
+ readonly kind: 'bytes';
33
+ readonly n: number;
28
34
  }) | (DescBase & {
29
35
  readonly kind: 'list';
30
36
  readonly item: TypeDesc;
@@ -65,6 +71,15 @@ declare function str(max: number): Type<string>;
65
71
  declare function enumOf<const V extends readonly [string, ...string[]]>(...values: V): Type<V[number]>;
66
72
  /** Reference to an entity instance by id; encoded as the id string. */
67
73
  declare function ref<E extends string>(entity: E): Type<string>;
74
+ /** The largest `n` a `bytes(n)` field may declare. */
75
+ declare const BYTES_MAX = 65535;
76
+ /**
77
+ * Fixed-length byte buffer: the value is a `Uint8Array` of exactly `n` bytes (zero-filled by
78
+ * default). Unlike a list, a change inside it is sent as the byte ranges that changed.
79
+ */
80
+ declare function bytes(n: number): Type<Uint8Array>;
81
+ /** Does `d` contain a `bytes(n)` field, directly or anywhere inside a struct or list? */
82
+ declare function containsBytes(d: TypeDesc): boolean;
68
83
  /** Bounded list, whole-replace on the wire. */
69
84
  declare function list<T, D extends boolean>(item: Type<T, D>, max: number): Type<T[]>;
70
85
  /** Nested object; fields are tracked and encoded individually. */
@@ -111,6 +126,16 @@ declare function cloneValue<T>(v: T): T;
111
126
  * Returns a fresh value (never aliases `v` for lists/structs).
112
127
  */
113
128
  declare function normalizeValue(d: TypeDesc, v: unknown, path?: string): unknown;
129
+ /**
130
+ * A fresh, plain `Uint8Array` copy. Not `v.slice()` alone: a Node `Buffer` is a `Uint8Array` whose
131
+ * `slice` is a *view*, which would alias the caller's memory into state. A tracked `bytes` proxy is
132
+ * not a view at all (`ArrayBuffer.isView` is false) and copies through its own bound `slice`.
133
+ */
134
+ declare function copyBytes(v: Uint8Array): Uint8Array;
135
+ /** Standard base64 (with padding). Dependency-free, so it runs in every host the schema does. */
136
+ declare function bytesToBase64(b: Uint8Array): string;
137
+ /** Decodes standard base64 (padding required). Throws on anything else. */
138
+ declare function base64ToBytes(s: string): Uint8Array;
114
139
 
115
140
  /**
116
141
  * The `physics` entity option (D22): which of an entity's fields the simulation owns, and which
@@ -212,7 +237,7 @@ declare function applyChannel2d(channel: PhysicsBodyChannel, value: number, targ
212
237
  }): void;
213
238
 
214
239
  /**
215
- * M6 lane K (D77): the declarative ownership policies a collection may declare.
240
+ * The declarative ownership policies a collection may declare.
216
241
  *
217
242
  * A relay room with state has no room file, so the three things a rung-1 room file exists for —
218
243
  * add one record per player, remove it when they go, and decide contested handovers — have to be
@@ -786,10 +811,10 @@ declare function createState<S extends AnySchema>(schema: S, init?: Partial<Reco
786
811
  * Kept to simple mapped types so a 30-entity schema type-checks fast (see test/large.test-d.ts).
787
812
  */
788
813
 
789
- type DeepReadonly<T> = T extends (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? {
814
+ type DeepReadonly<T> = T extends Uint8Array ? Readonly<Uint8Array> : T extends (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? {
790
815
  readonly [K in keyof T]: DeepReadonly<T[K]>;
791
816
  } : T;
792
- type DeepWritable<T> = T extends readonly (infer U)[] ? DeepWritable<U>[] : T extends object ? {
817
+ type DeepWritable<T> = T extends Uint8Array ? Uint8Array : T extends readonly (infer U)[] ? DeepWritable<U>[] : T extends object ? {
793
818
  -readonly [K in keyof T]: DeepWritable<T[K]>;
794
819
  } : T;
795
820
  /** The writable view of an instance the client owns (the client SDK hands these out). */
@@ -956,14 +981,35 @@ type BroadcastProxy<R extends RpcMap> = {
956
981
  * - Field indices are the declaration indices on the collection/struct descriptor.
957
982
  * - A struct field is dirty when its bit is in `fields`. If `nested` has an entry for it, only the
958
983
  * nested-dirty fields are sent; no nested entry ⇒ the whole struct value is re-sent.
984
+ * - A `bytes(n)` field is dirty when its bit is in `fields`. If `ranges` has an entry for it, only
985
+ * those byte ranges changed (sorted, merged, non-overlapping, half-open); no entry ⇒ the whole
986
+ * buffer is re-sent. So a field is *whole* iff its bit is set and it has neither a `nested` nor a
987
+ * `ranges` entry.
959
988
  * - `owner: true` ⇒ the owner system field changed (entities only).
960
989
  * - `added` records are sent whole (every field + owner); `removed` ids are sent as removes.
961
990
  * An id is never in more than one of `added` / `removed` / `updated`.
962
991
  * - Singletons use `SINGLETON_ID` (`''`) in `updated` and never add/remove.
963
992
  */
993
+ /** A half-open byte range `[start, end)` inside a `bytes(n)` field. */
994
+ interface ByteRange {
995
+ readonly start: number;
996
+ readonly end: number;
997
+ }
998
+ /**
999
+ * The most ranges one `bytes(n)` field carries per tick. More than this and the field is sent
1000
+ * whole — past a handful of scattered edits the per-span framing stops paying for itself, and the
1001
+ * cap bounds what a decoder has to accept.
1002
+ */
1003
+ declare const MAX_BYTE_RANGES = 16;
964
1004
  interface FieldMask {
965
1005
  readonly fields: Set<number>;
966
1006
  readonly nested: Map<number, FieldMask>;
1007
+ /**
1008
+ * Byte ranges for a dirty `bytes(n)` field at `idx`: sorted, merged, non-overlapping. Absent (or
1009
+ * no entry for `idx`) ⇒ the field is whole. Created lazily, so masks without bytes fields never
1010
+ * carry it.
1011
+ */
1012
+ ranges?: Map<number, ByteRange[]>;
967
1013
  }
968
1014
  interface RecordDirty {
969
1015
  readonly mask: FieldMask;
@@ -985,6 +1031,32 @@ declare function collectionDirty(dirty: DirtySet, collection: string): Collectio
985
1031
  */
986
1032
  declare function markField(dirty: DirtySet, collection: string, id: string, path: readonly number[]): void;
987
1033
  declare function markPath(mask: FieldMask, path: readonly number[]): void;
1034
+ /**
1035
+ * Marks bytes `[start, end)` of the `bytes(n)` field at `path` dirty on a record. A field already
1036
+ * dirty whole stays whole; otherwise the range is merged into the field's ranges, which collapse
1037
+ * to whole once they stop being cheaper than the field itself (see {@link settleRanges}).
1038
+ */
1039
+ declare function markBytes(dirty: DirtySet, collection: string, id: string, path: readonly number[], start: number, end: number, n: number): void;
1040
+ declare function markBytesPath(mask: FieldMask, path: readonly number[], start: number, end: number, n: number): void;
1041
+ /**
1042
+ * Encoded size of a byte-range patch body: the span count, then per span its offset, its length
1043
+ * and its bytes. The codec's PATCH-or-WHOLE choice compares exactly this against `n`.
1044
+ */
1045
+ declare function rangesPatchBytes(ranges: readonly ByteRange[]): number;
1046
+ /**
1047
+ * Applies the caps: `ranges` if they are still worth sending as a patch, `undefined` (whole) when
1048
+ * there are more than {@link MAX_BYTE_RANGES} of them or the patch would be at least as big as the
1049
+ * field. `n` may be omitted where it is unknown (`mergeMask`); only the count cap applies then.
1050
+ */
1051
+ declare function settleRanges(ranges: ByteRange[], n?: number): ByteRange[] | undefined;
1052
+ /** The union of two range lists, sorted, with overlapping and adjacent ranges merged. */
1053
+ declare function unionRanges(a: readonly ByteRange[], b: readonly ByteRange[]): ByteRange[];
1054
+ /**
1055
+ * The ranges where `a` and `b` (same length) differ, merging runs separated by fewer than
1056
+ * `gap` equal bytes (a short gap costs less resent than a new span's framing). May return more
1057
+ * than {@link MAX_BYTE_RANGES}; pass the result through {@link settleRanges}.
1058
+ */
1059
+ declare function diffByteRanges(a: Uint8Array, b: Uint8Array, gap?: number): ByteRange[];
988
1060
  declare function markOwner(dirty: DirtySet, collection: string, id: string): void;
989
1061
  declare function markAdd(dirty: DirtySet, collection: string, id: string): void;
990
1062
  declare function markRemove(dirty: DirtySet, collection: string, id: string): void;
@@ -1097,6 +1169,13 @@ declare function bytesEqual(a: Uint8Array, b: Uint8Array): boolean;
1097
1169
  * the owner bit is set, then the dirty fields in index order. A dirty struct field is written
1098
1170
  * as its presence byte (when `.opt`) followed by a nested mask of `ceil(n / 8)` bytes — all
1099
1171
  * bits set when the whole struct is dirty — and its dirty fields under the same rule.
1172
+ * - `bytes(n)`: snapshot form is the presence byte (when `.opt`) and exactly `n` raw bytes — the
1173
+ * length is implied by the schema. Delta form (a dirty bytes field in an update) is the presence
1174
+ * byte (when `.opt`; 0 = cleared, nothing follows), then a tag byte: 0 = WHOLE (`n` raw bytes)
1175
+ * or 1 = PATCH (varint span count 1..16, then per span varint offset, varint length ≥ 1 and that
1176
+ * many raw bytes; spans strictly ascending and non-overlapping). PATCH is written exactly when
1177
+ * the mask carries ranges for the field and the patch is smaller than the whole value, which is
1178
+ * a function of (mask, n) alone — so `estimateSize` stays exact.
1100
1179
  *
1101
1180
  * Encoding validates: oversize strings/lists, out-of-range or non-integer ints, wrong types,
1102
1181
  * missing required values and unknown enum members all throw with the field path.
@@ -1106,6 +1185,11 @@ declare function bytesEqual(a: Uint8Array, b: Uint8Array): boolean;
1106
1185
  * surfaces as a refused frame rather than as a value in state. The single exception is
1107
1186
  * `decodeSnapshot`, which coerces a non-finite float to the field default and warns, because
1108
1187
  * those bytes can be a room's own save and refusing them loses the room; see the comment there.
1188
+ *
1189
+ * A delta's shape is bounded before its ops are read (#147): no more collections than the schema
1190
+ * has, no more ops than bytes left, every id and owner within `ID_MAX_BYTES`, and, when the caller
1191
+ * passes `maxOps` (the runtime does for a client WRITE), no more ops than that in total. A crafted
1192
+ * frame is refused at its header instead of costing a second of decode first.
1109
1193
  */
1110
1194
 
1111
1195
  /**
@@ -1126,6 +1210,17 @@ interface ValueSink {
1126
1210
  }
1127
1211
  /** Writes one value in snapshot form (presence byte first when the descriptor is `.opt`). */
1128
1212
  declare function writeValue(w: ValueSink, desc: TypeDesc, v: unknown, path?: string): void;
1213
+ /**
1214
+ * A decoded byte-range patch for a `bytes(n)` field: what a delta carries in `patch[field]` when
1215
+ * the field was sent as PATCH (and `mask.ranges` has its entry). `applyDelta` writes each span
1216
+ * into the existing buffer in place.
1217
+ */
1218
+ interface BytesPatch {
1219
+ readonly spans: readonly {
1220
+ readonly offset: number;
1221
+ readonly bytes: Uint8Array;
1222
+ }[];
1223
+ }
1129
1224
  /**
1130
1225
  * How a decode answers a non-finite `f32`/`f64` it reads off the wire.
1131
1226
  *
@@ -1211,14 +1306,18 @@ interface Delta {
1211
1306
  declare function encodeDelta(schema: AnySchema, state: PlainState, dirty: DirtySet, header: Header): Uint8Array;
1212
1307
  /** Exact byte length of `encodeDelta` for the same arguments, without building the payload. */
1213
1308
  declare function estimateSize(schema: AnySchema, state: PlainState, dirty: DirtySet): number;
1214
- declare function decodeDelta(schema: AnySchema, bytes: Uint8Array): Delta;
1309
+ interface DecodeDeltaOptions {
1310
+ /** Refuse the delta if its ops across all collections exceed this. Unbounded when omitted. */
1311
+ readonly maxOps?: number;
1312
+ }
1313
+ declare function decodeDelta(schema: AnySchema, bytes: Uint8Array, options?: DecodeDeltaOptions): Delta;
1215
1314
  /**
1216
1315
  * `decodeDelta` against a caller-owned reader, which is left positioned at the first byte after
1217
1316
  * the delta body. Trailing bytes are the caller's: the `CORRECT` frame appends `clientTick`
1218
1317
  * (u32) after the delta body (week 8, D19) — a decoder that does not know about the suffix
1219
1318
  * ignores it, which is what makes the extension additive.
1220
1319
  */
1221
- declare function decodeDeltaFrom(schema: AnySchema, r: ByteReader): Delta;
1320
+ declare function decodeDeltaFrom(schema: AnySchema, r: ByteReader, options?: DecodeDeltaOptions): Delta;
1222
1321
  /**
1223
1322
  * Applies a decoded delta in place. Only the `Collection` interface and plain property
1224
1323
  * assignment are used, so this also works against a tracked proxy state.
@@ -1290,6 +1389,14 @@ declare function walkSnapshot(schema: AnySchema, bytes: Uint8Array | ByteReader,
1290
1389
  * Paths are declaration indices, outermost first (`[fieldIndex, nestedIndex, ...]`), exactly the
1291
1390
  * shape `markField` wants. Lists are whole-replace on the wire, so anything that changes inside a
1292
1391
  * list marks the list field itself.
1392
+ *
1393
+ * A `bytes(n)` field reads back as a proxy over the stored `Uint8Array`. Every write path through
1394
+ * it — `data[i] = v`, `set`, `fill`, `copyWithin`, `sort`, `reverse` — is validated (no silent
1395
+ * wrap-around mod 256) and marks only the byte range it actually changed (`markBytes`), so a one
1396
+ * tile edit sends a few bytes rather than the chunk. Every other member is forwarded to the target
1397
+ * itself, because TypedArray methods and accessors throw when `this` is a Proxy. Two holes are
1398
+ * documented rather than closed: `subarray()` and `.buffer` hand back untracked views of the same
1399
+ * memory, and `ArrayBuffer.isView(proxy)` is false.
1293
1400
  */
1294
1401
 
1295
1402
  interface Tracked<S> {
@@ -1320,6 +1427,11 @@ declare function frozenProxy<T>(value: T, ownershipHint: string): DeepReadonly<T
1320
1427
 
1321
1428
  interface SchemaChange {
1322
1429
  readonly kind: 'additive' | 'breaking';
1430
+ /**
1431
+ * Which part of the schema changed. `path` alone cannot say: a collection path is the bare
1432
+ * collection name, and `rpc` / `message` are legal collection names (issue #226).
1433
+ */
1434
+ readonly scope: SchemaChangeScope;
1323
1435
  /** Stable machine tag, e.g. `field.removed`, `enum.appended`. */
1324
1436
  readonly code: string;
1325
1437
  /** Dotted path to the changed thing, e.g. `players.color`, `rpc.dealCards.params.count`. */
@@ -1327,11 +1439,13 @@ interface SchemaChange {
1327
1439
  /** One-line human message, printed verbatim by the CLI. */
1328
1440
  readonly message: string;
1329
1441
  }
1442
+ type SchemaChangeScope = 'collection' | 'rpc' | 'message' | 'roles';
1330
1443
  /** Compares two compiled schemas and returns every classified change, sorted by path then code. */
1331
1444
  declare function diffSchemas(oldSchema: AnySchema, newSchema: AnySchema): SchemaChange[];
1332
1445
  /**
1333
- * True when every breaking change in `changes` lives under the RPC table (`rpc` / `rpc.*`) or the
1334
- * message table (`message.*`), and there is at least one. Such a change breaks connected clients
1446
+ * True when every breaking change in `changes` has scope `rpc` or `message` (the RPC table or the
1447
+ * message table), and there is at least one. Scope, not the path string: a collection named `rpc`
1448
+ * or `message` has paths that look like the tables' (issue #226). Such a change breaks connected clients
1335
1449
  * (the version fence reconnects them) but touches nothing a snapshot stores, so a deploy needs
1336
1450
  * `--allow-breaking` and no migration: a chain step without one decodes and re-encodes losslessly.
1337
1451
  *
@@ -1344,4 +1458,4 @@ declare function diffSchemas(oldSchema: AnySchema, newSchema: AnySchema): Schema
1344
1458
  */
1345
1459
  declare function breakingIsWireOnly(changes: readonly SchemaChange[]): boolean;
1346
1460
 
1347
- export { type AddOptions, type AnyDef, type AnyMessageMap, type AnyRpc, type AnySchema, type AnyType, type Body2dState, type BodyFieldsOf, type BroadcastProxy, ByteReader, ByteWriter, CANONICAL_VERSION, type ClientCallProxy, type ClientImplementations, type ClientRpcs, type ClientState, type Collection, type CollectionDesc, type CollectionDirty, type DecodeSnapshotOptions, type DecodedSnapshot, type DeepReadonly, type DeepWritable, type DefMap, type Delta, type DeltaCollection, type DeltaOp, type DirtySet, EntityCollection, type EntityDef, type EntityOptions, type EntityPhysics, type FieldDesc, type FieldMask, type Fields, type FromCanonicalOptions, type GridDesc, type GridOptions, type Header, ID_MAX_BYTES, type Implementations, type Infer, type InferFields, type InitFields, type InitOf, type InstanceOf, type Kind, MAX_MESSAGES, MAX_USER_RPCS, type MessageChannels, type MessageDesc, type MessageMap, type MessageNames, type MessageValue, type MessagesOf, type OwnableKeys, type Owned, type OwnershipDesc, type OwnershipLeave, type OwnershipLeaveAction, type OwnershipOptions, type OwnershipPosition, type OwnershipTransfer, PERSIST_BLOB_BYTES, PHYSICS_BODY_CHANNELS, type PhysicsBodyChannel, type PhysicsBodyMap, type PhysicsDesc, type PhysicsKeys, type PlainState, RESERVED_COLLECTION_NAMES, RESERVED_RPC_NAMES, RESERVED_RPC_PREFIX, type ReadOptions, type ReadonlyBodyFields, type ReadonlyCollection, type RecordDirty, type RoleOf, type RpcDef, type RpcDesc, type RpcDirection, type RpcMap, type RpcParams, type RpcReturns, type RpcSpec, SERVER_OWNER, SINGLETON_ID, type Schema, type SchemaChange, type SchemaDefs, type SchemaIssue, type SchemaMessages, type SchemaOptions, type SchemaRoles, type SchemaRpc, type ServerCallProxy, type ServerMessageChannels, type ServerOwnedKeys, type ServerRpcs, type SingletonDef, type SnapshotOptions, type State, type Tracked, type Type, type TypeDesc, type ValueSink, type Visibility, type VisibleKeys, type WalkEvents, angleFrom2d, applyChannel2d, applyDelta, bool, breakingIsWireOnly, bytesEqual, canonicalOwnership, canonicalPhysics, canonicalType, channelOf2d, client, cloneValue, collectionDirty, compileOwnership, compilePhysics, computeDirty, createDirtySet, createFieldMask, createState, decodeDelta, decodeDeltaFrom, decodeFields, decodeSnapshot, defaultRecord, defaultValue, defineSchema, describeType, diffSchemas, encodeDelta, encodeFields, encodeSnapshot, entity, enumOf, estimateSize, f32, f64, filterDirty, frozenProxy, i32, isDirtyEmpty, isWhole, list, markAdd, markField, markOwner, markPath, markRemove, maxEncodedBytes, mergeDirty, mergeMask, normalizeRecord, normalizeValue, ownershipFromCanonical, parseHold, physicsFromCanonical, readValue, reconcileCollection, ref, schemaFromCanonical, server, sha256, sha256Hex, singleton, stableStringify, str, struct, toHex, track, u16, u32, u8, utf8Length, validateForDeploy, validateValue, walkDelta, walkSnapshot, writeValue };
1461
+ export { type AddOptions, type AnyDef, type AnyMessageMap, type AnyRpc, type AnySchema, type AnyType, BYTES_MAX, type Body2dState, type BodyFieldsOf, type BroadcastProxy, type ByteRange, ByteReader, ByteWriter, type BytesPatch, CANONICAL_VERSION, type ClientCallProxy, type ClientImplementations, type ClientRpcs, type ClientState, type Collection, type CollectionDesc, type CollectionDirty, type DecodeDeltaOptions, type DecodeSnapshotOptions, type DecodedSnapshot, type DeepReadonly, type DeepWritable, type DefMap, type Delta, type DeltaCollection, type DeltaOp, type DirtySet, EntityCollection, type EntityDef, type EntityOptions, type EntityPhysics, type FieldDesc, type FieldMask, type Fields, type FromCanonicalOptions, type GridDesc, type GridOptions, type Header, ID_MAX_BYTES, type Implementations, type Infer, type InferFields, type InitFields, type InitOf, type InstanceOf, type Kind, MAX_BYTE_RANGES, MAX_MESSAGES, MAX_USER_RPCS, type MessageChannels, type MessageDesc, type MessageMap, type MessageNames, type MessageValue, type MessagesOf, type OwnableKeys, type Owned, type OwnershipDesc, type OwnershipLeave, type OwnershipLeaveAction, type OwnershipOptions, type OwnershipPosition, type OwnershipTransfer, PERSIST_BLOB_BYTES, PHYSICS_BODY_CHANNELS, type PhysicsBodyChannel, type PhysicsBodyMap, type PhysicsDesc, type PhysicsKeys, type PlainState, RESERVED_COLLECTION_NAMES, RESERVED_RPC_NAMES, RESERVED_RPC_PREFIX, type ReadOptions, type ReadonlyBodyFields, type ReadonlyCollection, type RecordDirty, type RoleOf, type RpcDef, type RpcDesc, type RpcDirection, type RpcMap, type RpcParams, type RpcReturns, type RpcSpec, SERVER_OWNER, SINGLETON_ID, type Schema, type SchemaChange, type SchemaChangeScope, type SchemaDefs, type SchemaIssue, type SchemaMessages, type SchemaOptions, type SchemaRoles, type SchemaRpc, type ServerCallProxy, type ServerMessageChannels, type ServerOwnedKeys, type ServerRpcs, type SingletonDef, type SnapshotOptions, type State, type Tracked, type Type, type TypeDesc, type ValueSink, type Visibility, type VisibleKeys, type WalkEvents, angleFrom2d, applyChannel2d, applyDelta, base64ToBytes, bool, breakingIsWireOnly, bytes, bytesEqual, bytesToBase64, canonicalOwnership, canonicalPhysics, canonicalType, channelOf2d, client, cloneValue, collectionDirty, compileOwnership, compilePhysics, computeDirty, containsBytes, copyBytes, createDirtySet, createFieldMask, createState, decodeDelta, decodeDeltaFrom, decodeFields, decodeSnapshot, defaultRecord, defaultValue, defineSchema, describeType, diffByteRanges, diffSchemas, encodeDelta, encodeFields, encodeSnapshot, entity, enumOf, estimateSize, f32, f64, filterDirty, frozenProxy, i32, isDirtyEmpty, isWhole, list, markAdd, markBytes, markBytesPath, markField, markOwner, markPath, markRemove, maxEncodedBytes, mergeDirty, mergeMask, normalizeRecord, normalizeValue, ownershipFromCanonical, parseHold, physicsFromCanonical, rangesPatchBytes, readValue, reconcileCollection, ref, schemaFromCanonical, server, settleRanges, sha256, sha256Hex, singleton, stableStringify, str, struct, toHex, track, u16, u32, u8, unionRanges, utf8Length, validateForDeploy, validateValue, walkDelta, walkSnapshot, writeValue };