♻️ (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 declare const Notification: any
let showNotification: let showNotification:
| (( | ((title: string, options?: NotificationOptions) => Promise<void>)
title: string,
options?: NotificationOptions | undefined
) => Promise<void>)
| null = null | null = null
export const setNotificationInstance = ( export const setNotificationInstance = (
sn: ( sn: (title: string, options?: NotificationOptions) => Promise<void>
title: string,
options?: NotificationOptions | undefined
) => Promise<void>
) => { ) => {
showNotification = sn showNotification = sn
} }
export const notify = ( export const notify = (title: string, options?: NotificationOptions) => {
title: string,
options?: NotificationOptions | undefined
) => {
const showCustomNotification = ( const showCustomNotification = (
title: string, title: string,
options?: NotificationOptions | undefined options?: NotificationOptions
) => { ) => {
if (!showNotification) { if (!showNotification) {
return return