@electric-sql/d2mini
Version:
D2Mini is a minimal implementation of Differential Dataflow for performing in-memory incremental view maintenance.
49 lines (48 loc) • 2.37 kB
TypeScript
import { IStreamBuilder, PipedOperator, KeyValue } from '../types.js';
import { DifferenceStreamReader, DifferenceStreamWriter, BinaryOperator } from '../graph.js';
/**
* Type of join to perform
*/
export type JoinType = 'inner' | 'left' | 'right' | 'full' | 'anti';
/**
* Operator that joins two input streams
*/
export declare class JoinOperator<K, V1, V2> extends BinaryOperator<[
K,
V1
] | [K, V2] | [K, [V1, V2]]> {
#private;
constructor(id: number, inputA: DifferenceStreamReader<[K, V1]>, inputB: DifferenceStreamReader<[K, V2]>, output: DifferenceStreamWriter<[K, [V1, V2]]>);
run(): void;
}
/**
* Joins two input streams
* @param other - The other stream to join with
* @param type - The type of join to perform
*/
export declare function join<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>, type?: JoinType): PipedOperator<T, KeyValue<K, [V1 | null, V2 | null]>>;
/**
* Joins two input streams
* @param other - The other stream to join with
*/
export declare function innerJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>): PipedOperator<T, KeyValue<K, [V1, V2]>>;
/**
* Joins two input streams
* @param other - The other stream to join with
*/
export declare function antiJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>): PipedOperator<T, KeyValue<K, [V1, null]>>;
/**
* Joins two input streams
* @param other - The other stream to join with
*/
export declare function leftJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>): PipedOperator<T, KeyValue<K, [V1, V2 | null]>>;
/**
* Joins two input streams
* @param other - The other stream to join with
*/
export declare function rightJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>): PipedOperator<T, KeyValue<K, [V1 | null, V2]>>;
/**
* Joins two input streams
* @param other - The other stream to join with
*/
export declare function fullJoin<K, V1 extends T extends KeyValue<infer _KT, infer VT> ? VT : never, V2, T>(other: IStreamBuilder<KeyValue<K, V2>>): PipedOperator<T, KeyValue<K, [V1 | null, V2 | null]>>;