Skip to content

ComponentStoreLike

Defined in: src/component-store.ts:83

The storage-agnostic access surface shared by the object-backed ComponentStore and the columnar ColumnStore. world, Query, the spatial index, and save all consume this interface, so a component’s storage layout (object vs Structure-of-Arrays) is invisible to them. Static ComponentStore.fromSerialized and the columnar-only fast path (column / slotOf) are deliberately excluded — callers that need those reach for the concrete type.

T

addedTick: (id) => number

Defined in: src/component-store.ts:93

Clock tick at which the entity gained this component, or 0 when absent.

EntityId

number


changedTick: (id) => number

Defined in: src/component-store.ts:95

Clock tick of the entity’s last recorded change (insert included), or 0 when absent.

EntityId

number


clear: () => void

Defined in: src/component-store.ts:96

void


readonly clock: ChangeClock

Defined in: src/component-store.ts:85

The clock this store stamps added / changed ticks from; shared by every store in a world.


delete: (id) => boolean

Defined in: src/component-store.ts:97

EntityId

boolean


entries: () => IterableIterator<[EntityId, T]>

Defined in: src/component-store.ts:98

IterableIterator<[EntityId, T]>


get: (id) => T | undefined

Defined in: src/component-store.ts:100

Read a value. Not recorded as a change — mutate through getMut for that.

EntityId

T | undefined


getMut: (id) => T | undefined

Defined in: src/component-store.ts:102

Read a value for in-place mutation, recording the entity as changed.

EntityId

T | undefined


has: (id) => boolean

Defined in: src/component-store.ts:103

EntityId

boolean


keys: () => IterableIterator<EntityId>

Defined in: src/component-store.ts:104

IterableIterator<EntityId>


markChanged: (id) => void

Defined in: src/component-store.ts:106

Record a present entity as changed after a write the store cannot see.

EntityId

void


set: (id, value) => this

Defined in: src/component-store.ts:107

EntityId

T

this


readonly size: number

Defined in: src/component-store.ts:86


subscribe: {(event, fn): () => void; (event, fn): () => void; (event, fn): () => void; }

Defined in: src/component-store.ts:87

(event, fn): () => void

"set"

StoreSetHandler<T>

() => void

(event, fn): () => void

"delete"

StoreDeleteHandler<T>

() => void

(event, fn): () => void

"validate"

StoreValidateHandler

() => void


toSerialized: (def) => unknown

Defined in: src/component-store.ts:108

ComponentDef<T>

unknown


validate: (id) => void

Defined in: src/component-store.ts:109

EntityId

void

[iterator](): Iterator<[EntityId, T], any, any>

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:49

Iterator<[EntityId, T], any, any>

Iterable.[iterator]