@todesktop/shared 7.189.25 → 7.191.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.legacy-sync.json +6 -0
- package/.prettierignore +0 -2
- package/CHANGELOG.md +13 -0
- package/README.md +42 -15
- package/eslint.config.mjs +8 -55
- package/lib/base.d.ts +81 -75
- package/lib/base.js +9 -12
- package/lib/desktopify.d.ts +74 -74
- package/lib/desktopify.js +28 -35
- package/lib/desktopify2.d.ts +224 -220
- package/lib/desktopify2.js +2 -5
- package/lib/getSiteInfo.d.ts +6 -6
- package/lib/getSiteInfo.js +1 -2
- package/lib/hsm.d.ts +1 -1
- package/lib/hsm.js +5 -12
- package/lib/index.d.ts +12 -13
- package/lib/index.js +13 -31
- package/lib/invitePermissionLabels.d.ts +4 -2
- package/lib/invitePermissionLabels.js +14 -11
- package/lib/personalAccessTokens.d.ts +12 -12
- package/lib/personalAccessTokens.js +1 -2
- package/lib/plans.d.ts +27 -27
- package/lib/plans.js +181 -185
- package/lib/plugin.d.ts +23 -14
- package/lib/plugin.js +1 -2
- package/lib/toDesktop.d.ts +66 -66
- package/lib/toDesktop.js +1 -2
- package/lib/translation.d.ts +1 -1
- package/lib/translation.js +1 -2
- package/lib/validations.d.ts +66 -66
- package/lib/validations.js +54 -56
- package/package.json +11 -17
- package/src/base.ts +89 -82
- package/src/desktopify.ts +82 -80
- package/src/desktopify2.ts +241 -237
- package/src/getSiteInfo.ts +6 -6
- package/src/hsm.ts +7 -7
- package/src/index.ts +13 -14
- package/src/invitePermissionLabels.ts +20 -6
- package/src/personalAccessTokens.ts +12 -12
- package/src/plans.ts +191 -191
- package/src/plugin.ts +24 -14
- package/src/toDesktop.ts +70 -70
- package/src/translation.ts +2 -2
- package/src/validations.ts +51 -49
- package/tsconfig.json +6 -3
- package/.prettierrc +0 -5
package/src/desktopify2.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ISwitchableValue } from './toDesktop';
|
|
2
1
|
import {
|
|
3
|
-
MenuItemConstructorOptions,
|
|
4
2
|
BrowserWindowConstructorOptions,
|
|
5
|
-
|
|
6
|
-
NotificationConstructorOptions,
|
|
3
|
+
MenuItemConstructorOptions,
|
|
7
4
|
MessageBoxOptions,
|
|
5
|
+
NotificationConstructorOptions,
|
|
6
|
+
WebPreferences,
|
|
8
7
|
} from '@todesktop/client-electron-types';
|
|
9
8
|
import { BaseApp } from './base';
|
|
10
|
-
import { DesktopAppPlugin } from './plugin';
|
|
9
|
+
import { CustomPlugin, DesktopAppPlugin } from './plugin';
|
|
10
|
+
import { ISwitchableValue } from './toDesktop';
|
|
11
11
|
import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
|
|
12
12
|
|
|
13
13
|
interface BaseAssetDetails {
|
|
14
|
-
/**
|
|
15
|
-
* Remote URL where the asset can be downloaded
|
|
16
|
-
*/
|
|
17
|
-
url: string;
|
|
18
14
|
/**
|
|
19
15
|
* Local path where the asset is/should be stored. This path is relative to the app directory
|
|
20
16
|
*/
|
|
21
17
|
relativeLocalPath: string;
|
|
18
|
+
/**
|
|
19
|
+
* Remote URL where the asset can be downloaded
|
|
20
|
+
*/
|
|
21
|
+
url: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface AppIconAssetDetails extends BaseAssetDetails {
|
|
@@ -40,26 +40,26 @@ export interface FileAssetDetails extends BaseAssetDetails {
|
|
|
40
40
|
|
|
41
41
|
export type AssetDetails =
|
|
42
42
|
| AppIconAssetDetails
|
|
43
|
+
| FileAssetDetails
|
|
43
44
|
| MenuIconAssetDetails
|
|
44
|
-
| TrayMenubarIconAssetDetails
|
|
45
|
-
| FileAssetDetails;
|
|
45
|
+
| TrayMenubarIconAssetDetails;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Custom ToDesktop Roles for Application & Tray Menus
|
|
49
49
|
*/
|
|
50
50
|
type todesktopRoles =
|
|
51
|
-
| 'todesktop:launch-at-startup'
|
|
52
51
|
| 'todesktop:check-for-updates'
|
|
53
|
-
| 'todesktop:quit'
|
|
54
|
-
| 'todesktop:quit-completely'
|
|
55
|
-
| 'todesktop:new-window'
|
|
56
|
-
| 'todesktop:new-tab'
|
|
57
52
|
| 'todesktop:check-for-updates'
|
|
58
|
-
| 'todesktop:
|
|
53
|
+
| 'todesktop:hide-window'
|
|
59
54
|
| 'todesktop:history-back'
|
|
60
55
|
| 'todesktop:history-forward'
|
|
56
|
+
| 'todesktop:history-home'
|
|
57
|
+
| 'todesktop:launch-at-startup'
|
|
58
|
+
| 'todesktop:new-tab'
|
|
59
|
+
| 'todesktop:new-window'
|
|
60
|
+
| 'todesktop:quit-completely'
|
|
61
|
+
| 'todesktop:quit'
|
|
61
62
|
| 'todesktop:show-window'
|
|
62
|
-
| 'todesktop:hide-window'
|
|
63
63
|
| 'todesktop:toggle-window'
|
|
64
64
|
| 'todesktop:toggle-window0'
|
|
65
65
|
| 'todesktop:toggle-window1'
|
|
@@ -69,19 +69,19 @@ type todesktopRoles =
|
|
|
69
69
|
|
|
70
70
|
export interface DesktopifyMenuItemConstructorOptions
|
|
71
71
|
extends Omit<MenuItemConstructorOptions, 'role' | 'submenu'> {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
role?: MenuItemConstructorOptions['role'] | todesktopRoles;
|
|
75
|
-
useSystemLabel?: boolean;
|
|
76
|
-
event?: string;
|
|
77
|
-
targetWindowId?: string;
|
|
72
|
+
// 'none' is kept for legacy reasons
|
|
73
|
+
acceleratorBehaviour?: 'custom' | 'default' | 'explicit-none' | 'none';
|
|
78
74
|
actionType?: 'jsEvent' | 'role';
|
|
79
|
-
iconUrl?: string;
|
|
80
75
|
bundledIcon?: string;
|
|
76
|
+
event?: string;
|
|
81
77
|
iconAssetDetails?: MenuIconAssetDetails;
|
|
78
|
+
iconUrl?: string;
|
|
79
|
+
platforms?: NodeJS.Platform[];
|
|
80
|
+
role?: MenuItemConstructorOptions['role'] | todesktopRoles;
|
|
81
|
+
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
82
|
+
targetWindowId?: string;
|
|
83
|
+
useSystemLabel?: boolean;
|
|
82
84
|
useTemplateImage?: boolean;
|
|
83
|
-
// 'none' is kept for legacy reasons
|
|
84
|
-
acceleratorBehaviour?: 'none' | 'explicit-none' | 'default' | 'custom';
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
/**
|
|
@@ -100,8 +100,8 @@ export type DesktopifyAppTrayToggleWindowAction = {
|
|
|
100
100
|
* @param menu - The menu to show when action triggered
|
|
101
101
|
*/
|
|
102
102
|
export type DesktopifyAppTrayToggleMenuAction = {
|
|
103
|
-
role: 'toggleMenu';
|
|
104
103
|
menu: DesktopifyMenuItemConstructorOptions[];
|
|
104
|
+
role: 'toggleMenu';
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
/**
|
|
@@ -110,8 +110,8 @@ export type DesktopifyAppTrayToggleMenuAction = {
|
|
|
110
110
|
* @param event - The name of the event
|
|
111
111
|
*/
|
|
112
112
|
export type DesktopifyAppTrayJSEventAction = {
|
|
113
|
-
role: 'jsEvent';
|
|
114
113
|
event: string;
|
|
114
|
+
role: 'jsEvent';
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/**
|
|
@@ -122,28 +122,28 @@ export type DesktopifyAppTrayNoAction = {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
export type DesktopifyAppTrayAction =
|
|
125
|
-
| DesktopifyAppTrayToggleMenuAction
|
|
126
|
-
| DesktopifyAppTrayToggleWindowAction
|
|
127
125
|
| DesktopifyAppTrayJSEventAction
|
|
128
|
-
| DesktopifyAppTrayNoAction
|
|
126
|
+
| DesktopifyAppTrayNoAction
|
|
127
|
+
| DesktopifyAppTrayToggleMenuAction
|
|
128
|
+
| DesktopifyAppTrayToggleWindowAction;
|
|
129
129
|
|
|
130
130
|
export interface DesktopifyAppTray {
|
|
131
|
-
|
|
132
|
-
objectId?: string;
|
|
131
|
+
bundledIcon?: string;
|
|
133
132
|
icon?: string;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
macOSIcon?: string;
|
|
138
|
-
macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
133
|
+
iconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
134
|
+
id: string;
|
|
135
|
+
leftClick: DesktopifyAppTrayAction;
|
|
139
136
|
linuxIcon?: string;
|
|
140
137
|
linuxIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
macOSIcon?: string;
|
|
139
|
+
macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
140
|
+
objectId?: string;
|
|
141
|
+
rightClick: DesktopifyAppTrayAction;
|
|
143
142
|
swapClickHandlers?: boolean;
|
|
143
|
+
useSeparateIcons?: boolean;
|
|
144
144
|
useTemplateImage?: boolean;
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
windowsIcon?: string;
|
|
146
|
+
windowsIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
|
|
@@ -242,47 +242,10 @@ export type whitelistedWebPreferencesOptions =
|
|
|
242
242
|
* Interface for ToDesktop App Windows
|
|
243
243
|
*/
|
|
244
244
|
export interface DesktopifyAppWindow {
|
|
245
|
-
/**
|
|
246
|
-
* A unique window id
|
|
247
|
-
*/
|
|
248
|
-
id: string;
|
|
249
|
-
/**
|
|
250
|
-
* A *mutable* window object id
|
|
251
|
-
*/
|
|
252
|
-
objectId?: string;
|
|
253
245
|
/**
|
|
254
246
|
* The window's background type
|
|
255
247
|
*/
|
|
256
|
-
backgroundType?: '
|
|
257
|
-
/**
|
|
258
|
-
* The window name. Only visible to developer
|
|
259
|
-
*/
|
|
260
|
-
name: string;
|
|
261
|
-
/**
|
|
262
|
-
* The window's url
|
|
263
|
-
*/
|
|
264
|
-
url: string;
|
|
265
|
-
/**
|
|
266
|
-
* Whether this is the main window. The main window handles deeplinks
|
|
267
|
-
*/
|
|
268
|
-
isMain: boolean;
|
|
269
|
-
/**
|
|
270
|
-
* The type of window
|
|
271
|
-
*/
|
|
272
|
-
type: 'menubar' | 'app' | 'panel' | 'desktop';
|
|
273
|
-
/**
|
|
274
|
-
* Keyboard shortcut to toggle window visibility
|
|
275
|
-
*/
|
|
276
|
-
toggleVisibilityKeyboardShortcut?: string;
|
|
277
|
-
/**
|
|
278
|
-
* By default ToDesktop remembers window width & height between sessions.
|
|
279
|
-
* Setting to `true` disables behaviour
|
|
280
|
-
*/
|
|
281
|
-
shouldResetDimensions?: boolean;
|
|
282
|
-
/**
|
|
283
|
-
* If `true` prevents the native window's title from changing when the document title changes
|
|
284
|
-
*/
|
|
285
|
-
isTitleStatic?: boolean;
|
|
248
|
+
backgroundType?: 'color' | 'normal' | 'transparent' | 'vibrant';
|
|
286
249
|
/**
|
|
287
250
|
* Disables default rightClick menu
|
|
288
251
|
*/
|
|
@@ -292,93 +255,130 @@ export interface DesktopifyAppWindow {
|
|
|
292
255
|
*/
|
|
293
256
|
disableContextMenuOpenInWindow: boolean;
|
|
294
257
|
/**
|
|
295
|
-
*
|
|
258
|
+
* Don't allow tabs in window (macOS only)
|
|
296
259
|
*/
|
|
297
|
-
|
|
260
|
+
disableTabs: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* The path to the file to load if `shouldUseFileInsteadOfUrl` is `true`.
|
|
263
|
+
*/
|
|
264
|
+
file?: string;
|
|
298
265
|
/**
|
|
299
266
|
* Configuration options for find in page
|
|
300
267
|
*/
|
|
301
268
|
findInPageOptions?: {
|
|
302
269
|
horizontalPlacement?: {
|
|
303
|
-
type: 'left' | 'default' | 'right';
|
|
304
|
-
left: FindInPagePlacement;
|
|
305
270
|
default: FindInPagePlacement;
|
|
271
|
+
left: FindInPagePlacement;
|
|
306
272
|
right: FindInPagePlacement;
|
|
273
|
+
type: 'default' | 'left' | 'right';
|
|
307
274
|
};
|
|
308
275
|
verticalPlacement?: {
|
|
309
|
-
type: 'top' | 'default' | 'bottom';
|
|
310
|
-
top: FindInPagePlacement;
|
|
311
|
-
default: FindInPagePlacement;
|
|
312
276
|
bottom: FindInPagePlacement;
|
|
277
|
+
default: FindInPagePlacement;
|
|
278
|
+
top: FindInPagePlacement;
|
|
279
|
+
type: 'bottom' | 'default' | 'top';
|
|
313
280
|
};
|
|
314
281
|
};
|
|
315
282
|
/**
|
|
316
|
-
*
|
|
283
|
+
* Does the window have a maximum height. Default is `false`
|
|
317
284
|
*/
|
|
318
|
-
|
|
285
|
+
hasMaxHeight: boolean;
|
|
319
286
|
/**
|
|
320
|
-
*
|
|
287
|
+
* Does the window have a maximum width. Default is `false`
|
|
321
288
|
*/
|
|
322
|
-
|
|
289
|
+
hasMaxWidth: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Does the window have a minimum height. Default is `false`
|
|
292
|
+
*/
|
|
293
|
+
hasMinHeight: boolean;
|
|
323
294
|
/**
|
|
324
295
|
* Does the window have a minimum width. Default is `false`
|
|
325
296
|
*/
|
|
326
297
|
hasMinWidth: boolean;
|
|
327
298
|
/**
|
|
328
|
-
*
|
|
299
|
+
* A unique window id
|
|
329
300
|
*/
|
|
330
|
-
|
|
301
|
+
id: string;
|
|
331
302
|
/**
|
|
332
|
-
*
|
|
303
|
+
* Allows user to `Cmd+F` or `Edit>Find` to search for text on page
|
|
333
304
|
*/
|
|
334
|
-
|
|
305
|
+
isFindInPageEnabled?: boolean;
|
|
335
306
|
/**
|
|
336
|
-
*
|
|
307
|
+
* Whether this is the main window. The main window handles deeplinks
|
|
337
308
|
*/
|
|
338
|
-
|
|
309
|
+
isMain: boolean;
|
|
339
310
|
/**
|
|
340
|
-
*
|
|
311
|
+
* If `true` prevents the native window's title from changing when the document title changes
|
|
341
312
|
*/
|
|
342
|
-
|
|
313
|
+
isTitleStatic?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* The window name. Only visible to developer
|
|
316
|
+
*/
|
|
317
|
+
name: string;
|
|
318
|
+
/**
|
|
319
|
+
* A *mutable* window object id
|
|
320
|
+
*/
|
|
321
|
+
objectId?: string;
|
|
343
322
|
/**
|
|
344
323
|
* BrowserWindow Constructor Options
|
|
345
324
|
*/
|
|
346
|
-
options:
|
|
347
|
-
BrowserWindowConstructorOptions,
|
|
348
|
-
whitelistedBrowserWindowConstructorOptions
|
|
349
|
-
> & {
|
|
325
|
+
options: {
|
|
350
326
|
/**
|
|
351
327
|
* Settings of web page's features.
|
|
352
328
|
*/
|
|
353
329
|
webPreferences?: Pick<WebPreferences, whitelistedWebPreferencesOptions>;
|
|
354
|
-
}
|
|
330
|
+
} & Pick<
|
|
331
|
+
BrowserWindowConstructorOptions,
|
|
332
|
+
whitelistedBrowserWindowConstructorOptions
|
|
333
|
+
>;
|
|
334
|
+
/**
|
|
335
|
+
* By default ToDesktop remembers window width & height between sessions.
|
|
336
|
+
* Setting to `true` disables behaviour
|
|
337
|
+
*/
|
|
338
|
+
shouldResetDimensions?: boolean;
|
|
355
339
|
/**
|
|
356
340
|
* The window should load a file instead of a URL.
|
|
357
341
|
* The file property (below) should also be set if the value is `true`.
|
|
358
342
|
*/
|
|
359
343
|
shouldUseFileInsteadOfUrl?: boolean;
|
|
360
344
|
/**
|
|
361
|
-
*
|
|
345
|
+
* Keyboard shortcut to toggle window visibility
|
|
362
346
|
*/
|
|
363
|
-
|
|
347
|
+
toggleVisibilityKeyboardShortcut?: string;
|
|
348
|
+
/**
|
|
349
|
+
* The type of window
|
|
350
|
+
*/
|
|
351
|
+
type: 'app' | 'desktop' | 'menubar' | 'panel';
|
|
352
|
+
/**
|
|
353
|
+
* The window's url
|
|
354
|
+
*/
|
|
355
|
+
url: string;
|
|
356
|
+
/**
|
|
357
|
+
* Inital visibility of window
|
|
358
|
+
*/
|
|
359
|
+
visibility: 'hidden' | 'show-when-contents-loaded' | 'visible';
|
|
360
|
+
/**
|
|
361
|
+
* MacOS option for whether the window should be visible on all workspaces
|
|
362
|
+
*/
|
|
363
|
+
visibleOnAllWorkspaces: boolean;
|
|
364
364
|
}
|
|
365
365
|
// TODO: Look into hasMinHeight, etc
|
|
366
366
|
|
|
367
367
|
export type AutoUpdateConfiguration = {
|
|
368
|
+
autoCheckIntervalMins: number;
|
|
368
369
|
autoUpdater: boolean;
|
|
369
|
-
shouldAutoCheckOnLaunch: boolean;
|
|
370
370
|
shouldAutoCheckInterval: boolean;
|
|
371
|
-
|
|
371
|
+
shouldAutoCheckOnLaunch: boolean;
|
|
372
372
|
updateReadyAction: {
|
|
373
373
|
showInstallAndRestartPrompt: {
|
|
374
|
-
mode: 'always' | '
|
|
375
|
-
options:
|
|
374
|
+
mode: 'always' | 'never' | 'whenInForeground';
|
|
375
|
+
options: {
|
|
376
376
|
installOnNextLaunchButton: string;
|
|
377
377
|
restartAndInstallButton: string;
|
|
378
|
-
}
|
|
378
|
+
} & Omit<MessageBoxOptions, 'buttons'>;
|
|
379
379
|
};
|
|
380
380
|
showNotification: {
|
|
381
|
-
mode: 'always' | '
|
|
381
|
+
mode: 'always' | 'never' | 'whenInBackground';
|
|
382
382
|
options: Omit<NotificationConstructorOptions, 'actions'>;
|
|
383
383
|
};
|
|
384
384
|
};
|
|
@@ -394,67 +394,96 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
394
394
|
*/
|
|
395
395
|
appModelId?: string;
|
|
396
396
|
/**
|
|
397
|
-
*
|
|
397
|
+
* Registers an app protocol. Format should be `{APP_PROTOCOL}://` e.g. `example://`
|
|
398
398
|
*/
|
|
399
|
-
|
|
399
|
+
appProtocol: ISwitchableValue<string>;
|
|
400
400
|
|
|
401
401
|
/**
|
|
402
|
-
*
|
|
402
|
+
* Sets strings to be used in the app UI. Currently only supports English
|
|
403
403
|
*/
|
|
404
|
-
|
|
404
|
+
appStrings?: {
|
|
405
|
+
[key in ValidTranslationKeys]?: {
|
|
406
|
+
[lang in ValidTranslationLanguages]?: string;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
405
409
|
/**
|
|
406
|
-
*
|
|
410
|
+
* Sets whether the window menu bar should hide itself automatically.
|
|
411
|
+
* Once set the menu bar will only show when users press the single Alt key.
|
|
407
412
|
*/
|
|
408
|
-
|
|
413
|
+
autoHideMenuBar?: boolean;
|
|
409
414
|
/**
|
|
410
|
-
*
|
|
415
|
+
* Configure auto updates
|
|
411
416
|
*/
|
|
412
|
-
|
|
417
|
+
autoUpdates: AutoUpdateConfiguration;
|
|
413
418
|
/**
|
|
414
|
-
* The
|
|
419
|
+
* The locally-bundled app icon.
|
|
415
420
|
*/
|
|
416
|
-
|
|
421
|
+
bundledIcon?: string;
|
|
417
422
|
/**
|
|
418
|
-
*
|
|
423
|
+
* Command line switches
|
|
424
|
+
* Learn more {@link https://www.electronjs.org/docs/api/command-line-switches}
|
|
425
|
+
* @example
|
|
426
|
+
* {
|
|
427
|
+
* 'remote-debugging-port': '8315'
|
|
428
|
+
* }
|
|
419
429
|
*/
|
|
420
|
-
|
|
430
|
+
commandLineSwitches?: {
|
|
431
|
+
[key: string]: string;
|
|
432
|
+
};
|
|
421
433
|
/**
|
|
422
|
-
* The
|
|
434
|
+
* The name of the company that the app belongs to
|
|
423
435
|
*/
|
|
424
|
-
|
|
436
|
+
companyName?: string;
|
|
425
437
|
/**
|
|
426
|
-
*
|
|
438
|
+
* URL that crash reports will be POSTed to
|
|
427
439
|
*/
|
|
428
|
-
|
|
440
|
+
crashReporter?: string;
|
|
429
441
|
/**
|
|
430
|
-
*
|
|
442
|
+
* Metadata about plugins that were manually linked into the app
|
|
431
443
|
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
444
|
+
customPlugins?: CustomPlugin[];
|
|
445
|
+
/**
|
|
446
|
+
* Disable devTools on all app windows
|
|
447
|
+
*/
|
|
448
|
+
disableDevTools: boolean;
|
|
449
|
+
/**
|
|
450
|
+
* Disable error reporting (Sentry)
|
|
451
|
+
*/
|
|
452
|
+
disableErrorTracking?: boolean;
|
|
435
453
|
|
|
436
|
-
|
|
437
|
-
|
|
454
|
+
/**
|
|
455
|
+
* Enables NEW push notifications — uses `@cuj1559/electron-push-receiver`
|
|
456
|
+
*/
|
|
457
|
+
enableNewPushNotifications?: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* Enables push notifications — uses `electron-push-receiver`
|
|
460
|
+
*/
|
|
461
|
+
enablePushNotifications?: boolean;
|
|
438
462
|
|
|
439
|
-
linuxIcon?: string;
|
|
440
|
-
linuxIconAssetDetails?: AppIconAssetDetails;
|
|
441
463
|
/**
|
|
442
|
-
*
|
|
464
|
+
* File assets that get bundled with the app and are available offline
|
|
443
465
|
*/
|
|
444
|
-
|
|
466
|
+
fileAssetDetailsList?: FileAssetDetails[];
|
|
445
467
|
/**
|
|
446
|
-
*
|
|
468
|
+
* Opens `accounts.google.com/o/oauth` in user's default browswer not as internal url
|
|
447
469
|
*/
|
|
448
|
-
|
|
470
|
+
googleOAuthIsExternal?: boolean;
|
|
449
471
|
/**
|
|
450
|
-
*
|
|
451
|
-
* Always display the dock icon while the app is open. Even if there are no windows open.
|
|
472
|
+
* The app icon url
|
|
452
473
|
*/
|
|
453
|
-
|
|
474
|
+
icon?: string;
|
|
454
475
|
/**
|
|
455
|
-
*
|
|
476
|
+
* Details concerning how the app icon should be handled across ToDesktop services
|
|
456
477
|
*/
|
|
457
|
-
|
|
478
|
+
iconAssetDetails?: AppIconAssetDetails;
|
|
479
|
+
/**
|
|
480
|
+
* App identifier
|
|
481
|
+
*/
|
|
482
|
+
id: string;
|
|
483
|
+
/**
|
|
484
|
+
* Disables the same-origin policy
|
|
485
|
+
*/
|
|
486
|
+
insecure?: boolean;
|
|
458
487
|
/**
|
|
459
488
|
* Regex patterns for internal app urls
|
|
460
489
|
*/
|
|
@@ -465,29 +494,49 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
465
494
|
*/
|
|
466
495
|
isNativeWindowOpenDisabled?: boolean;
|
|
467
496
|
/**
|
|
468
|
-
*
|
|
497
|
+
* Whether the app is secure i.e. using valid code signing certificates.
|
|
498
|
+
* Note: This value is not persisted in firestore, and is instead written locally at build time.
|
|
499
|
+
* @default false
|
|
469
500
|
*/
|
|
470
|
-
|
|
501
|
+
isSecure?: boolean;
|
|
471
502
|
/**
|
|
472
|
-
*
|
|
503
|
+
* Last todesktop builder version that was used to update the app
|
|
473
504
|
*/
|
|
474
|
-
|
|
505
|
+
lastUsedBuilderVersion?: string;
|
|
475
506
|
/**
|
|
476
|
-
*
|
|
507
|
+
* Last desktopify version that was used to update the app
|
|
477
508
|
*/
|
|
478
|
-
|
|
509
|
+
lastUsedDesktopifyVersion?: string;
|
|
510
|
+
linuxIcon?: string;
|
|
511
|
+
linuxIconAssetDetails?: AppIconAssetDetails;
|
|
512
|
+
macOSIcon?: string;
|
|
513
|
+
macOSIconAssetDetails?: AppIconAssetDetails;
|
|
479
514
|
/**
|
|
480
|
-
*
|
|
515
|
+
* The app's menus
|
|
481
516
|
*/
|
|
482
|
-
|
|
517
|
+
menus: DesktopifyAppMenu[];
|
|
483
518
|
/**
|
|
484
|
-
*
|
|
519
|
+
* The name of the app
|
|
485
520
|
*/
|
|
486
|
-
|
|
521
|
+
name: string;
|
|
487
522
|
/**
|
|
488
|
-
*
|
|
523
|
+
* Sets whether an offline screen will be displayed if the internet is disconnected
|
|
524
|
+
* on initial page load. The color of the re-connect button that is shown is customizable.
|
|
489
525
|
*/
|
|
490
|
-
|
|
526
|
+
offlineScreen?: {
|
|
527
|
+
buttonBackgroundColor: string;
|
|
528
|
+
buttonTextColor: string;
|
|
529
|
+
enabled: boolean;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* An array of plugin modules. Can work with semver specificity
|
|
533
|
+
*/
|
|
534
|
+
plugins?: (Plugin | string)[];
|
|
535
|
+
/**
|
|
536
|
+
* Unused currently
|
|
537
|
+
* @unused
|
|
538
|
+
*/
|
|
539
|
+
pollForAppUpdatesEveryXMinutes?: number;
|
|
491
540
|
/**
|
|
492
541
|
* Runtime environment variables
|
|
493
542
|
*/
|
|
@@ -495,20 +544,27 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
495
544
|
[key: string]: string;
|
|
496
545
|
};
|
|
497
546
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
* @example
|
|
501
|
-
* {
|
|
502
|
-
* 'remote-debugging-port': '8315'
|
|
503
|
-
* }
|
|
547
|
+
* This option is only available when `shouldMinimizeToTray` is `true`.
|
|
548
|
+
* Always display the dock icon while the app is open. Even if there are no windows open.
|
|
504
549
|
*/
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
550
|
+
shouldAlwaysDisplayDockIcon?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Whether the app should have full access to Electron APIs
|
|
553
|
+
* @default false
|
|
554
|
+
*/
|
|
555
|
+
shouldHaveFullAccessToElectronAPIs?: boolean;
|
|
508
556
|
/**
|
|
509
557
|
* Launch App at startup
|
|
510
558
|
*/
|
|
511
559
|
shouldLaunchAtStartupByDefault?: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* Open same domain links in user's default browser
|
|
562
|
+
*/
|
|
563
|
+
shouldMakeSameDomainAnExternalLink?: boolean;
|
|
564
|
+
/**
|
|
565
|
+
* Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
|
|
566
|
+
*/
|
|
567
|
+
shouldMinimizeToTray?: boolean;
|
|
512
568
|
/**
|
|
513
569
|
* If `true` the app will prevent app from opening any protocols that are not
|
|
514
570
|
* already in a maybeAllowList or allowList (see `protocolLists.ts` in desktopify).
|
|
@@ -518,113 +574,61 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
518
574
|
* Disables non-essential logs
|
|
519
575
|
*/
|
|
520
576
|
shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
|
|
577
|
+
/**
|
|
578
|
+
* Prevents the window contents from being captured by other apps.
|
|
579
|
+
*/
|
|
580
|
+
shouldProtectContent?: boolean;
|
|
521
581
|
/**
|
|
522
582
|
* Disables electron overrides which ensure renderer process are restarted on each navigation.
|
|
523
583
|
* Learn more {@link https://github.com/electron/electron/issues/18397}
|
|
524
584
|
*/
|
|
525
585
|
shouldReuseRendererProcess?: boolean;
|
|
526
586
|
/**
|
|
527
|
-
*
|
|
528
|
-
*/
|
|
529
|
-
shouldMakeSameDomainAnExternalLink?: boolean;
|
|
530
|
-
/**
|
|
531
|
-
* Enables push notifications — uses `electron-push-receiver`
|
|
532
|
-
*/
|
|
533
|
-
enablePushNotifications?: boolean;
|
|
534
|
-
/**
|
|
535
|
-
* Enables NEW push notifications — uses `@cuj1559/electron-push-receiver`
|
|
587
|
+
* Removes electron from userAgent
|
|
536
588
|
*/
|
|
537
|
-
|
|
589
|
+
shouldUseRealUserAgent?: boolean;
|
|
538
590
|
/**
|
|
539
|
-
*
|
|
591
|
+
* Only allow a single instance of this app to run
|
|
540
592
|
*/
|
|
541
|
-
|
|
593
|
+
singleInstance: boolean;
|
|
542
594
|
/**
|
|
543
595
|
* Sets theme for Electron UI elements and css.
|
|
544
596
|
*
|
|
545
597
|
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
546
598
|
*/
|
|
547
|
-
themeSource?: '
|
|
599
|
+
themeSource?: 'dark' | 'light' | 'system';
|
|
548
600
|
/**
|
|
549
601
|
* Sets theme source for only mac
|
|
550
602
|
*
|
|
551
603
|
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
552
604
|
*/
|
|
553
|
-
themeSourceMac?: '
|
|
554
|
-
/**
|
|
555
|
-
* URL that crash reports will be POSTed to
|
|
556
|
-
*/
|
|
557
|
-
crashReporter?: string;
|
|
558
|
-
/**
|
|
559
|
-
* Unused currently
|
|
560
|
-
* @unused
|
|
561
|
-
*/
|
|
562
|
-
pollForAppUpdatesEveryXMinutes?: number;
|
|
563
|
-
/**
|
|
564
|
-
* An array of plugin modules. Can work with semver specificity
|
|
565
|
-
*/
|
|
566
|
-
plugins?: (Plugin | string)[];
|
|
567
|
-
/**
|
|
568
|
-
* The app's windows
|
|
569
|
-
*/
|
|
570
|
-
windows: DesktopifyAppWindow[];
|
|
605
|
+
themeSourceMac?: 'dark' | 'light' | 'system';
|
|
571
606
|
/**
|
|
572
607
|
* The app's trays
|
|
573
608
|
*/
|
|
574
609
|
trays: DesktopifyAppTray[];
|
|
575
610
|
/**
|
|
576
|
-
*
|
|
611
|
+
* Specifys the app's user agent
|
|
577
612
|
*/
|
|
578
|
-
|
|
613
|
+
userAgent: ISwitchableValue<string>;
|
|
579
614
|
/**
|
|
580
615
|
* Prevents a potential vulnerability in URL matching in Electron
|
|
581
616
|
* https://linear.app/todesktop/issue/TD-1428/html-injection-due-to-regular-expression-bypass
|
|
582
617
|
*/
|
|
583
618
|
useSafeInternalUrlMatcher?: boolean;
|
|
584
619
|
/**
|
|
585
|
-
*
|
|
586
|
-
* Once set the menu bar will only show when users press the single Alt key.
|
|
587
|
-
*/
|
|
588
|
-
autoHideMenuBar?: boolean;
|
|
589
|
-
/**
|
|
590
|
-
* Sets whether an offline screen will be displayed if the internet is disconnected
|
|
591
|
-
* on initial page load. The color of the re-connect button that is shown is customizable.
|
|
592
|
-
*/
|
|
593
|
-
offlineScreen?: {
|
|
594
|
-
enabled: boolean;
|
|
595
|
-
buttonBackgroundColor: string;
|
|
596
|
-
buttonTextColor: string;
|
|
597
|
-
};
|
|
598
|
-
/**
|
|
599
|
-
* Sets strings to be used in the app UI. Currently only supports English
|
|
600
|
-
*/
|
|
601
|
-
appStrings?: {
|
|
602
|
-
[key in ValidTranslationKeys]?: {
|
|
603
|
-
[lang in ValidTranslationLanguages]?: string;
|
|
604
|
-
};
|
|
605
|
-
};
|
|
606
|
-
/**
|
|
607
|
-
* File assets that get bundled with the app and are available offline
|
|
620
|
+
* Instead of using one icon for every platform, use a separate icon for different platforms
|
|
608
621
|
*/
|
|
609
|
-
|
|
622
|
+
useSeparateIcons?: boolean;
|
|
610
623
|
|
|
611
624
|
/**
|
|
612
|
-
*
|
|
613
|
-
* @default false
|
|
625
|
+
* The app's windows
|
|
614
626
|
*/
|
|
615
|
-
|
|
627
|
+
windows: DesktopifyAppWindow[];
|
|
616
628
|
|
|
617
|
-
|
|
618
|
-
* Whether the app is secure i.e. using valid code signing certificates.
|
|
619
|
-
* Note: This value is not persisted in firestore, and is instead written locally at build time.
|
|
620
|
-
* @default false
|
|
621
|
-
*/
|
|
622
|
-
isSecure?: boolean;
|
|
629
|
+
windowsIcon?: string;
|
|
623
630
|
|
|
624
|
-
|
|
625
|
-
* Prevents the window contents from being captured by other apps.
|
|
626
|
-
*/
|
|
627
|
-
shouldProtectContent?: boolean;
|
|
631
|
+
windowsIconAssetDetails?: AppIconAssetDetails;
|
|
628
632
|
}
|
|
629
633
|
|
|
630
634
|
export type FindInPagePlacement = { offset: number };
|