import { type Iterator } from './types.js'; /** * Component map for storing entity ids and related component data * @category Maps */ export declare class ComponentMap implements Iterable<[number, TComponentInstance]> { private indices; private entities; private instances; /** * Creates a new component map * @param entries - Optional initial data for the map */ constructor(entries?: readonly (readonly [number, TComponentInstance])[] | null); /** * Returns the number of entities in the map */ get size(): number; /** * Clears all component data from the map */ clear(): void; /** * Adds or updates component data for an entity * @param entityId - The entity id to set * @param component - The component data to set */ set(entityId: number, component: TComponentInstance): void; /** * Gets the component data for an entity * @param entityId - The entity id to get * @returns The component data, or undefined if not found */ get(entityId: number): TComponentInstance | undefined; /** * Removes component data for an entity * @param entityId - The entity id to remove * @returns True if the component was removed, otherwise false */ delete(entityId: number): boolean; /** * Checks if an entity has a component in this map * @param entityId - The entity id to check * @returns True if the entity has a component, otherwise false */ has(entityId: number): boolean; /** * Executes a callback for every map, providing the component data and its entity id * @param callback - The callback to execute */ forEach(callback: (value: TComponentInstance, key: number) => void): void; /** * Returns the first entry * @returns A tuple of [entityId, componentData], or undefined if empty */ firstEntry(): [entityId: number, value: TComponentInstance] | undefined; /** * Returns the first entity id * @returns The first entity id, or undefined if empty */ firstKey(): number | undefined; /** * Returns the first entity data * @returns The first component data, or undefined if empty */ firstValue(): TComponentInstance | undefined; /** * Returns an iterator of [entityId, componentData] pairs * @returns An {@link Iterator} instance */ [Symbol.iterator](): Iterator<[number, TComponentInstance]>; /** * Returns an iterator of all entity ids * @returns An {@link ArrayIterator} of entity ids */ keys(): ArrayIterator; /** * Returns an iterator of all component data * @returns An {@link ArrayIterator} of component data */ values(): ArrayIterator; /** * Returns an iterator of [entityId, componentData] pairs * @returns An {@link Iterator} instance */ entries(): Iterator<[number, TComponentInstance]>; /** * Called when using JSON.stringify * @returns An object representation for serialization */ toJSON(): { ComponentMap: number; iterable: [number, TComponentInstance][]; }; /** * Returns an array of objects for tabular display * @returns An array of objects formatted for {@link console.table} */ toTable(): any[]; /** * Prints entity data in a tabular format to the console * @param properties - Optional filter. Specifies which property columns to display in the tables. * @returns The {@link ComponentMap} instance for chaining */ printTable(properties?: string[]): this; } //# sourceMappingURL=component-map.d.ts.map