♻️ (notification) typing

This commit is contained in:
2020-07-04 00:48:32 +02:00
parent ed2d5f7671
commit 10f872bb35

View File

@@ -1,28 +1,19 @@
declare const Notification: any
let showNotification:
| ((
title: string,
options?: NotificationOptions | undefined
) => Promise<void>)
| ((title: string, options?: NotificationOptions) => Promise<void>)
| null = null
export const setNotificationInstance = (
sn: (
title: string,
options?: NotificationOptions | undefined
) => Promise<void>
sn: (title: string, options?: NotificationOptions) => Promise<void>
) => {
showNotification = sn
}
export const notify = (
title: string,
options?: NotificationOptions | undefined
) => {
export const notify = (title: string, options?: NotificationOptions) => {
const showCustomNotification = (
title: string,
options?: NotificationOptions | undefined
options?: NotificationOptions
) => {
if (!showNotification) {
return