import type { ComponentId, ComponentDef, Schema } from '@ecsia/schema'; import type { ArchetypeId } from '@ecsia/schema'; import type { Buffers } from '../memory/index.js'; import type { AccessorWorld, ColumnSet } from '../component/index.js'; declare const COLD_ARCHETYPE_ID = 4294967040; export interface ColdStore { /** componentId → a packed SoA block (one ColumnSet per component TYPE, not per archetype). */ readonly blocks: Map; /** (entityIndex, componentId) → row in that component's block. key = entityIndex * SCALE + componentId. */ readonly rowOf: Map; /** entityIndex → its cold archetype id (so resolveLocation still yields an ArchetypeId). */ readonly archOf: Map; /** entityIndex → the full EntityHandle occupying the cold slot (for promotion's hot row list). */ readonly handleOf: Map; /** Next free row per component block. */ readonly nextRow: Map; /** Reclaimed rows per component block, reused before advancing nextRow (prevents leak). */ readonly freeRows: Map; } export declare function makeColdStore(): ColdStore; export interface ColdDeps { readonly buffers: Buffers; readonly accessorWorld: AccessorWorld; readonly initialCapacity: number; defOf(c: ComponentId): ComponentDef | undefined; } declare function coldKey(entityIndex: number, componentId: number): number; export declare function blockFor(cold: ColdStore, c: ComponentId, deps: ColdDeps): ColumnSet | null; /** Reserve a cold row for `componentId` under `entityIndex`, growing the block as needed. */ export declare function coldAllocRow(cold: ColdStore, entityIndex: number, c: ComponentId, deps: ColdDeps): number; /** The cold block row for (entityIndex, componentId), or -1 if absent. */ export declare function coldRowOf(cold: ColdStore, entityIndex: number, c: ComponentId): number; /** * Reclaim the cold rows this entity holds for the components in `comps`, returning each to its * block's free-list. Stale (index,componentId) mappings would otherwise leak monotonically and * survive generational index reuse. When `dropEntity` (the entity is leaving the cold store * entirely — despawn or promotion to a hot archetype) also drop its archOf/handleOf entries. */ export declare function coldReclaim(cold: ColdStore, entityIndex: number, comps: Iterable, dropEntity?: boolean): void; export { COLD_ARCHETYPE_ID, coldKey }; //# sourceMappingURL=cold-store.d.ts.map