@todesktop/shared 7.190.0 → 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.
Files changed (46) hide show
  1. package/.prettierignore +0 -2
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +42 -15
  4. package/eslint.config.mjs +8 -55
  5. package/lib/base.d.ts +81 -75
  6. package/lib/base.js +9 -12
  7. package/lib/desktopify.d.ts +74 -74
  8. package/lib/desktopify.js +28 -35
  9. package/lib/desktopify2.d.ts +223 -223
  10. package/lib/desktopify2.js +2 -5
  11. package/lib/getSiteInfo.d.ts +6 -6
  12. package/lib/getSiteInfo.js +1 -2
  13. package/lib/hsm.d.ts +1 -1
  14. package/lib/hsm.js +5 -12
  15. package/lib/index.d.ts +12 -13
  16. package/lib/index.js +13 -31
  17. package/lib/invitePermissionLabels.d.ts +4 -2
  18. package/lib/invitePermissionLabels.js +14 -11
  19. package/lib/personalAccessTokens.d.ts +12 -12
  20. package/lib/personalAccessTokens.js +1 -2
  21. package/lib/plans.d.ts +27 -27
  22. package/lib/plans.js +181 -185
  23. package/lib/plugin.d.ts +18 -18
  24. package/lib/plugin.js +1 -2
  25. package/lib/toDesktop.d.ts +66 -66
  26. package/lib/toDesktop.js +1 -2
  27. package/lib/translation.d.ts +1 -1
  28. package/lib/translation.js +1 -2
  29. package/lib/validations.d.ts +66 -66
  30. package/lib/validations.js +54 -56
  31. package/package.json +11 -17
  32. package/src/base.ts +89 -82
  33. package/src/desktopify.ts +82 -80
  34. package/src/desktopify2.ts +240 -240
  35. package/src/getSiteInfo.ts +6 -6
  36. package/src/hsm.ts +7 -7
  37. package/src/index.ts +13 -14
  38. package/src/invitePermissionLabels.ts +20 -6
  39. package/src/personalAccessTokens.ts +12 -12
  40. package/src/plans.ts +191 -191
  41. package/src/plugin.ts +19 -19
  42. package/src/toDesktop.ts +70 -70
  43. package/src/translation.ts +2 -2
  44. package/src/validations.ts +51 -49
  45. package/tsconfig.json +6 -3
  46. package/.prettierrc +0 -5
