@benshi.ai/js-sdk
Version:
Benshi SDK
25 lines (21 loc) • 691 B
text/typescript
export declare interface NotificationDispatcher {
on<U extends keyof BsNotificationEvents>(
event: U, listener: BsNotificationEvents[U]
): this;
emit<U extends keyof BsNotificationEvents>(
event: U, ...args: Parameters<BsNotificationEvents[U]>
): boolean;
}
export enum NotificationAction {
Block = 'block',
Discard = 'discard',
Open = 'open'
}
export interface BsNotificationEvents {
[NotificationAction.Block]: (id: number) => void;
[NotificationAction.Discard]: (id: number) => void;
[NotificationAction.Open]: (id: number) => void;
}
export interface NotificationDispatcher {
show(title: string, body: string, id: number)
}