electron_bridge: Make the options argument of new_notification required.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-02 15:05:52 -07:00
parent 1e10a3c406
commit 4f58a2a357
4 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ const electron_bridge: ElectronBridge = {
new_notification: (
title: string,
options: NotificationOptions | undefined,
options: NotificationOptions,
dispatch: (type: string, eventInit: EventInit) => boolean,
): NotificationData => newNotification(title, options, dispatch),

View File

@@ -69,7 +69,7 @@ interface CompatElectronBridge extends ElectronBridge {
const NativeNotification = Notification;
class InjectedNotification extends EventTarget {
constructor(title: string, options?: NotificationOptions) {
constructor(title: string, options: NotificationOptions = {}) {
super();
Object.assign(
this,

View File

@@ -30,7 +30,7 @@ export interface NotificationData {
export function newNotification(
title: string,
options: NotificationOptions | undefined,
options: NotificationOptions,
dispatch: (type: string, eventInit: EventInit) => boolean,
): NotificationData {
const notification = new DefaultNotification(title, options);

2
typings.d.ts vendored
View File

@@ -32,7 +32,7 @@ interface ElectronBridge {
on_event: (eventName: string, listener: ListenerType) => void;
new_notification: (
title: string,
options: NotificationOptions | undefined,
options: NotificationOptions,
dispatch: (type: string, eventInit: EventInit) => boolean,
) => NotificationData;
get_idle_on_system: () => boolean;