@@ -1,24 +1,24 @@
1
- import { ISwitchableValue } from './toDesktop';
2
1
  import {
3
- MenuItemConstructorOptions,
4
2
  BrowserWindowConstructorOptions,
5
- WebPreferences,
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
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:history-home'
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
- platforms?: NodeJS.Platform[];
73
- submenu?: DesktopifyMenuItemConstructorOptions[];
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
- id: string;
132
- objectId?: string;
131
+ bundledIcon?: string;
133
132
  icon?: string;
134
- useSeparateIcons?: boolean;
135
- windowsIcon?: string;
136
- windowsIconAssetDetails?: TrayMenubarIconAssetDetails;
137
- macOSIcon?: string;
138
- macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
133
+ iconAssetDetails?: TrayMenubarIconAssetDetails;
134
+ id: string;
135
+ leftClick: DesktopifyAppTrayAction;
139
136
  linuxIcon?: string;
140
137
  linuxIconAssetDetails?: TrayMenubarIconAssetDetails;
141
- bundledIcon?: string;
142
- iconAssetDetails?: TrayMenubarIconAssetDetails;
138
+ macOSIcon?: string;
139
+ macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
140
+ objectId?: string;
141
+ rightClick: DesktopifyAppTrayAction;
143
142
  swapClickHandlers?: boolean;
143
+ useSeparateIcons?: boolean;
144
144
  useTemplateImage?: boolean;
145
- rightClick: DesktopifyAppTrayAction;
146
- leftClick: DesktopifyAppTrayAction;
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?: 'normal' | 'vibrant' | 'transparent' | 'color';
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
- * Allows user to `Cmd+F` or `Edit>Find` to search for text on page
258
+ * Don't allow tabs in window (macOS only)
296
259
  */
297
- isFindInPageEnabled?: boolean;
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
- * Inital visibility of window
283
+ * Does the window have a maximum height. Default is `false`
317
284
  */
318
- visibility: 'visible' | 'hidden' | 'show-when-contents-loaded';
285
+ hasMaxHeight: boolean;
319
286
  /**
320
- * MacOS option for whether the window should be visible on all workspaces
287
+ * Does the window have a maximum width. Default is `false`
321
288
  */
322
- visibleOnAllWorkspaces: boolean;
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
- * Does the window have a maximum width. Default is `false`
299
+ * A unique window id
329
300
  */
330
- hasMaxWidth: boolean;
301
+ id: string;
331
302
  /**
332
- * Does the window have a minimum height. Default is `false`
303
+ * Allows user to `Cmd+F` or `Edit>Find` to search for text on page
333
304
  */
334
- hasMinHeight: boolean;
305
+ isFindInPageEnabled?: boolean;
335
306
  /**
336
- * Does the window have a maximum height. Default is `false`
307
+ * Whether this is the main window. The main window handles deeplinks
337
308
  */
338
- hasMaxHeight: boolean;
309
+ isMain: boolean;
339
310
  /**
340
- * Don't allow tabs in window (macOS only)
311
+ * If `true` prevents the native window's title from changing when the document title changes
341
312
  */
342
- disableTabs: boolean;
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: Pick<
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
- * The path to the file to load if `shouldUseFileInsteadOfUrl` is `true`.
345
+ * Keyboard shortcut to toggle window visibility
362
346
  */
363
- file?: string;
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
- autoCheckIntervalMins: number;
371
+ shouldAutoCheckOnLaunch: boolean;
372
372
  updateReadyAction: {
373
373
  showInstallAndRestartPrompt: {
374
- mode: 'always' | 'whenInForeground' | 'never';
375
- options: Omit<MessageBoxOptions, 'buttons'> & {
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' | 'whenInBackground' | 'never';
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
- * Configure auto updates
397
+ * Registers an app protocol. Format should be `{APP_PROTOCOL}://` e.g. `example://`
398
398
  */
399
- autoUpdates: AutoUpdateConfiguration;
399
+ appProtocol: ISwitchableValue<string>;
400
400
 
401
401
  /**
402
- * App identifier
402
+ * Sets strings to be used in the app UI. Currently only supports English
403
403
  */
404
- id: string;
404
+ appStrings?: {
405
+ [key in ValidTranslationKeys]?: {
406
+ [lang in ValidTranslationLanguages]?: string;
407
+ };
408
+ };
405
409
  /**
406
- * Last desktopify version that was used to update the app
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
- lastUsedDesktopifyVersion?: string;
413
+ autoHideMenuBar?: boolean;
409
414
  /**
410
- * Last todesktop builder version that was used to update the app
415
+ * Configure auto updates
411
416
  */
412
- lastUsedBuilderVersion?: string;
417
+ autoUpdates: AutoUpdateConfiguration;
413
418
  /**
414
- * The name of the app
419
+ * The locally-bundled app icon.
415
420
  */
416
- name: string;
421
+ bundledIcon?: string;
417
422
  /**
418
- * The app icon url
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
- icon?: string;
430
+ commandLineSwitches?: {
431
+ [key: string]: string;
432
+ };
421
433
  /**
422
- * The locally-bundled app icon.
434
+ * The name of the company that the app belongs to
423
435
  */
424
- bundledIcon?: string;
436
+ companyName?: string;
425
437
  /**
426
- * Details concerning how the app icon should be handled across ToDesktop services
438
+ * URL that crash reports will be POSTed to
427
439
  */
428
- iconAssetDetails?: AppIconAssetDetails;
440
+ crashReporter?: string;
429
441
  /**
430
- * Instead of using one icon for every platform, use a separate icon for different platforms
442
+ * Metadata about plugins that were manually linked into the app
431
443
  */
432
- useSeparateIcons?: boolean;
433
- windowsIcon?: string;
434
- windowsIconAssetDetails?: AppIconAssetDetails;
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
- macOSIcon?: string;
437
- macOSIconAssetDetails?: AppIconAssetDetails;
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
- * The name of the company that the app belongs to
464
+ * File assets that get bundled with the app and are available offline
443
465
  */
444
- companyName?: string;
466
+ fileAssetDetailsList?: FileAssetDetails[];
445
467
  /**
446
- * Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
468
+ * Opens `accounts.google.com/o/oauth` in user's default browswer not as internal url
447
469
  */
448
- shouldMinimizeToTray?: boolean;
470
+ googleOAuthIsExternal?: boolean;
449
471
  /**
450
- * This option is only available when `shouldMinimizeToTray` is `true`.
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
- shouldAlwaysDisplayDockIcon?: boolean;
474
+ icon?: string;
454
475
  /**
455
- * Only allow a single instance of this app to run
476
+ * Details concerning how the app icon should be handled across ToDesktop services
456
477
  */
457
- singleInstance: boolean;
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
- * Specifys the app's user agent
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
- userAgent: ISwitchableValue<string>;
501
+ isSecure?: boolean;
471
502
  /**
472
- * Disable devTools on all app windows
503
+ * Last todesktop builder version that was used to update the app
473
504
  */
474
- disableDevTools: boolean;
505
+ lastUsedBuilderVersion?: string;
475
506
  /**
476
- * Registers an app protocol. Format should be `{APP_PROTOCOL}://` e.g. `example://`
507
+ * Last desktopify version that was used to update the app
477
508
  */
478
- appProtocol: ISwitchableValue<string>;
509
+ lastUsedDesktopifyVersion?: string;
510
+ linuxIcon?: string;
511
+ linuxIconAssetDetails?: AppIconAssetDetails;
512
+ macOSIcon?: string;
513
+ macOSIconAssetDetails?: AppIconAssetDetails;
479
514
  /**
480
- * Disables the same-origin policy
515
+ * The app's menus
481
516
  */
482
- insecure?: boolean;
517
+ menus: DesktopifyAppMenu[];
483
518
  /**
484
- * Opens `accounts.google.com/o/oauth` in user's default browswer not as internal url
519
+ * The name of the app
485
520
  */
486
- googleOAuthIsExternal?: boolean;
521
+ name: string;
487
522
  /**
488
- * Removes electron from userAgent
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
- shouldUseRealUserAgent?: boolean;
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
- * Command line switches
499
- * Learn more {@link https://www.electronjs.org/docs/api/command-line-switches}
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
- commandLineSwitches?: {
506
- [key: string]: string;
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,117 +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
- * Open same domain links in user's default browser
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
- enableNewPushNotifications?: boolean;
589
+ shouldUseRealUserAgent?: boolean;
538
590
  /**
539
- * Disable error reporting (Sentry)
591
+ * Only allow a single instance of this app to run
540
592
  */
541
- disableErrorTracking?: boolean;
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?: 'system' | 'light' | 'dark';
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?: 'system' | 'light' | 'dark';
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
- * Metadata about plugins that were manually linked into the app
569
- */
570
- customPlugins?: CustomPlugin[];
571
- /**
572
- * The app's windows
573
- */
574
- windows: DesktopifyAppWindow[];
605
+ themeSourceMac?: 'dark' | 'light' | 'system';
575
606
  /**
576
607
  * The app's trays
577
608
  */
578
609
  trays: DesktopifyAppTray[];
579
610
  /**
580
- * The app's menus
611
+ * Specifys the app's user agent
581
612
  */
582
- menus: DesktopifyAppMenu[];
613
+ userAgent: ISwitchableValue<string>;
583
614
  /**
584
615
  * Prevents a potential vulnerability in URL matching in Electron
585
616
  * https://linear.app/todesktop/issue/TD-1428/html-injection-due-to-regular-expression-bypass
586
617
  */
587
618
  useSafeInternalUrlMatcher?: boolean;
588
619
  /**
589
- * Sets whether the window menu bar should hide itself automatically.
590
- * Once set the menu bar will only show when users press the single Alt key.
591
- */
592
- autoHideMenuBar?: boolean;
593
- /**
594
- * Sets whether an offline screen will be displayed if the internet is disconnected
595
- * on initial page load. The color of the re-connect button that is shown is customizable.
596
- */
597
- offlineScreen?: {
598
- enabled: boolean;
599
- buttonBackgroundColor: string;
600
- buttonTextColor: string;
601
- };
602
- /**
603
- * Sets strings to be used in the app UI. Currently only supports English
604
- */
605
- appStrings?: {
606
- [key in ValidTranslationKeys]?: {
607
- [lang in ValidTranslationLanguages]?: string;
608
- };
609
- };
610
- /**
611
- * 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
612
621
  */
613
- fileAssetDetailsList?: FileAssetDetails[];
622
+ useSeparateIcons?: boolean;
614
623
 
615
624
  /**
616
- * Whether the app should have full access to Electron APIs
617
- * @default false
625
+ * The app's windows
618
626
  */
619
- shouldHaveFullAccessToElectronAPIs?: boolean;
627
+ windows: DesktopifyAppWindow[];
620
628
 
621
- /**
622
- * Whether the app is secure i.e. using valid code signing certificates.
623
- * Note: This value is not persisted in firestore, and is instead written locally at build time.
624
- * @default false
625
- */
626
- isSecure?: boolean;
629
+ windowsIcon?: string;
627
630
 
628
- /**
629
- * Prevents the window contents from being captured by other apps.
630
- */
631
- shouldProtectContent?: boolean;
631
+ windowsIconAssetDetails?: AppIconAssetDetails;
632
632
  }
633
633
 
634
634
  export type FindInPagePlacement = { offset: number };