18 lines
794 B
TypeScript
18 lines
794 B
TypeScript
import { EntityDict, OpRecord, SubDataDef } from 'oak-domain/lib/types';
|
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
|
import { Feature } from '../types/Feature';
|
|
type SubscribeEvent = 'connect' | 'disconnect';
|
|
export declare class SubScriber<ED extends EntityDict & BaseEntityDict> extends Feature {
|
|
private eventCallbackMap;
|
|
constructor(getSubscribePointFn: () => Promise<{
|
|
url: string;
|
|
path: string;
|
|
}>);
|
|
on(event: SubscribeEvent, callback: () => void): void;
|
|
off(event: SubscribeEvent, callback: () => void): void;
|
|
sub(data: SubDataDef<ED, keyof ED>[], callback: (records: OpRecord<ED>[], ids: string[]) => void): Promise<void>;
|
|
unsub(ids: string[]): Promise<void>;
|
|
getSubscriberId(): undefined;
|
|
}
|
|
export {};
|