@oasys/oecs 0.3.0 → 0.4.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 (204) hide show
  1. package/README.md +196 -267
  2. package/dist/array-CxbPyiHO.cjs +1 -0
  3. package/dist/array-uFR7Q8fU.js +132 -0
  4. package/dist/core/ecs/access_check.d.ts +77 -0
  5. package/dist/core/ecs/access_check.d.ts.map +1 -0
  6. package/dist/core/ecs/archetype.d.ts +474 -0
  7. package/dist/core/ecs/archetype.d.ts.map +1 -0
  8. package/dist/core/ecs/builtin_relations.d.ts +43 -0
  9. package/dist/core/ecs/builtin_relations.d.ts.map +1 -0
  10. package/dist/core/ecs/command_log.d.ts +113 -0
  11. package/dist/core/ecs/command_log.d.ts.map +1 -0
  12. package/dist/core/ecs/component.d.ts +106 -0
  13. package/dist/core/ecs/component.d.ts.map +1 -0
  14. package/dist/core/ecs/compute_backend.d.ts +37 -0
  15. package/dist/core/ecs/compute_backend.d.ts.map +1 -0
  16. package/dist/core/ecs/dispatch_trace.d.ts +93 -0
  17. package/dist/core/ecs/dispatch_trace.d.ts.map +1 -0
  18. package/dist/core/ecs/ecs.d.ts +533 -0
  19. package/dist/core/ecs/ecs.d.ts.map +1 -0
  20. package/dist/core/ecs/ecs_memory.d.ts +179 -0
  21. package/dist/core/ecs/ecs_memory.d.ts.map +1 -0
  22. package/dist/core/ecs/entity.d.ts +28 -0
  23. package/dist/core/ecs/entity.d.ts.map +1 -0
  24. package/dist/core/ecs/event.d.ts +54 -0
  25. package/dist/core/ecs/event.d.ts.map +1 -0
  26. package/dist/core/ecs/frame_trace.d.ts +133 -0
  27. package/dist/core/ecs/frame_trace.d.ts.map +1 -0
  28. package/dist/core/ecs/host_commands.d.ts +252 -0
  29. package/dist/core/ecs/host_commands.d.ts.map +1 -0
  30. package/dist/core/ecs/index.d.ts +41 -0
  31. package/dist/core/ecs/index.d.ts.map +1 -0
  32. package/dist/core/ecs/observer.d.ts +142 -0
  33. package/dist/core/ecs/observer.d.ts.map +1 -0
  34. package/dist/core/ecs/query.d.ts +557 -0
  35. package/dist/core/ecs/query.d.ts.map +1 -0
  36. package/dist/core/ecs/ref.d.ts +31 -0
  37. package/dist/core/ecs/ref.d.ts.map +1 -0
  38. package/dist/core/ecs/relation.d.ts +231 -0
  39. package/dist/core/ecs/relation.d.ts.map +1 -0
  40. package/dist/core/ecs/resource.d.ts +33 -0
  41. package/dist/core/ecs/resource.d.ts.map +1 -0
  42. package/dist/core/ecs/resume.d.ts +85 -0
  43. package/dist/core/ecs/resume.d.ts.map +1 -0
  44. package/dist/core/ecs/run_condition.d.ts +75 -0
  45. package/dist/core/ecs/run_condition.d.ts.map +1 -0
  46. package/dist/core/ecs/schedule.d.ts +133 -0
  47. package/dist/core/ecs/schedule.d.ts.map +1 -0
  48. package/dist/core/ecs/sparse_store.d.ts +107 -0
  49. package/dist/core/ecs/sparse_store.d.ts.map +1 -0
  50. package/dist/core/ecs/store.d.ts +1149 -0
  51. package/dist/core/ecs/store.d.ts.map +1 -0
  52. package/dist/core/ecs/store_layout_listener.d.ts +23 -0
  53. package/dist/core/ecs/store_layout_listener.d.ts.map +1 -0
  54. package/dist/core/ecs/system.d.ts +134 -0
  55. package/dist/core/ecs/system.d.ts.map +1 -0
  56. package/dist/core/ecs/utils/arrays.d.ts +7 -0
  57. package/dist/core/ecs/utils/arrays.d.ts.map +1 -0
  58. package/dist/core/ecs/utils/constants.d.ts +12 -0
  59. package/dist/core/ecs/utils/constants.d.ts.map +1 -0
  60. package/dist/core/ecs/utils/error.d.ts +51 -0
  61. package/dist/core/ecs/utils/error.d.ts.map +1 -0
  62. package/dist/core/reactive/array.d.ts +24 -0
  63. package/dist/core/reactive/array.d.ts.map +1 -0
  64. package/dist/core/reactive/index.cjs +1 -0
  65. package/dist/core/reactive/index.d.ts +10 -0
  66. package/dist/core/reactive/index.d.ts.map +1 -0
  67. package/dist/core/reactive/index.js +17 -0
  68. package/dist/core/reactive/interop.d.ts +19 -0
  69. package/dist/core/reactive/interop.d.ts.map +1 -0
  70. package/dist/core/reactive/kernel.d.ts +71 -0
  71. package/dist/core/reactive/kernel.d.ts.map +1 -0
  72. package/dist/core/reactive/map.d.ts +16 -0
  73. package/dist/core/reactive/map.d.ts.map +1 -0
  74. package/dist/core/reactive/struct.d.ts +10 -0
  75. package/dist/core/reactive/struct.d.ts.map +1 -0
  76. package/dist/core/store/__generated__/abi.d.ts +43 -0
  77. package/dist/core/store/__generated__/abi.d.ts.map +1 -0
  78. package/dist/core/store/action_ring.d.ts +136 -0
  79. package/dist/core/store/action_ring.d.ts.map +1 -0
  80. package/dist/core/store/allocator.d.ts +238 -0
  81. package/dist/core/store/allocator.d.ts.map +1 -0
  82. package/dist/core/store/buffer_backed_column.d.ts +69 -0
  83. package/dist/core/store/buffer_backed_column.d.ts.map +1 -0
  84. package/dist/core/store/column_store.d.ts +265 -0
  85. package/dist/core/store/column_store.d.ts.map +1 -0
  86. package/dist/core/store/command_dispatch.d.ts +52 -0
  87. package/dist/core/store/command_dispatch.d.ts.map +1 -0
  88. package/dist/core/store/command_ring.d.ts +107 -0
  89. package/dist/core/store/command_ring.d.ts.map +1 -0
  90. package/dist/core/store/descriptor.d.ts +80 -0
  91. package/dist/core/store/descriptor.d.ts.map +1 -0
  92. package/dist/core/store/entity_index.d.ts +108 -0
  93. package/dist/core/store/entity_index.d.ts.map +1 -0
  94. package/dist/core/store/event_ring.d.ts +95 -0
  95. package/dist/core/store/event_ring.d.ts.map +1 -0
  96. package/dist/core/store/extend.d.ts +109 -0
  97. package/dist/core/store/extend.d.ts.map +1 -0
  98. package/dist/core/store/grow.d.ts +39 -0
  99. package/dist/core/store/grow.d.ts.map +1 -0
  100. package/dist/core/store/header.d.ts +64 -0
  101. package/dist/core/store/header.d.ts.map +1 -0
  102. package/dist/core/store/index.d.ts +16 -0
  103. package/dist/core/store/index.d.ts.map +1 -0
  104. package/dist/core/store/region_table.d.ts +74 -0
  105. package/dist/core/store/region_table.d.ts.map +1 -0
  106. package/dist/core/store/snapshot.d.ts +43 -0
  107. package/dist/core/store/snapshot.d.ts.map +1 -0
  108. package/dist/core/store/state_hash.d.ts +38 -0
  109. package/dist/core/store/state_hash.d.ts.map +1 -0
  110. package/dist/core/store/store_regions.d.ts +38 -0
  111. package/dist/core/store/store_regions.d.ts.map +1 -0
  112. package/dist/extensions/editor/editor.d.ts +149 -0
  113. package/dist/extensions/editor/editor.d.ts.map +1 -0
  114. package/dist/extensions/editor/field_handle.d.ts +35 -0
  115. package/dist/extensions/editor/field_handle.d.ts.map +1 -0
  116. package/dist/extensions/editor/index.cjs +1 -0
  117. package/dist/extensions/editor/index.d.ts +21 -0
  118. package/dist/extensions/editor/index.d.ts.map +1 -0
  119. package/dist/extensions/editor/index.js +209 -0
  120. package/dist/extensions/reactive/ecs_sync.d.ts +210 -0
  121. package/dist/extensions/reactive/ecs_sync.d.ts.map +1 -0
  122. package/dist/extensions/reactive/index.cjs +1 -0
  123. package/dist/extensions/reactive/index.d.ts +23 -0
  124. package/dist/extensions/reactive/index.d.ts.map +1 -0
  125. package/dist/extensions/reactive/index.js +225 -0
  126. package/dist/extensions/solid/index.cjs +1 -0
  127. package/dist/extensions/solid/index.d.ts +6 -0
  128. package/dist/extensions/solid/index.d.ts.map +1 -0
  129. package/dist/extensions/solid/index.js +32 -0
  130. package/dist/extensions/solid/kernel_solid.d.ts +42 -0
  131. package/dist/extensions/solid/kernel_solid.d.ts.map +1 -0
  132. package/dist/index.cjs +2 -1
  133. package/dist/index.d.ts +16 -12
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +8563 -1233
  136. package/dist/interop-CT-REx0W.cjs +1 -0
  137. package/dist/interop-CcY6ASQc.js +18 -0
  138. package/dist/kernel-DgyrLFjW.js +227 -0
  139. package/dist/kernel-yWV3XnAb.cjs +1 -0
  140. package/dist/log/console_sink.d.ts +4 -0
  141. package/dist/log/console_sink.d.ts.map +1 -0
  142. package/dist/log/index.d.ts +3 -0
  143. package/dist/log/index.d.ts.map +1 -0
  144. package/dist/log/logger.d.ts +27 -0
  145. package/dist/log/logger.d.ts.map +1 -0
  146. package/dist/primitives.cjs +1 -0
  147. package/dist/primitives.d.ts +18 -0
  148. package/dist/primitives.d.ts.map +1 -0
  149. package/dist/primitives.js +44 -0
  150. package/dist/shared-BXSZnxx4.cjs +1 -0
  151. package/dist/shared-C678TAPY.js +99 -0
  152. package/dist/shared.cjs +1 -0
  153. package/dist/shared.d.ts +22 -0
  154. package/dist/shared.d.ts.map +1 -0
  155. package/dist/shared.js +7 -0
  156. package/dist/topological_sort-DlRpSrxu.js +391 -0
  157. package/dist/topological_sort-WAT-VHb-.cjs +1 -0
  158. package/dist/type_primitives/assertions.d.ts +12 -8
  159. package/dist/type_primitives/assertions.d.ts.map +1 -1
  160. package/dist/type_primitives/binary_heap/binary_heap.d.ts +6 -2
  161. package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
  162. package/dist/type_primitives/bitset/bitset.d.ts +16 -4
  163. package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
  164. package/dist/type_primitives/brand.d.ts +6 -1
  165. package/dist/type_primitives/brand.d.ts.map +1 -1
  166. package/dist/type_primitives/error.d.ts +4 -0
  167. package/dist/type_primitives/error.d.ts.map +1 -1
  168. package/dist/type_primitives/index.d.ts +3 -0
  169. package/dist/type_primitives/index.d.ts.map +1 -1
  170. package/dist/type_primitives/sparse_map/sparse_map.d.ts +7 -3
  171. package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
  172. package/dist/type_primitives/sparse_set/sparse_set.d.ts +4 -0
  173. package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
  174. package/dist/type_primitives/topological_sort/topological_sort.d.ts +7 -3
  175. package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
  176. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +53 -16
  177. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
  178. package/dist/utils/arrays.d.ts +1 -1
  179. package/dist/utils/arrays.d.ts.map +1 -1
  180. package/dist/utils/error.d.ts +2 -20
  181. package/dist/utils/error.d.ts.map +1 -1
  182. package/package.json +36 -9
  183. package/dist/archetype.d.ts +0 -101
  184. package/dist/archetype.d.ts.map +0 -1
  185. package/dist/component.d.ts +0 -45
  186. package/dist/component.d.ts.map +0 -1
  187. package/dist/ecs.d.ts +0 -104
  188. package/dist/ecs.d.ts.map +0 -1
  189. package/dist/entity.d.ts +0 -11
  190. package/dist/entity.d.ts.map +0 -1
  191. package/dist/event.d.ts +0 -30
  192. package/dist/event.d.ts.map +0 -1
  193. package/dist/query.d.ts +0 -90
  194. package/dist/query.d.ts.map +0 -1
  195. package/dist/ref.d.ts +0 -23
  196. package/dist/ref.d.ts.map +0 -1
  197. package/dist/resource.d.ts +0 -23
  198. package/dist/resource.d.ts.map +0 -1
  199. package/dist/schedule.d.ts +0 -45
  200. package/dist/schedule.d.ts.map +0 -1
  201. package/dist/store.d.ts +0 -118
  202. package/dist/store.d.ts.map +0 -1
  203. package/dist/system.d.ts +0 -16
  204. package/dist/system.d.ts.map +0 -1
