import { IIndexSetCursor } from "../core/i_index_set_cursor.js"; /** * A set of indices each associated with a number identifier. */ export declare class MultiIndexSet { private readonly prefixSumTable_; private readonly elements_; /** * Construct this with a prefix sum table and matching elements table. * * @param prefixSumTable_ A prefix sum array where each item is its summed index, * with an extra element at the end with the entire count. * @param elements_ The elements in the index, matching the prefix sum indices * 2, * where there's 2 elements in the array for each item, * packed (first has the bottom 5 bits masked out, and is the top bits, the second * is a bit field representing the elements for the top bit range, in a * unioned-one-hot representation). */ constructor(prefixSumTable_: Uint32Array, elements_: Uint32Array); /** * All the types with a non-zero size in the index. * * @yields {IterableIterator} */ types(): IterableIterator; /** * Does the set have a particular index for a particular type. * * @param indexType The index type to check for. * @param localID The dense index in the set to check. * @return {boolean} True if it has the type. */ has(indexType: IndexType, localID: number): boolean; /** * Count of items for a set of types without materializing entities — * popcounts the packed one-hot blocks per type (the prefix sums index * 32-element blocks, not items), so it's O(blocks), thousands of times * cheaper than iterating a cursor. Per-type ranges are disjoint, but an * element multi-mapped under several of the queried types counts once per * mapping (matching what a cursor union would visit), so treat multi-type * counts as an upper bound (fine for progress totals, its motivating use). * * @param indexTypes The list of types to count. * @return {number} The summed count for the given types. */ count(...indexTypes: IndexType[]): number; /** * Get a cursor that lets you iterate over the union of the sets of multiple indices. * * @param indexTypes The list of types to build a cursor out of. * @return {IIndexSetCursor} The cursor for the list of types. */ cursor(...indexTypes: IndexType[]): IIndexSetCursor; } //# sourceMappingURL=multi_index_set.d.ts.map