UNPKG

@electric-sql/d2mini

Version:

D2Mini is a minimal implementation of Differential Dataflow for performing in-memory incremental view maintenance.

22 lines (21 loc) 756 B
import { MultiSet } from './multiset.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 Index<K, V> { #private; constructor(); toString(indent?: boolean): string; get(key: K): [V, number][]; entries(): MapIterator<[K, [V, number][]]>; keys(): MapIterator<K>; has(key: K): boolean; get size(): number; addValue(key: K, value: [V, number]): void; append(other: Index<K, V>): void; compact(keys?: K[]): void; private consolidateValues; join<V2>(other: Index<K, V2>): MultiSet<[K, [V, V2]]>; }