@@ -0,0 +1,77 @@
1
+ import { ComponentDef, ComponentHandle } from './component';
2
+ import { SparseComponentDef } from './sparse_store';
3
+ import { RelationDef } from './relation';
4
+ import { ResourceKey } from './resource';
5
+ import { SystemDescriptor } from './system';
6
+ interface AccessSets {
7
+ reads: Set<number>;
8
+ writes: Set<number>;
9
+ addAllowed: Set<number>;
10
+ removeAllowed: Set<number>;
11
+ hasDespawns: boolean;
12
+ resourceReads: Set<symbol>;
13
+ resourceWrites: Set<symbol>;
14
+ sparseReads: Set<number>;
15
+ sparseWrites: Set<number>;
16
+ relationReads: Set<number>;
17
+ relationWrites: Set<number>;
18
+ }
19
+ declare function setsFor(desc: SystemDescriptor): AccessSets;
20
+ /** The reads-only access surface a run condition declares (#576). A condition
21
+ * can only `reads` components (via a captured query) and `resourceReads`; every
22
+ * mutation set is empty by construction, so the same `check_*` machinery rejects
23
+ * any write/structural/resource-write a misbehaving predicate attempts. */
24
+ interface ConditionAccess {
25
+ readonly name: string;
26
+ readonly reads?: readonly ComponentDef[];
27
+ readonly resourceReads?: readonly ResourceKey<unknown>[];
28
+ }
29
+ declare class AccessCheck {
30
+ private active;
31
+ private sets;
32
+ private activeName;
33
+ private exclusive;
34
+ enter(desc: SystemDescriptor): void;
35
+ /** Open a reads-only span for a run condition (#576). No descriptor — a
36
+ * condition can gate a whole SystemSet, so it isn't attributable to one
37
+ * system — just its declared reads/resource_reads and a name for diagnostics.
38
+ * Paired with `leave()`. */
39
+ enterCondition(cond: ConditionAccess): void;
40
+ leave(): void;
41
+ isActive(): boolean;
42
+ /** Current system descriptor, if any. Null during a run-condition span. */
43
+ current(): SystemDescriptor | null;
44
+ checkRead(def: ComponentHandle): void;
45
+ checkWrite(def: ComponentHandle): void;
46
+ checkAdd(def: ComponentHandle): void;
47
+ checkRemove(def: ComponentHandle): void;
48
+ checkDestroy(): void;
49
+ checkResourceRead(key: ResourceKey<unknown>): void;
50
+ checkResourceWrite(key: ResourceKey<unknown>): void;
51
+ checkSparseRead(def: SparseComponentDef): void;
52
+ checkSparseWrite(def: SparseComponentDef): void;
53
+ checkRelationRead(def: RelationDef): void;
54
+ checkRelationWrite(def: RelationDef): void;
55
+ /** A `(*, T)` wildcard (`Query.forEachRelatedTo`, #579) reads every
56
+ * relation's reverse index, so it can't name a specific relation — it is
57
+ * authorised by the `ANY_RELATION` sentinel in `relationReads`. Honoured here
58
+ * exactly like a per-relation read, just keyed on the reserved sentinel id
59
+ * (which computeSets folds into `relationReads` like any other entry). */
60
+ checkRelationReadAny(): void;
61
+ private optionalScopes;
62
+ enterOptionalScope(optional: readonly number[]): void;
63
+ leaveOptionalScope(): void;
64
+ checkOptionalFetch(def: ComponentHandle): void;
65
+ private failComponent;
66
+ private failSparse;
67
+ private failRelation;
68
+ private failResource;
69
+ }
70
+ export declare const accessCheck: AccessCheck;
71
+ /** @internal — test seam for unit tests that need a fresh tracker. */
72
+ export declare const _accessCheckInternals: {
73
+ create: () => AccessCheck;
74
+ setsFor: typeof setsFor;
75
+ };
76
+ export {};
77
+ //# sourceMappingURL=access_check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access_check.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/access_check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BK;AAEL,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,UAAU,UAAU;IACnB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAE5B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAoHD,iBAAS,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,UAAU,CAMnD;AAED;;;2EAG2E;AAC3E,UAAU,eAAe;IACxB,QAAQ,C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,SAAS,MAAM,EAAE,GAAG,IAAI;IAIrD,kBAAkB,IAAI,IAAI;IAI1B,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAc9C,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;CASpB;AAED,eAAO,MAAM,WAAW,EAAE,WAA+B,CAAC;AAE1D,sEAAsE;AACtE,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}
@@ -0,0 +1,474 @@
1
+ import { Brand, AnyTypedArray, ColumnBacking, TypedArrayTag, BitSet } from '../../type_primitives';
2
+ import { ColumnStore } from '../store/column_store';
3
+ import { ComponentID, ComponentDef, ComponentSchema, TagToTypedArray, ColumnsForSchema, MutableColumnsForSchema, ReadonlyColumn } from './component';
4
+ import { EntityID, ReadonlyEntityIdArray } from './entity';
5
+ export type ArchetypeID = Brand<number, "archetype_id">;
6
+ export declare const asArchetypeId: (value: number) => ArchetypeID;
7
+ export interface ArchetypeEdge {
8
+ add: ArchetypeID | null;
9
+ remove: ArchetypeID | null;
10
+ /** Pre-computed column mapping for add direction: this → add target. */
11
+ addMap: Int16Array | null;
12
+ /** Pre-computed column mapping for remove direction: this → remove target. */
13
+ removeMap: Int16Array | null;
14
+ }
15
+ /**
16
+ * Cached resolution of a *multi*-component add out of this archetype: the
17
+ * target archetype the union lands in, plus the pre-built src→target batch
18
+ * transition map. Keyed (on the source archetype) by an exact N-tagged pack of
19
+ * the added component ids — see `Store.addComponents` (#659).
20
+ *
21
+ * Where `ArchetypeEdge` is the per-*component* edge the single-add path indexes
22
+ * by `edges[component_id]`, this is the per-*set* edge the plural-add path looks
23
+ * up by packed key — folding the mask hash, `archLookup`, and batch-map fetch
24
+ * the final-mask resolve repeats every call into one `Map.get`. Never
25
+ * invalidated: the archetype graph is monotonic (archetypes outlive the Store).
26
+ */
27
+ export interface CompositeAddEdge {
28
+ target: ArchetypeID;
29
+ map: Int16Array;
30
+ }
31
+ export interface ArchetypeColumnLayout {
32
+ componentId: ComponentID;
33
+ fieldNames: string[];
34
+ fieldIndex: Record<string, number>;
35
+ fieldTypes: TypedArrayTag[];
36
+ }
37
+ interface ArchetypeColumnGroup {
38
+ layout: ArchetypeColumnLayout;
39
+ columns: ColumnBacking<AnyTypedArray>[];
40
+ }
41
+ /**
42
+ * Per-column allocator. Returns a `ColumnBacking` for the field at
43
+ * `fieldIdx` of component `component_id`. The default factory (when none
44
+ * is supplied to the constructor) allocates a `GrowableTypedArray` on the
45
+ * heap; `fromColumnStore` supplies a factory that wraps SAB views instead.
46
+ */
47
+ export type ColumnFactory = (componentId: ComponentID, fieldIdx: number, tag: TypedArrayTag) => ColumnBacking<AnyTypedArray>;
48
+ /**
49
+ * Hook the host installs on every SAB-backed archetype so the Archetype
50
+ * can request a SAB grow + refresh from the host BEFORE the insertion
51
+ * that would otherwise throw `StoreColumnOverflowError`. The host (Store)
52
+ * is responsible for running `growColumnStore` and `refreshViews`
53
+ * across every SAB-backed archetype; after the handler returns,
54
+ * `arch._flatColumns[i].buf.length` is guaranteed to be `>= arch.length +
55
+ * additional`. Heap-backed archetypes leave this unset — their
56
+ * `GrowableTypedArray` grows in place. (#171 §6.1.9 Phase 3)
57
+ */
58
+ export type ArchetypeGrowHandler = (arch: Archetype, additional: number) => void;
59
+ /**
60
+ * Public, read-only window onto an archetype's rows. This is the ONLY
61
+ * surface `Query.archetypes`, `Query.forEach`, and `ChangedQuery.forEach`
62
+ * hand to callers — the concrete `Archetype` (with its structural mutators
63
+ * `removeEntity`, `moveEntityFrom`, `writeFields`, `setEdge`, and the
64
+ * mutable `getColumn`) stays internal so query iteration can't bypass the
65
+ * deferred-flush path that prevents iterator invalidation. This is the same
66
+ * back door PR #163 closed for `Store`; issue #378 closed it again for
67
+ * `Query`.
68
+ *
69
+ * `id` is the archetype's opaque identity (not a mutator) — exposed so the
70
+ * public `ECS.batchAddComponent`/`batchRemoveComponent` API can target an
71
+ * archetype without the caller holding a concrete `Archetype` reference.
72
+ */
73
+ export interface ArchetypeView {
74
+ /** Opaque archetype identity. Pass to `ECS.batch_*_component`. */
75
+ readonly id: ArchetypeID;
76
+ /** Number of **enabled** entities — the default-iteration bound (#577). Rows
77
+ * `0..entityCount-1` are enabled; disabled rows (if any) sit contiguously at
78
+ * `entityCount..totalCount-1`. `forEach` SoA loops read this, so they skip
79
+ * disabled rows for free. Use `totalCount` to span disabled rows too. */
80
+ readonly entityCount: number;
81
+ /** Total live rows, enabled + disabled (#577). Equal to `entityCount` unless
82
+ * some rows are disabled. Use for full-state work (serialization, snapshot,
83
+ * determinism) that must see every entity regardless of enabled state. */
84
+ readonly totalCount: number;
85
+ /** Number of disabled rows = `totalCount - entityCount` (#577). */
86
+ readonly disabledCount: number;
87
+ /** Raw entity ID buffer (packed `EntityID`s). Valid data at indices
88
+ * 0..totalCount-1 (enabled rows first, then disabled). */
89
+ readonly entityIds: ReadonlyEntityIdArray;
90
+ /** True if this archetype's mask includes the given component. */
91
+ hasComponent(id: ComponentID): boolean;
92
+ /** Get a single field's column (read-only). Valid data: indices 0..entityCount-1. */
93
+ getColumnRead<S extends ComponentSchema, K extends string & keyof S>(def: ComponentDef<S>, field: K): ReadonlyColumn;
94
+ /** Tuple fetch of several of one component's columns —
95
+ * `const [q, r] = arch.getColumnsRead(HexPos, "q", "r")`. One small
96
+ * array allocation per call; see the class doc on `Archetype`. */
97
+ getColumnsRead<S extends ComponentSchema, const K extends readonly (string & keyof S)[]>(def: ComponentDef<S>, ...fields: K): {
98
+ [I in keyof K]: ReadonlyColumn;
99
+ };
100
+ /** Get a single field's column **if this archetype has the component**,
101
+ * else `undefined` — the optional-query fetch-if-present accessor (#575).
102
+ * The absent branch is expected (resolve the column pointer per archetype
103
+ * span: present ⇒ column, absent ⇒ `undefined`), not an error. Same
104
+ * advisory-readonly view and `reads`-access-check as `getColumnRead`. */
105
+ getOptionalColumnRead<S extends ComponentSchema, K extends string & keyof S>(def: ComponentDef<S>, field: K): ReadonlyColumn | undefined;
106
+ }
107
+ export declare class Archetype implements ArchetypeView {
108
+ readonly id: ArchetypeID;
109
+ readonly mask: BitSet;
110
+ readonly hasColumns: boolean;
111
+ /**
112
+ * Whether a member entity occupies a real row here. True for every archetype
113
+ * except the **empty archetype** (the one with no components), where a
114
+ * component-less entity is "alive but unplaced" — it points here via
115
+ * `entityArchetype` but carries `entityRow === UNASSIGNED` and holds no
116
+ * row, exactly like a freshly `createEntity`'d one. Keeping the empty
117
+ * archetype rowless gives a component-less entity a single canonical form
118
+ * regardless of how it got there (created bare vs. lost its last component),
119
+ * so `stateHash` and zero-require query iteration don't depend on add/remove
120
+ * history. The row-materialising methods below honour this flag.
121
+ */
122
+ readonly materializesRows: boolean;
123
+ private readonly _entityIds;
124
+ length: number;
125
+ /**
126
+ * Enabled/disabled row partition (#577 — entity enable/disable). Rows
127
+ * `[0, enabled_count)` are enabled, `[enabled_count, length)` are disabled.
128
+ * `enabled_count === length` (no disabled rows) is the common case — every
129
+ * fast path below short-circuits on it, so an archetype that never disables
130
+ * an entity pays nothing. Disable/enable swap a row across the boundary
131
+ * (`disableRow`/`enableRow`); appends place enabled rows in front of the
132
+ * disabled tail (`_placeTail`). `entityCount` (the query/iteration bound)
133
+ * returns this; `length`/`totalCount` span disabled rows too. Folded into
134
+ * `stateHash` and published to the SAB descriptor so the WASM sim and
135
+ * snapshot/restore honour it.
136
+ */
137
+ enabledCount: number;
138
+ /**
139
+ * Flush-epoch stamp + captured pre-counts for the Store's per-entity flush
140
+ * 0-crossing detector (#328, #812): `_flushAdds`/`_flushRemoves` stamp each
141
+ * archetype on first sight per flush (a few field accesses) instead of probing
142
+ * a `Map<archetype_id, pre_count>` per entity — the same per-entity Map
143
+ * cost the destroy drain shed in #457. Both `_flushPreLen` and
144
+ * `_flushPreEnabled` are recorded so the settle pass can detect a 0-crossing
145
+ * on either the total (`length`) or the enabled partition (`enabledCount`) —
146
+ * an enabled append into an all-disabled archetype crosses only the latter
147
+ * (#812). Owned by Store; pure scheduling bookkeeping, never folded into
148
+ * `stateHash`/snapshot.
149
+ */
150
+ _flushSeenEpoch: number;
151
+ _flushPreLen: number;
152
+ _flushPreEnabled: number;
153
+ private readonly edges;
154
+ /**
155
+ * Cache of pre-computed transition maps for multi-component transitions
156
+ * (this → target). Single-component edges live on `edges[].addMap`/`removeMap`;
157
+ * multi-component pairs land here. Entries never need invalidation —
158
+ * archetypes live for the Store's lifetime.
159
+ */
160
+ private readonly batchTransitionMaps;
161
+ /**
162
+ * Per-set add-edge cache for `Store.addComponents` (#659), keyed by an
163
+ * exact pack of the added component ids. Lazily allocated: most archetypes
164
+ * never originate a plural add, so the Map stays `null` until the first one
165
+ * is resolved — the single-add `edges[]` path never touches it.
166
+ */
167
+ private compositeAddEdges;
168
+ readonly _flatColumns: ColumnBacking<AnyTypedArray>[];
169
+ /** Set by `fromColumnStore` to record which SAB archetype this Archetype
170
+ * draws its column views from. `null` for the default heap-backed path
171
+ * (no SAB linkage; `refreshViews` would be a no-op there and so
172
+ * isn't supported). */
173
+ private _storeArchetypeId;
174
+ readonly _colOffset: number[];
175
+ readonly _fieldCount: number[];
176
+ private readonly _fieldIndex;
177
+ private readonly _fieldNames;
178
+ readonly columnGroups: (ArchetypeColumnGroup | undefined)[];
179
+ readonly _columnIds: number[];
180
+ readonly _changedTick: number[];
181
+ private readonly _mutGroupCache;
182
+ private readonly _readGroupCache;
183
+ /** Host-installed grow hook. Set by `Store` on every SAB-backed
184
+ * archetype during construction; `null` on heap-backed archetypes (the
185
+ * default `GrowableTypedArray` grows in place). Insertion methods call
186
+ * `_invoke_grow(...)` below before any push that would overflow the
187
+ * current SAB row capacity. (#171 §6.1.9 Phase 3) */
188
+ growHandler: ArchetypeGrowHandler | null;
189
+ constructor(id: ArchetypeID, mask: BitSet, layouts?: ArchetypeColumnLayout[], initialCapacity?: number, columnFactory?: ColumnFactory);
190
+ /**
191
+ * Build an Archetype whose columns are TypedArray views into a single
192
+ * `ColumnStore`-managed `SharedArrayBuffer`. The store must contain an
193
+ * archetype entry whose id equals `storeArchetypeId` and whose columns
194
+ * cover every `(component_id, fieldIdx)` pair declared by `layouts`.
195
+ *
196
+ * The resulting archetype is fixed-capacity at the SAB row capacity —
197
+ * any operation that would push past it throws `StoreColumnOverflowError`.
198
+ * To grow capacity, call `growColumnStore(...)` between ticks and then
199
+ * `refreshViews(newStore)` on this archetype (#171 §6.1.4 / §8.1).
200
+ */
201
+ static fromColumnStore(id: ArchetypeID, mask: BitSet, layouts: ArchetypeColumnLayout[], columnStore: ColumnStore, storeArchetypeId: number): Archetype;
202
+ /** True iff this archetype was constructed via `fromColumnStore` and its
203
+ * `_flatColumns` are SAB-backed. Heap-backed archetypes return `false`
204
+ * and cannot be refreshed (their columns grow in place). */
205
+ get isBufferBacked(): boolean;
206
+ /**
207
+ * Repoint every column at the matching SAB view in `newColumnStore` after
208
+ * a host-side `growColumnStore` realloc. The archetype keeps its row
209
+ * count; each column's logical length is preserved. Caller is responsible
210
+ * for ensuring `newColumnStore` was built by `growColumnStore` over the
211
+ * SAB this archetype was originally drawn from — the matching
212
+ * `storeArchetypeId` was recorded in `fromColumnStore` and is reused here.
213
+ *
214
+ * Throws `ECSError` if this archetype is not SAB-backed, or if the new
215
+ * store lacks the recorded archetype id or any column the archetype
216
+ * expects.
217
+ */
218
+ refreshViews(newColumnStore: ColumnStore): void;
219
+ /** Enabled-row count — the default iteration bound (#577). See `enabled_count`.
220
+ * Equals `length` whenever no entity is disabled (the common case).
221
+ *
222
+ * During an `includeDisabled()` query's `forEach`, the module flag
223
+ * `_iterAllRows` is set so this returns `length` (enabled + disabled) — the
224
+ * user's `for i < arch.entityCount` loop then spans disabled rows
225
+ * transparently, with no change to the loop. Outside such iteration the flag is
226
+ * false and this is `enabled_count`. */
227
+ get entityCount(): number;
228
+ /** Total live rows incl. disabled (#577). */
229
+ get totalCount(): number;
230
+ /** Disabled-row count (#577). */
231
+ get disabledCount(): number;
232
+ /** Raw entity ID buffer (packed `EntityID`s). Valid data at indices
233
+ * 0..totalCount-1 (enabled rows first, then disabled). */
234
+ get entityIds(): ReadonlyEntityIdArray;
235
+ /**
236
+ * Swap the two rows `a` and `b` — entity ids and every column. Does NOT touch
237
+ * `entityRow`; the caller updates the entity→row map for whichever rows it
238
+ * cares about (it knows the two `entityIds` after the swap). The partition
239
+ * primitives (`disableRow`/`enableRow`/`removeRow`/`_placeTail`) build on
240
+ * this. Writes through each column's live backing buffer (`buf`), so it works
241
+ * for both heap- and SAB-backed columns. No-op when `a === b`. (#577) */
242
+ swapRows(a: number, b: number): void;
243
+ /**
244
+ * Place a freshly-appended ENABLED entity (currently at the tail row `tail`,
245
+ * already pushed, `length` already incremented) into the enabled region, and
246
+ * bump `enabled_count`. Returns its final row.
247
+ *
248
+ * Common case — no disabled rows (`enabled_count === tail`): the tail row IS
249
+ * the next enabled slot, so this is just `enabled_count++` and returns `tail`
250
+ * (byte-for-byte the pre-#577 behaviour, `entityRow` untouched). Rare case —
251
+ * disabled rows occupy `[enabled_count, tail)`: swap the appended row into the
252
+ * first disabled slot and push that disabled occupant to the tail, updating
253
+ * its `entityRow`. Requires `entityRow` in that case (a `__DEV__` guard fires
254
+ * if a caller appends into a disabled-bearing archetype without passing it). (#577) */
255
+ private _placeTail;
256
+ /**
257
+ * Bulk analog of `_placeTail` for `count` freshly-appended enabled rows at
258
+ * `[start, start+count)`. Common case (no disabled rows, `enabled_count ===
259
+ * start`): `enabled_count += count`, return `start`. The bulk callers
260
+ * (`spawnMany`, batch ops) fall back to a per-entity append loop when the
261
+ * target already has disabled rows, so the rare branch is a `__DEV__` guard
262
+ * rather than a block-rotation. (#577) */
263
+ private _placeTailBulk;
264
+ /**
265
+ * Disable the entity at `row` (precondition: enabled, `row < enabled_count`).
266
+ * Swaps it to the end of the enabled region and shrinks the region, so it
267
+ * lands in the disabled tail with its data intact — no archetype transition,
268
+ * O(1)+one row swap. Updates `entityRow` for both rows touched. (#577) */
269
+ disableRow(row: number, entityRow: Int32Array): void;
270
+ /**
271
+ * Enable the entity at `row` (precondition: disabled, `row >= enabled_count`).
272
+ * Swaps it to the front of the disabled region and grows the enabled region.
273
+ * Updates `entityRow` for both rows touched. (#577) */
274
+ enableRow(row: number, entityRow: Int32Array): void;
275
+ /**
276
+ * Partition-aware swap-remove that owns its `entityRow` updates (#577). The
277
+ * Store's destroy/move paths call this instead of `removeEntity`; it keeps the
278
+ * enabled prefix contiguous in every case:
279
+ * - disabled row (`row >= enabled_count`): swap-remove within the disabled
280
+ * tail (the last row is disabled) — `enabled_count` unchanged.
281
+ * - last enabled row: swap-remove with the global last; `enabled_count--`.
282
+ * - middle enabled row: move the last enabled row into the hole (so the
283
+ * enabled prefix stays packed), then swap-remove that vacated enabled slot
284
+ * with the global last; `enabled_count--`.
285
+ * Updates `entityRow` for every relocated entity (never for the removed one —
286
+ * the caller frees/repoints it). */
287
+ removeRow(row: number, entityRow: Int32Array): void;
288
+ /** @internal — cold partition-aware tail of `removeRow` (#577): the
289
+ * disabled-bearing archetype case. Split out so the no-disabled fast path
290
+ * above stays small enough to inline (#649); see the doc on `removeRow`. */
291
+ private _removeRowPartitioned;
292
+ get entityList(): Uint32Array;
293
+ hasComponent(id: ComponentID): boolean;
294
+ matches(required: BitSet): boolean;
295
+ /**
296
+ * Get a single field's column (read-only — use when not mutating). Valid
297
+ * data: indices 0..entityCount-1. The `ReadonlyColumn` return is an
298
+ * *advisory* compile-time barrier: it is the live mutable backing buffer,
299
+ * so the `readonly` index signature blocks writes at the type layer only
300
+ * (a §10c-policed cast can still write through). For writes use the
301
+ * mutable `getColumn` (tick-bumping) below.
302
+ */
303
+ getColumnRead<S extends ComponentSchema, K extends string & keyof S>(def: ComponentDef<S>, field: K): ReadonlyColumn;
304
+ /**
305
+ * Tuple fetch of several of one component's columns —
306
+ * `const [q, r] = arch.getColumnsRead(HexPos, "q", "r")` collapses the
307
+ * per-field `getColumnRead` preamble at the top of an iteration callback
308
+ * to one line. Same advisory-readonly views and `reads` access-check as
309
+ * `getColumnRead`. Allocates one small array per call — fine once per
310
+ * archetype per tick; in a per-row loop fetch columns individually.
311
+ */
312
+ getColumnsRead<S extends ComponentSchema, const K extends readonly (string & keyof S)[]>(def: ComponentDef<S>, ...fields: K): {
313
+ [I in keyof K]: ReadonlyColumn;
314
+ };
315
+ /**
316
+ * Get a single field's column **if this archetype has the component**, else
317
+ * `undefined` — the fetch-if-present accessor for optional query terms (#575,
318
+ * Bevy `Option<&T>` / flecs `?`). An optional query (`q.optional(T)`) spans
319
+ * archetypes both with and without `T`; the caller branches once per
320
+ * archetype span on the return:
321
+ *
322
+ * q.forEach((arch) => {
323
+ * const vx = arch.getOptionalColumnRead(Vel, "vx");
324
+ * for (let i = 0; i < arch.entityCount; i++) {
325
+ * px[i] += vx ? vx[i] : 0; // absent span ⇒ vx === undefined
326
+ * }
327
+ * });
328
+ *
329
+ * Unlike `getColumnRead`, a component the archetype lacks is the expected
330
+ * **absent** branch, not a thrown error. The `__DEV__` checks still run
331
+ * **first** (before the absent short-circuit), so the requirements don't
332
+ * depend on whether the current span happens to hold `T`. Two checks fire:
333
+ * (1) `accessCheck.checkRead` — an optional read needs `reads:[T]` coverage
334
+ * exactly as a required read does; (2) `accessCheck.checkOptionalFetch` —
335
+ * the iterating query must have declared `.optional(T)` (#592), the read-side
336
+ * analog that makes the query term the fetch's authorization rather than inert
337
+ * decoration. The return is the same advisory-readonly view `getColumnRead`
338
+ * hands back.
339
+ */
340
+ getOptionalColumnRead<S extends ComponentSchema, K extends string & keyof S>(def: ComponentDef<S>, field: K): ReadonlyColumn | undefined;
341
+ /** Get a single field's column (mutable — the default). Marks the component as changed at the given tick. */
342
+ getColumn<S extends ComponentSchema, K extends string & keyof S>(def: ComponentDef<S>, field: K, tick: number): TagToTypedArray[S[K]];
343
+ /** Mutable field-keyed column group; stamps the change tick once. */
344
+ columnGroupMut<S extends ComponentSchema>(def: ComponentDef<S>, tick: number): MutableColumnsForSchema<S>;
345
+ /** Read-only field-keyed column group (no tick bump). */
346
+ columnGroupRead<S extends ComponentSchema>(def: ComponentDef<S>): ColumnsForSchema<S>;
347
+ writeFields(row: number, componentId: ComponentID, values: Record<string, number>, tick: number): void;
348
+ /**
349
+ * Bulk variant of `writeFields` — fills `count` consecutive rows starting
350
+ * at `dstStart` with the same field values via per-field `TypedArray.fill`.
351
+ * For N rows of an F-field component, this is F native fill calls instead
352
+ * of N×F per-row JS writes. The change-tick is bumped once for the range,
353
+ * not once per row. Used by `Store.batchAddComponent` after a bulk move,
354
+ * where every freshly-added row shares the same field values.
355
+ */
356
+ bulkWriteFields(dstStart: number, count: number, componentId: ComponentID, values: Record<string, number>, tick: number): void;
357
+ /** Fast positional write: values[i] → field[i] in declaration order. No string lookup. */
358
+ writeFieldsPositional(row: number, componentId: ComponentID, values: ArrayLike<number>, tick: number): void;
359
+ readField(row: number, componentId: ComponentID, field: string): number;
360
+ /** Copy all shared component columns from source archetype at srcRow into dstRow. */
361
+ copySharedFrom(source: Archetype, srcRow: number, dstRow: number, tick: number): void;
362
+ /**
363
+ * Add an entity. Pushes zeroes into all columns and returns the assigned row.
364
+ * Store is responsible for tracking entityIndex → row.
365
+ */
366
+ addEntity(entityId: EntityID, entityRow?: Int32Array): number;
367
+ /**
368
+ * Remove entity at row via swap-and-pop. Swaps the last entity into the
369
+ * vacated row to keep data dense. Returns the entityIndex of the swapped
370
+ * entity (so Store can update its row), or NO_SWAP if no swap was needed.
371
+ */
372
+ removeEntity(row: number): number;
373
+ /** Tag-optimized add: skip column push entirely (no data to store). */
374
+ addEntityTag(entityId: EntityID, entityRow?: Int32Array): number;
375
+ /**
376
+ * Bulk add `count` entities, zero-initialising all columns. Returns the
377
+ * starting dstRow for the batch. Caller is responsible for tracking
378
+ * entityIndex → row for every entity in the batch.
379
+ *
380
+ * Collapses the N×C `push(0)` cost of N sequential `addEntity` calls
381
+ * into C `bulkAppendZeroes(count)` calls — the same pattern
382
+ * `bulkMoveAllFrom` (`:580`) uses for the move-with-data case (#330).
383
+ */
384
+ addEntities(entityIds: Uint32Array, count?: number): number;
385
+ /** Tag-optimized bulk add: skip the per-column zero-fill entirely. */
386
+ addEntitiesTag(entityIds: Uint32Array, count?: number): number;
387
+ /** Grow column capacity to fit `additional` more rows if the next append
388
+ * would overflow — the exact grow trigger the `addEntityWithValues` /
389
+ * `addEntitiesWithValues` appends run internally, lifted out so the spawn
390
+ * path can pre-reserve capacity BEFORE it commits an entity slot. A SAB-cap
391
+ * grow throws here (with the world untouched) instead of mid-append after the
392
+ * slot is already live — see `Store.spawn`/`spawnMany` (#775). No-op for a
393
+ * tag-only archetype (no SAB columns) or when no grow handler is installed. */
394
+ ensureRowCapacity(additional: number): void;
395
+ /** Append one entity, writing `flatValues[i]` straight into column `i`
396
+ * (in `_flatColumns` order) — no zero-fill-then-overwrite. Bumps every
397
+ * column's change tick once. Returns the assigned row. */
398
+ addEntityWithValues(entityId: EntityID, flatValues: number[], tick: number, entityRow?: Int32Array): number;
399
+ /** Bulk append `count` entities, filling column `i` with `flatValues[i]`
400
+ * in a single `TypedArray.fill` per column (no zero pass). Returns the
401
+ * starting row. */
402
+ addEntitiesWithValues(entityIds: Uint32Array, count: number, flatValues: number[], tick: number): number;
403
+ /** Tag-optimized remove via swap-and-pop: skip column swap/pop entirely. */
404
+ removeEntityTag(row: number): number;
405
+ /**
406
+ * Move an entity from src archetype into this archetype in a single pass.
407
+ * Combines addEntity + copySharedFrom + removeEntity(src).
408
+ * Uses a pre-computed transition map for branchless column copy.
409
+ * Writes dstRow to _moveResult[0], swapped entity index to _moveResult[1].
410
+ */
411
+ moveEntityFrom(src: Archetype, srcRow: number, entityId: EntityID, transitionMap: Int16Array, tick: number, entityRow: Int32Array): void;
412
+ /**
413
+ * Move an entity from src into this archetype (tag-only: no columns to copy).
414
+ * Writes dstRow to _moveResult[0]; _moveResult[1] is always NO_SWAP (the
415
+ * partition-aware src/dst updates are owned internally, #577).
416
+ */
417
+ moveEntityFromTag(src: Archetype, srcRow: number, entityId: EntityID, entityRow: Int32Array): void;
418
+ /**
419
+ * Bulk-move ALL entities from src into this archetype using TypedArray.set().
420
+ * Much faster than per-entity moveEntityFrom when the entire source is moving.
421
+ * After this call, src is empty. Returns the starting dstRow for the batch.
422
+ */
423
+ bulkMoveAllFrom(src: Archetype, transitionMap: Int16Array, tick: number): number;
424
+ /**
425
+ * Drop every row at once — length → 0, entity-id list and all columns
426
+ * cleared — without copying into a destination. Used when an archetype's
427
+ * entire population leaves in one move: `bulkMoveAllFrom` clears the
428
+ * source this way, and `Store.batchRemoveComponent` calls it directly when
429
+ * the destination is the rowless empty archetype (batch-removing the last
430
+ * component), where there is nothing to copy into.
431
+ */
432
+ clearRows(): void;
433
+ /**
434
+ * Re-derive the host-side row bookkeeping after a snapshot is mounted onto a
435
+ * live world (#789, `Store.restoreInto`). A snapshot reloads the column bytes
436
+ * (dense SAB) but NOT the host-side `length` / `enabledCount` / `_entityIds`
437
+ * back-reference — those are reconstructed here. `refreshViews` must have
438
+ * already repointed the columns at the restored SAB.
439
+ *
440
+ * The caller scans the restored entity-index region to learn which entity
441
+ * occupies each row and passes them in row order (`rowEntityIds[r]` is the
442
+ * packed `EntityID` at row `r`; rows `[0, length)` are dense, enabled rows
443
+ * first then disabled per the #577 partition). `enabledCount` is the restored
444
+ * partition boundary. This is the inverse of the per-row `addEntity` /
445
+ * `disableRow` bookkeeping the live run accumulated.
446
+ */
447
+ restoreHostRows(rowEntityIds: readonly number[], enabledCount: number): void;
448
+ getEdge(componentId: ComponentID): ArchetypeEdge | undefined;
449
+ setEdge(componentId: ComponentID, edge: ArchetypeEdge): void;
450
+ /**
451
+ * Get the transition map from this archetype to `target`, building and caching
452
+ * it on miss. Used by Store.addComponents / removeComponents — the per-edge
453
+ * cache only covers single-component steps.
454
+ */
455
+ getBatchTransitionMap(target: Archetype): Int16Array;
456
+ /** Look up a cached plural-add transition by its packed key (#659). Returns
457
+ * `undefined` until the first composite add out of this archetype plants the
458
+ * lazy Map — the common case for archetypes that only ever see single adds. */
459
+ getCompositeAddEdge(key: number): CompositeAddEdge | undefined;
460
+ /** Cache a resolved plural-add transition (target + src→target map) under its
461
+ * packed key (#659), allocating the backing Map on first use. */
462
+ cacheCompositeAddEdge(key: number, target: ArchetypeID, map: Int16Array): void;
463
+ }
464
+ /** Reusable result buffer for move_entity_from/move_entity_from_tag. [dstRow, swapped_index] */
465
+ export declare const _moveResult: [number, number];
466
+ export declare function _setIterAllRows(value: boolean): boolean;
467
+ /**
468
+ * Build a transition map from src archetype to dst archetype.
469
+ * For each column in dst, stores the index of the corresponding column in src,
470
+ * or -1 if the column is new (no source).
471
+ */
472
+ export declare function buildTransitionMap(src: Archetype, dst: Archetype): Int16Array;
473
+ export {};
474
+ //# sourceMappingURL=archetype.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archetype.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/archetype.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;KAmBK;AAEL,OAAO,EACN,KAAK,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGrF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAExD,eAAO,MAAM,aAAa,UAAW,MAAM,gBAKzC,CAAC;AAEH,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,WAAW,G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;IAwDP;;;;OAIG;IACI,iBAAiB,CACvB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,GACnB,IAAI;IAqBP;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAsDvF;;;;;;;OAOG;IACI,SAAS,IAAI,IAAI;IAQxB;;;;;;;;;;;;;OAaG;IACI,eAAe,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAsB5E,OAAO,CAAC,WAAW,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS;IAI5D,OAAO,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI;IAInE;;;;OAIG;IACI,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU;IAQ3D;;mFAE+E;IACxE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAIrE;qEACiE;IAC1D,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;CAGrF;AAED,gGAAgG;AAChG,eAAO,MAAM,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAgB,CAAC;AAY1D,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIvD;AAmCD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,GAAG,UAAU,CA6B7E"}
@@ -0,0 +1,43 @@
1
+ import { ECS } from './ecs';
2
+ import { OnDeleteTarget, RelationDef } from './relation';
3
+ /** Options for a built-in relation. `exclusive` / `multi` are fixed (always
4
+ * exclusive — required for the chain/tree traversal helpers), so only the
5
+ * target-deletion cleanup policy is tunable. */
6
+ export interface BuiltinRelationOptions {
7
+ /** What happens to a relation's sources when a target is destroyed.
8
+ * Defaults per relation (see each registrar). */
9
+ readonly onDeleteTarget?: OnDeleteTarget;
10
+ }
11
+ /**
12
+ * Register an **`IsA(instance → exemplar)`** relation — a thin instance-of link.
13
+ *
14
+ * - "all instances of exemplar E" is `world.sourcesOf(IsA, E)`.
15
+ * - the IsA chain (`instance → exemplar → …`) is walked with
16
+ * `world.ancestorsOf(instance, IsA)` / `rootOf` / `cascadeOf(exemplar, IsA)`.
17
+ * - **No component inheritance** — IsA records the link only; materialization of
18
+ * an instance from its exemplar stays a spawn-time copy (the template path,
19
+ * #462), deliberately decoupled (#477 / #478). An exemplar is a real entity,
20
+ * not a `Template` (a non-entity template can't be a relation target).
21
+ *
22
+ * Default `onDeleteTarget: "clear"` — destroying an exemplar drops its
23
+ * instances' IsA link but leaves the instances alive (the thin analog of
24
+ * flecs's `IsA`-remove, since there is no inherited data to strip). Pass
25
+ * `"delete"` for strong instance-of (exemplar death cascade-destroys instances).
26
+ */
27
+ export declare function registerIsA(world: ECS, opts?: BuiltinRelationOptions): RelationDef;
28
+ /**
29
+ * Register a **`ChildOf(child → parent)`** relation — a thin hierarchy link.
30
+ *
31
+ * - a parent's children are `world.sourcesOf(ChildOf, parent)`.
32
+ * - the hierarchy is walked with `world.ancestorsOf(child, ChildOf)` (up to the
33
+ * root), `rootOf`, and `cascadeOf(root, ChildOf)` (down, breadth-first,
34
+ * parents before children).
35
+ * - unlike flecs's `ChildOf`, this does **not** scope names/lookup — the engine
36
+ * has no name registry; it is purely the structural parent link.
37
+ *
38
+ * Default `onDeleteTarget: "delete"` — destroying a parent cascade-destroys
39
+ * its whole subtree (flecs's default). Pass `"clear"` to let children survive as
40
+ * roots, or `"orphan"` to leave a dangling `targetOf`.
41
+ */
42
+ export declare function registerChildOf(world: ECS, opts?: BuiltinRelationOptions): RelationDef;
43
+ //# sourceMappingURL=builtin_relations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtin_relations.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/builtin_relations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;KAsBK;AAEL,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D;;gDAEgD;AAChD,MAAM,WAAW,sBAAsB;IACtC;qDACiD;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,WAAW,CAKlF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,WAAW,CAKtF"}