UNPKG

node-jet

Version:

Jet Realtime Message Bus for the Web. Daemon and Peer implementation.

20 lines (19 loc) 888 B
import { EventEmitter } from '../../1_socket/index.js'; import type { FetchParams } from '../messages.js'; import type { ValueType, OperatorType as Operator, ValueRule, pathFunction, PublishMessage } from '../types.js'; export declare class Fetcher extends EventEmitter { message: FetchParams; valueRules: Record<string, ValueRule>; constructor(); addListener: <T extends ValueType>(eventName: "data", listener: (update: PublishMessage<T>) => void) => this; path: pathFunction; value: (operator: Operator, value: string | boolean | number, field?: string) => this; matches: (path: string, value: ValueType | undefined) => boolean; differential: () => this; ascending: () => this; descending: () => this; sortByValue: (key?: string) => this; sortByPath: () => this; range: (_from: number, _to: number) => this; } export default Fetcher;