UNPKG

@electric-sql/d2ts

Version:

D2TS is a TypeScript implementation of Differential Dataflow.

19 lines (18 loc) 790 B
import { PipedOperator } from '../types.js'; import { DifferenceStreamReader, DifferenceStreamWriter } from '../graph.js'; import { LinearUnaryOperator } from './base.js'; import { MultiSet } from '../multiset.js'; import { Antichain } from '../order.js'; /** * Operator that filters elements from the input stream */ export declare class FilterOperator<T> extends LinearUnaryOperator<T, T> { #private; constructor(id: number, inputA: DifferenceStreamReader<T>, output: DifferenceStreamWriter<T>, f: (data: T) => boolean, initialFrontier: Antichain); inner(collection: MultiSet<T>): MultiSet<T>; } /** * Filters elements from the input stream * @param f - The predicate to filter elements */ export declare function filter<T>(f: (data: T) => boolean): PipedOperator<T, T>;