export type EntityKey = string | number; export interface RegistryState { ids: EntityKey[]; records: Record; indexes: Record>; } export interface RegistryOptions { readonly key: (entity: Entity) => EntityKey; readonly sort?: (left: Entity, right: Entity) => number; readonly indexes?: Readonly string | number | readonly (string | number)[]>>; readonly validate?: (entity: Entity) => void; } export interface EntityRegistry { empty(): RegistryState; add(state: RegistryState, entity: Entity): boolean; addMany(state: RegistryState, entities: readonly Entity[]): number; put(state: RegistryState, entity: Entity): void; putMany(state: RegistryState, entities: readonly Entity[]): void; update(state: RegistryState, key: EntityKey, changes: Partial): boolean; remove(state: RegistryState, key: EntityKey): boolean; removeMany(state: RegistryState, keys: readonly EntityKey[]): number; clear(state: RegistryState): void; one(state: Readonly>, key: EntityKey): Entity | undefined; all(state: Readonly>): readonly Entity[]; count(state: Readonly>): number; byIndex(state: Readonly>, index: string, value: string | number): readonly Entity[]; audit(state: Readonly>): readonly string[]; } export declare function forgeRegistry(options: RegistryOptions): EntityRegistry; //# sourceMappingURL=entities.d.ts.map