@dapplets/dapplet-overlay-bridge
Version:
The bridge between dapplet and overlay
18 lines (17 loc) • 526 B
TypeScript
export declare class GeneralBridge {
_subId: number;
_callbacks: {
[topic: string]: Function[];
};
constructor();
on(event: string, callback: Function): void;
off(event: string): void;
publish(topic: string, message: any): void;
subscribe(topic: string, handler: Function): void;
unsubscribe(topic: string): void;
}
export declare type Bridge<T> = GeneralBridge & T;
export interface IBridge {
new <T = {}>(): Bridge<T>;
}
export declare const Bridge: IBridge;