node-jet
Version:
Jet Realtime Message Bus for the Web. Daemon and Peer implementation.
33 lines (32 loc) • 1.52 kB
TypeScript
import type { Fetcher } from '../jet.js';
export declare const events: readonly ["authenticate", "addUser", "configure", "info", "fetch", "unfetch", "remove", "change", "add", "data", "call", "get", "set"];
export type EventType = (typeof events)[number];
export declare const pathRules: readonly ["equals", "equalsNot", "endsWith", "startsWith", "contains", "containsNot", "containsAllOf", "containsOneOf", "startsNotWith", "endsNotWith", "equalsOneOf", "equalsNotOneOf"];
export type PathRule = (typeof pathRules)[number];
export type sortable = 'boolean' | 'number' | 'string';
export interface pathFunction {
(key: 'equals' | 'equalsNot' | 'endsWith' | 'startsWith' | 'startsNotWith' | 'endsNotWith', value: string): Fetcher;
(key: 'contains' | 'containsNot' | 'containsAllOf' | 'containsOneOf' | 'equalsOneOf' | 'equalsNotOneOf', value: string[]): Fetcher;
}
export interface ValueRule {
operator: OperatorType;
value: string | number | boolean;
}
export interface PublishMessage<T extends ValueType> {
path: string;
event: string;
value: T;
}
export declare const operators: readonly ["greaterThan", "lessThan", "equals", "equalsNot", "isType"];
export type OperatorType = (typeof operators)[number];
export interface AccessType {
id?: string;
}
export type ValueType = string | number | object | boolean | null;
export interface ErrorType {
message: string;
stack: string;
lineNumber: number;
fileName: string;
}
export declare const fetchSimpleId = "fetch_all";