15 lines
711 B
TypeScript
15 lines
711 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();
|
|
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 {};
|