Changeset View
Changeset View
Standalone View
Standalone View
desktop/flow-typed/npm/electron_v22.0.0.js
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | declare module 'electron' { | ||||
declare export class Menu { | declare export class Menu { | ||||
constructor(): void; | constructor(): void; | ||||
static setApplicationMenu(menu: Menu | null): void; | static setApplicationMenu(menu: Menu | null): void; | ||||
static buildFromTemplate( | static buildFromTemplate( | ||||
template: $ReadOnlyArray<MenuItemConstructorOptions>, | template: $ReadOnlyArray<MenuItemConstructorOptions>, | ||||
): Menu; | ): Menu; | ||||
} | } | ||||
declare export var pushNotifications: PushNotifications; | |||||
declare class PushNotifications { | |||||
registerForAPNSNotifications(): Promise<string>; | |||||
unregisterForAPNSNotifications(): void; | |||||
on<T: $Keys<PushNotificationsEvents>>( | |||||
event: T, | |||||
listener: $ElementType<PushNotificationsEvents, T>, | |||||
): void; | |||||
removeListener<T: $Keys<PushNotificationsEvents>>( | |||||
event: T, | |||||
listener: $ElementType<PushNotificationsEvents, T>, | |||||
): void; | |||||
ashoat: Why aren't these read-only? | |||||
} | |||||
declare type PushNotificationsEvents = { | |||||
'received-apns-notification': ( | |||||
event: Event, | |||||
userInfo: { +[string]: mixed }, | |||||
) => void, | |||||
}; | |||||
declare export class Notification { | |||||
constructor(options?: { | |||||
+title?: string, | |||||
+subtitle?: string, | |||||
+body?: string, | |||||
+silent?: boolean, | |||||
+hasReply?: boolean, | |||||
+timeoutType?: 'default' | 'never', | |||||
+replyPlaceholder?: string, | |||||
+sound?: string, | |||||
+urgency?: 'normal' | 'critical' | 'low', | |||||
+actions?: NotificationAction[], | |||||
+closeButtonText?: string, | |||||
+toastXml?: string, | |||||
}): void; | |||||
static isSupported(): boolean; | |||||
show(): void; | |||||
close(): void; | |||||
ashoatUnsubmitted Not Done Inline ActionsWhy aren't these read-only? ashoat: Why aren't these read-only? | |||||
+title: string; | |||||
+subtitle: string; | |||||
+body: string; | |||||
+replyPlaceholder: string; | |||||
+sound: string; | |||||
+closeButtonText: string; | |||||
+silent: boolean; | |||||
+hasReply: boolean; | |||||
+urgency: 'normal' | 'critical' | 'low'; | |||||
+timeoutType: 'default' | 'never'; | |||||
+toastXml: string; | |||||
on<T: $Keys<NotificationEvents>>( | |||||
event: T, | |||||
listener: $ElementType<NotificationEvents, T>, | |||||
): void; | |||||
removeListener<T: $Keys<NotificationEvents>>( | |||||
event: T, | |||||
listener: $ElementType<NotificationEvents, T>, | |||||
): void; | |||||
ashoatUnsubmitted Not Done Inline ActionsWhy aren't these read-only? ashoat: Why aren't these read-only? | |||||
} | |||||
declare type NotificationEvents = { | |||||
show: (event: Event) => void, | |||||
click: (event: Event) => void, | |||||
close: (event: Event) => void, | |||||
reply: (event: Event, reply: string) => void, | |||||
action: (event: Event, index: number) => void, | |||||
failed: (event: Event, error: string) => void, | |||||
ashoatUnsubmitted Not Done Inline ActionsShould any of these be read-only? ashoat: Should any of these be read-only? | |||||
}; | |||||
declare export var shell: Shell; | declare export var shell: Shell; | ||||
declare type Shell = { | declare type Shell = { | ||||
openExternal( | openExternal( | ||||
url: string, | url: string, | ||||
options?: { +activate?: boolean, +workingDirectory?: string }, | options?: { +activate?: boolean, +workingDirectory?: string }, | ||||
): Promise<void>, | ): Promise<void>, | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | declare module 'electron/main' { | ||||
declare export { | declare export { | ||||
app, | app, | ||||
BrowserWindow, | BrowserWindow, | ||||
shell, | shell, | ||||
Menu, | Menu, | ||||
ipcMain, | ipcMain, | ||||
systemPreferences, | systemPreferences, | ||||
autoUpdater, | autoUpdater, | ||||
pushNotifications, | |||||
Notification, | |||||
} from 'electron'; | } from 'electron'; | ||||
} | } | ||||
declare module 'electron/renderer' { | declare module 'electron/renderer' { | ||||
declare export { | declare export { | ||||
IpcRendererEvent, | IpcRendererEvent, | ||||
contextBridge, | contextBridge, | ||||
ipcRenderer, | ipcRenderer, | ||||
} from 'electron'; | } from 'electron'; | ||||
} | } |
Why aren't these read-only?