@tanstack/db-ivm
Version:
Incremental View Maintenance for TanStack DB based on Differential Dataflow
26 lines (25 loc) • 988 B
TypeScript
import { DefaultMap } from './utils.js';
/**
* A map from a difference collection trace's keys -> (value, multiplicities) that changed.
* Used in operations like join and reduce where the operation needs to
* exploit the key-value structure of the data to run efficiently.
*/
export declare class HashIndex<K, V> {
#private;
constructor();
toString(indent?: boolean): string;
get(key: K): Array<[V, number]>;
getMultiplicity(key: K, value: V): number;
entries(): MapIterator<[K, DefaultMap<number, [V, number]>]>;
entriesIterator(): Generator<[K, [V, number]]>;
has(key: K): boolean;
delete(key: K): void;
get size(): number;
/**
* Adds a value to the index and does not return anything
* except if the addition caused the value to be removed
* and the key to be left with only a single value.
* In that case, we return the single remaining value.
*/
addValue(key: K, value: [V, number]): [V, number] | void;
}