import type { EntityHandle as SchemaEntityHandle, EntityIndex as SchemaEntityIndex } from '@ecsia/schema'; /** A packed u32: [generation: generationBits][index: indexBits], generation in the HIGH bits. */ export type EntityHandle = SchemaEntityHandle; /** The low-bits index portion — the slot in the dense/sparse arrays. */ export type EntityIndex = SchemaEntityIndex; /** The generation (version) counter for a slot. */ export type EntityGeneration = number & { readonly __ecsiaEntityGeneration: unique symbol; }; export interface HandleLayout { readonly indexBits: number; readonly generationBits: number; /** Low-bits mask isolating the index. */ readonly indexMask: number; /** Unshifted generation mask (`(1 << generationBits) - 1`). */ readonly generationMask: number; /** `=== indexBits`. */ readonly generationShift: number; /** Largest valid index (`indexMask`). */ readonly maxIndex: number; /** Generation value just before wrap to 0 (`generationMask`). */ readonly maxGeneration: number; /** Number of addressable slots (`maxIndex + 1`). */ readonly capacity: number; } /** Sentinel for "no entity" in eid fields and APIs that may return absent. NOT a live handle. */ export declare const NO_ENTITY: EntityHandle; /** Alias of {@link NO_ENTITY} for call sites that prefer the "null handle" spelling. */ export declare const NULL_ENTITY: SchemaEntityHandle; /** * True when `handle` is the {@link NO_ENTITY} sentinel (an absent / null handle). Use this to * discriminate handles returned from APIs that may yield "no entity" without comparing against the * raw `0xffffffff` literal: `if (isNoEntity(h)) { ... }`. */ export declare function isNoEntity(handle: EntityHandle): boolean; /** * Build the immutable handle layout from a generation-bit split. `indexBits = 32 - * generationBits`. `1 << 32` is 1 in JS (shift is mod-32), so the all-ones index mask is * special-cased for `generationBits === 0`. */ export declare function makeHandleLayout(generationBits: number): HandleLayout; export declare function makeHandle(index: number, generation: number, layout: HandleLayout): EntityHandle; export declare function handleIndex(handle: EntityHandle, layout: HandleLayout): EntityIndex; export declare function handleGeneration(handle: EntityHandle, layout: HandleLayout): EntityGeneration; //# sourceMappingURL=codec.d.ts.map