UNPKG

node-jet

Version:

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

22 lines (21 loc) 724 B
import { EventEmitter } from '../../1_socket/index.js'; import type JsonRPC from '../../2_jsonrpc/index.js'; import type { ValueType } from '../types.js'; export interface access { read?: string; write: string; } /** * A Route is a path and corresponds to a state. * The daemon keeps a local cache of all registered routes and all momentary values. * The corresponding owner of a route is also remembered */ export declare class Route extends EventEmitter { owner: JsonRPC; value?: ValueType; path: string; access?: access; constructor(owner: JsonRPC, path: string, value?: ValueType | undefined, access?: access); updateValue: (newValue: ValueType) => void; remove: () => boolean; }