feat(notification): update TS signature for dispatched close event

This commit is contained in:
Eric Liu 2021-01-22 12:20:19 -08:00
commit 7706b28200
8 changed files with 42 additions and 20 deletions

View file

@ -57,10 +57,10 @@ export default class InlineNotification {
actions: {};
};
$on(eventname: "close", cb: (event: CustomEvent<{ timeout: boolean }>) => void): () => void;
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: "mouseover", cb: (event: WindowEventMap["mouseover"]) => void): () => void;
$on(eventname: "mouseenter", cb: (event: WindowEventMap["mouseenter"]) => void): () => void;
$on(eventname: "mouseleave", cb: (event: WindowEventMap["mouseleave"]) => void): () => void;
$on(eventname: "close", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}

View file

@ -62,10 +62,10 @@ export default class ToastNotification {
default: {};
};
$on(eventname: "close", cb: (event: CustomEvent<{ timeout: boolean }>) => void): () => void;
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
$on(eventname: "mouseover", cb: (event: WindowEventMap["mouseover"]) => void): () => void;
$on(eventname: "mouseenter", cb: (event: WindowEventMap["mouseenter"]) => void): () => void;
$on(eventname: "mouseleave", cb: (event: WindowEventMap["mouseleave"]) => void): () => void;
$on(eventname: "close", cb: (event: CustomEvent<any>) => void): () => void;
$on(eventname: string, cb: (event: Event) => void): () => void;
}