diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-07-18 15:07:37 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-08-15 17:39:38 +0200 |
| commit | 71592249b2dd669b6f24f37bfb7b0f4e43b74998 (patch) | |
| tree | a6097dc7e5d94d06e99c65fdfe160e824395f50c /gui/flow-libs/notification.js.flow | |
| parent | e84e87f4ce5a8c242f756566cdc6fb59a45f7bea (diff) | |
| download | mullvadvpn-71592249b2dd669b6f24f37bfb7b0f4e43b74998.tar.xz mullvadvpn-71592249b2dd669b6f24f37bfb7b0f4e43b74998.zip | |
Add workspaces
Diffstat (limited to 'gui/flow-libs/notification.js.flow')
| -rw-r--r-- | gui/flow-libs/notification.js.flow | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gui/flow-libs/notification.js.flow b/gui/flow-libs/notification.js.flow new file mode 100644 index 0000000000..bf5dda3af2 --- /dev/null +++ b/gui/flow-libs/notification.js.flow @@ -0,0 +1,51 @@ +/* Notification */ +type NotificationPermission = 'default' | 'denied' | 'granted'; +type NotificationDirection = 'auto' | 'ltr' | 'rtl'; +type VibratePattern = number | Array<number>; +type NotificationAction = { action: string, title: string, icon?: string }; +type NotificationOptions = { + dir: NotificationDirection, + lang: string, + body: string, + tag: string, + image: string, + icon: string, + badge: string, + sound: string, + vibrate: VibratePattern, + timestamp: number, + renotify: boolean, + silent: boolean, + requireInteraction: boolean, + data: ?any, + actions: Array<NotificationAction>, +}; + +declare class Notification extends EventTarget { + constructor(title: string, options?: $Shape<NotificationOptions>): void; + static permission: NotificationPermission; + static requestPermission( + callback?: (perm: NotificationPermission) => mixed, + ): Promise<NotificationPermission>; + static maxActions: number; + onclick: (evt: Event) => any; + onerror: (evt: Event) => any; + title: string; + dir: NotificationDirection; + lang: string; + body: string; + tag: string; + image: string; + icon: string; + badge: string; + sound: string; + vibrate: Array<number>; + timestamp: number; + renotify: boolean; + silent: boolean; + requireInteraction: boolean; + data: any; + actions: Array<NotificationAction>; + + close(): void; +} |
