@electric-sql/d2mini
Version:
D2Mini is a minimal implementation of Differential Dataflow for performing in-memory incremental view maintenance.
21 lines (20 loc) • 742 B
TypeScript
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][];
getMultiplicity(key: K, value: V): number;
entries(): MapIterator<[K, Map<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;
join<V2>(other: Index<K, V2>): MultiSet<[K, [V, V2]]>;
}