@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/lib/desktopify2.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MenuItemConstructorOptions, BrowserWindowConstructorOptions, WebPreferences, NotificationConstructorOptions, MessageBoxOptions } from '@todesktop/client-electron-types';
|
|
1
|
+
import { BrowserWindowConstructorOptions, MenuItemConstructorOptions, MessageBoxOptions, NotificationConstructorOptions, WebPreferences } from '@todesktop/client-electron-types';
|
|
3
2
|
import { BaseApp } from './base';
|
|
4
|
-
import { DesktopAppPlugin } from './plugin';
|
|
3
|
+
import { CustomPlugin, DesktopAppPlugin } from './plugin';
|
|
4
|
+
import { ISwitchableValue } from './toDesktop';
|
|
5
5
|
import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
|
|
6
6
|
interface BaseAssetDetails {
|
|
7
|
-
/**
|
|
8
|
-
* Remote URL where the asset can be downloaded
|
|
9
|
-
*/
|
|
10
|
-
url: string;
|
|
11
7
|
/**
|
|
12
8
|
* Local path where the asset is/should be stored. This path is relative to the app directory
|
|
13
9
|
*/
|
|
14
10
|
relativeLocalPath: string;
|
|
11
|
+
/**
|
|
12
|
+
* Remote URL where the asset can be downloaded
|
|
13
|
+
*/
|
|
14
|
+
url: string;
|
|
15
15
|
}
|
|
16
16
|
export interface AppIconAssetDetails extends BaseAssetDetails {
|
|
17
17
|
type: 'appIcon';
|
|
@@ -26,24 +26,24 @@ export interface FileAssetDetails extends BaseAssetDetails {
|
|
|
26
26
|
md5Hash: string;
|
|
27
27
|
type: 'file';
|
|
28
28
|
}
|
|
29
|
-
export type AssetDetails = AppIconAssetDetails |
|
|
29
|
+
export type AssetDetails = AppIconAssetDetails | FileAssetDetails | MenuIconAssetDetails | TrayMenubarIconAssetDetails;
|
|
30
30
|
/**
|
|
31
31
|
* Custom ToDesktop Roles for Application & Tray Menus
|
|
32
32
|
*/
|
|
33
|
-
type todesktopRoles = 'todesktop:
|
|
33
|
+
type todesktopRoles = 'todesktop:check-for-updates' | 'todesktop:check-for-updates' | 'todesktop:hide-window' | 'todesktop:history-back' | 'todesktop:history-forward' | 'todesktop:history-home' | 'todesktop:launch-at-startup' | 'todesktop:new-tab' | 'todesktop:new-window' | 'todesktop:quit-completely' | 'todesktop:quit' | 'todesktop:show-window' | 'todesktop:toggle-window' | 'todesktop:toggle-window0' | 'todesktop:toggle-window1' | 'todesktop:toggle-window2' | 'todesktop:toggle-window3' | 'todesktop:toggle-window4';
|
|
34
34
|
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions, 'role' | 'submenu'> {
|
|
35
|
-
|
|
36
|
-
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
37
|
-
role?: MenuItemConstructorOptions['role'] | todesktopRoles;
|
|
38
|
-
useSystemLabel?: boolean;
|
|
39
|
-
event?: string;
|
|
40
|
-
targetWindowId?: string;
|
|
35
|
+
acceleratorBehaviour?: 'custom' | 'default' | 'explicit-none' | 'none';
|
|
41
36
|
actionType?: 'jsEvent' | 'role';
|
|
42
|
-
iconUrl?: string;
|
|
43
37
|
bundledIcon?: string;
|
|
38
|
+
event?: string;
|
|
44
39
|
iconAssetDetails?: MenuIconAssetDetails;
|
|
40
|
+
iconUrl?: string;
|
|
41
|
+
platforms?: NodeJS.Platform[];
|
|
42
|
+
role?: MenuItemConstructorOptions['role'] | todesktopRoles;
|
|
43
|
+
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
44
|
+
targetWindowId?: string;
|
|
45
|
+
useSystemLabel?: boolean;
|
|
45
46
|
useTemplateImage?: boolean;
|
|
46
|
-
acceleratorBehaviour?: 'none' | 'explicit-none' | 'default' | 'custom';
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Toggle Window Tray Action
|
|
@@ -60,8 +60,8 @@ export type DesktopifyAppTrayToggleWindowAction = {
|
|
|
60
60
|
* @param menu - The menu to show when action triggered
|
|
61
61
|
*/
|
|
62
62
|
export type DesktopifyAppTrayToggleMenuAction = {
|
|
63
|
-
role: 'toggleMenu';
|
|
64
63
|
menu: DesktopifyMenuItemConstructorOptions[];
|
|
64
|
+
role: 'toggleMenu';
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* JS Event Tray Action
|
|
@@ -69,8 +69,8 @@ export type DesktopifyAppTrayToggleMenuAction = {
|
|
|
69
69
|
* @param event - The name of the event
|
|
70
70
|
*/
|
|
71
71
|
export type DesktopifyAppTrayJSEventAction = {
|
|
72
|
-
role: 'jsEvent';
|
|
73
72
|
event: string;
|
|
73
|
+
role: 'jsEvent';
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
76
|
* No Action Tray Action
|
|
@@ -78,24 +78,24 @@ export type DesktopifyAppTrayJSEventAction = {
|
|
|
78
78
|
export type DesktopifyAppTrayNoAction = {
|
|
79
79
|
role: 'noAction';
|
|
80
80
|
};
|
|
81
|
-
export type DesktopifyAppTrayAction =
|
|
81
|
+
export type DesktopifyAppTrayAction = DesktopifyAppTrayJSEventAction | DesktopifyAppTrayNoAction | DesktopifyAppTrayToggleMenuAction | DesktopifyAppTrayToggleWindowAction;
|
|
82
82
|
export interface DesktopifyAppTray {
|
|
83
|
-
|
|
84
|
-
objectId?: string;
|
|
83
|
+
bundledIcon?: string;
|
|
85
84
|
icon?: string;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
macOSIcon?: string;
|
|
90
|
-
macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
85
|
+
iconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
86
|
+
id: string;
|
|
87
|
+
leftClick: DesktopifyAppTrayAction;
|
|
91
88
|
linuxIcon?: string;
|
|
92
89
|
linuxIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
macOSIcon?: string;
|
|
91
|
+
macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
92
|
+
objectId?: string;
|
|
93
|
+
rightClick: DesktopifyAppTrayAction;
|
|
95
94
|
swapClickHandlers?: boolean;
|
|
95
|
+
useSeparateIcons?: boolean;
|
|
96
96
|
useTemplateImage?: boolean;
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
windowsIcon?: string;
|
|
98
|
+
windowsIconAssetDetails?: TrayMenubarIconAssetDetails;
|
|
99
99
|
}
|
|
100
100
|
export type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
|
|
101
101
|
/**
|
|
@@ -116,47 +116,10 @@ export type whitelistedWebPreferencesOptions = (typeof allowedWebPreferencesOpti
|
|
|
116
116
|
* Interface for ToDesktop App Windows
|
|
117
117
|
*/
|
|
118
118
|
export interface DesktopifyAppWindow {
|
|
119
|
-
/**
|
|
120
|
-
* A unique window id
|
|
121
|
-
*/
|
|
122
|
-
id: string;
|
|
123
|
-
/**
|
|
124
|
-
* A *mutable* window object id
|
|
125
|
-
*/
|
|
126
|
-
objectId?: string;
|
|
127
119
|
/**
|
|
128
120
|
* The window's background type
|
|
129
121
|
*/
|
|
130
|
-
backgroundType?: '
|
|
131
|
-
/**
|
|
132
|
-
* The window name. Only visible to developer
|
|
133
|
-
*/
|
|
134
|
-
name: string;
|
|
135
|
-
/**
|
|
136
|
-
* The window's url
|
|
137
|
-
*/
|
|
138
|
-
url: string;
|
|
139
|
-
/**
|
|
140
|
-
* Whether this is the main window. The main window handles deeplinks
|
|
141
|
-
*/
|
|
142
|
-
isMain: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* The type of window
|
|
145
|
-
*/
|
|
146
|
-
type: 'menubar' | 'app' | 'panel' | 'desktop';
|
|
147
|
-
/**
|
|
148
|
-
* Keyboard shortcut to toggle window visibility
|
|
149
|
-
*/
|
|
150
|
-
toggleVisibilityKeyboardShortcut?: string;
|
|
151
|
-
/**
|
|
152
|
-
* By default ToDesktop remembers window width & height between sessions.
|
|
153
|
-
* Setting to `true` disables behaviour
|
|
154
|
-
*/
|
|
155
|
-
shouldResetDimensions?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* If `true` prevents the native window's title from changing when the document title changes
|
|
158
|
-
*/
|
|
159
|
-
isTitleStatic?: boolean;
|
|
122
|
+
backgroundType?: 'color' | 'normal' | 'transparent' | 'vibrant';
|
|
160
123
|
/**
|
|
161
124
|
* Disables default rightClick menu
|
|
162
125
|
*/
|
|
@@ -166,88 +129,125 @@ export interface DesktopifyAppWindow {
|
|
|
166
129
|
*/
|
|
167
130
|
disableContextMenuOpenInWindow: boolean;
|
|
168
131
|
/**
|
|
169
|
-
*
|
|
132
|
+
* Don't allow tabs in window (macOS only)
|
|
170
133
|
*/
|
|
171
|
-
|
|
134
|
+
disableTabs: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* The path to the file to load if `shouldUseFileInsteadOfUrl` is `true`.
|
|
137
|
+
*/
|
|
138
|
+
file?: string;
|
|
172
139
|
/**
|
|
173
140
|
* Configuration options for find in page
|
|
174
141
|
*/
|
|
175
142
|
findInPageOptions?: {
|
|
176
143
|
horizontalPlacement?: {
|
|
177
|
-
type: 'left' | 'default' | 'right';
|
|
178
|
-
left: FindInPagePlacement;
|
|
179
144
|
default: FindInPagePlacement;
|
|
145
|
+
left: FindInPagePlacement;
|
|
180
146
|
right: FindInPagePlacement;
|
|
147
|
+
type: 'default' | 'left' | 'right';
|
|
181
148
|
};
|
|
182
149
|
verticalPlacement?: {
|
|
183
|
-
type: 'top' | 'default' | 'bottom';
|
|
184
|
-
top: FindInPagePlacement;
|
|
185
|
-
default: FindInPagePlacement;
|
|
186
150
|
bottom: FindInPagePlacement;
|
|
151
|
+
default: FindInPagePlacement;
|
|
152
|
+
top: FindInPagePlacement;
|
|
153
|
+
type: 'bottom' | 'default' | 'top';
|
|
187
154
|
};
|
|
188
155
|
};
|
|
189
156
|
/**
|
|
190
|
-
*
|
|
157
|
+
* Does the window have a maximum height. Default is `false`
|
|
191
158
|
*/
|
|
192
|
-
|
|
159
|
+
hasMaxHeight: boolean;
|
|
193
160
|
/**
|
|
194
|
-
*
|
|
161
|
+
* Does the window have a maximum width. Default is `false`
|
|
195
162
|
*/
|
|
196
|
-
|
|
163
|
+
hasMaxWidth: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Does the window have a minimum height. Default is `false`
|
|
166
|
+
*/
|
|
167
|
+
hasMinHeight: boolean;
|
|
197
168
|
/**
|
|
198
169
|
* Does the window have a minimum width. Default is `false`
|
|
199
170
|
*/
|
|
200
171
|
hasMinWidth: boolean;
|
|
201
172
|
/**
|
|
202
|
-
*
|
|
173
|
+
* A unique window id
|
|
203
174
|
*/
|
|
204
|
-
|
|
175
|
+
id: string;
|
|
205
176
|
/**
|
|
206
|
-
*
|
|
177
|
+
* Allows user to `Cmd+F` or `Edit>Find` to search for text on page
|
|
207
178
|
*/
|
|
208
|
-
|
|
179
|
+
isFindInPageEnabled?: boolean;
|
|
209
180
|
/**
|
|
210
|
-
*
|
|
181
|
+
* Whether this is the main window. The main window handles deeplinks
|
|
211
182
|
*/
|
|
212
|
-
|
|
183
|
+
isMain: boolean;
|
|
213
184
|
/**
|
|
214
|
-
*
|
|
185
|
+
* If `true` prevents the native window's title from changing when the document title changes
|
|
215
186
|
*/
|
|
216
|
-
|
|
187
|
+
isTitleStatic?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* The window name. Only visible to developer
|
|
190
|
+
*/
|
|
191
|
+
name: string;
|
|
192
|
+
/**
|
|
193
|
+
* A *mutable* window object id
|
|
194
|
+
*/
|
|
195
|
+
objectId?: string;
|
|
217
196
|
/**
|
|
218
197
|
* BrowserWindow Constructor Options
|
|
219
198
|
*/
|
|
220
|
-
options:
|
|
199
|
+
options: {
|
|
221
200
|
/**
|
|
222
201
|
* Settings of web page's features.
|
|
223
202
|
*/
|
|
224
203
|
webPreferences?: Pick<WebPreferences, whitelistedWebPreferencesOptions>;
|
|
225
|
-
}
|
|
204
|
+
} & Pick<BrowserWindowConstructorOptions, whitelistedBrowserWindowConstructorOptions>;
|
|
205
|
+
/**
|
|
206
|
+
* By default ToDesktop remembers window width & height between sessions.
|
|
207
|
+
* Setting to `true` disables behaviour
|
|
208
|
+
*/
|
|
209
|
+
shouldResetDimensions?: boolean;
|
|
226
210
|
/**
|
|
227
211
|
* The window should load a file instead of a URL.
|
|
228
212
|
* The file property (below) should also be set if the value is `true`.
|
|
229
213
|
*/
|
|
230
214
|
shouldUseFileInsteadOfUrl?: boolean;
|
|
231
215
|
/**
|
|
232
|
-
*
|
|
216
|
+
* Keyboard shortcut to toggle window visibility
|
|
233
217
|
*/
|
|
234
|
-
|
|
218
|
+
toggleVisibilityKeyboardShortcut?: string;
|
|
219
|
+
/**
|
|
220
|
+
* The type of window
|
|
221
|
+
*/
|
|
222
|
+
type: 'app' | 'desktop' | 'menubar' | 'panel';
|
|
223
|
+
/**
|
|
224
|
+
* The window's url
|
|
225
|
+
*/
|
|
226
|
+
url: string;
|
|
227
|
+
/**
|
|
228
|
+
* Inital visibility of window
|
|
229
|
+
*/
|
|
230
|
+
visibility: 'hidden' | 'show-when-contents-loaded' | 'visible';
|
|
231
|
+
/**
|
|
232
|
+
* MacOS option for whether the window should be visible on all workspaces
|
|
233
|
+
*/
|
|
234
|
+
visibleOnAllWorkspaces: boolean;
|
|
235
235
|
}
|
|
236
236
|
export type AutoUpdateConfiguration = {
|
|
237
|
+
autoCheckIntervalMins: number;
|
|
237
238
|
autoUpdater: boolean;
|
|
238
|
-
shouldAutoCheckOnLaunch: boolean;
|
|
239
239
|
shouldAutoCheckInterval: boolean;
|
|
240
|
-
|
|
240
|
+
shouldAutoCheckOnLaunch: boolean;
|
|
241
241
|
updateReadyAction: {
|
|
242
242
|
showInstallAndRestartPrompt: {
|
|
243
|
-
mode: 'always' | '
|
|
244
|
-
options:
|
|
243
|
+
mode: 'always' | 'never' | 'whenInForeground';
|
|
244
|
+
options: {
|
|
245
245
|
installOnNextLaunchButton: string;
|
|
246
246
|
restartAndInstallButton: string;
|
|
247
|
-
}
|
|
247
|
+
} & Omit<MessageBoxOptions, 'buttons'>;
|
|
248
248
|
};
|
|
249
249
|
showNotification: {
|
|
250
|
-
mode: 'always' | '
|
|
250
|
+
mode: 'always' | 'never' | 'whenInBackground';
|
|
251
251
|
options: Omit<NotificationConstructorOptions, 'actions'>;
|
|
252
252
|
};
|
|
253
253
|
};
|
|
@@ -261,65 +261,94 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
261
261
|
* Used as appUserModelId on windows
|
|
262
262
|
*/
|
|
263
263
|
appModelId?: string;
|
|
264
|
+
/**
|
|
265
|
+
* Registers an app protocol. Format should be `{APP_PROTOCOL}://` e.g. `example://`
|
|
266
|
+
*/
|
|
267
|
+
appProtocol: ISwitchableValue<string>;
|
|
268
|
+
/**
|
|
269
|
+
* Sets strings to be used in the app UI. Currently only supports English
|
|
270
|
+
*/
|
|
271
|
+
appStrings?: {
|
|
272
|
+
[key in ValidTranslationKeys]?: {
|
|
273
|
+
[lang in ValidTranslationLanguages]?: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Sets whether the window menu bar should hide itself automatically.
|
|
278
|
+
* Once set the menu bar will only show when users press the single Alt key.
|
|
279
|
+
*/
|
|
280
|
+
autoHideMenuBar?: boolean;
|
|
264
281
|
/**
|
|
265
282
|
* Configure auto updates
|
|
266
283
|
*/
|
|
267
284
|
autoUpdates: AutoUpdateConfiguration;
|
|
268
285
|
/**
|
|
269
|
-
*
|
|
286
|
+
* The locally-bundled app icon.
|
|
270
287
|
*/
|
|
271
|
-
|
|
288
|
+
bundledIcon?: string;
|
|
272
289
|
/**
|
|
273
|
-
*
|
|
290
|
+
* Command line switches
|
|
291
|
+
* Learn more {@link https://www.electronjs.org/docs/api/command-line-switches}
|
|
292
|
+
* @example
|
|
293
|
+
* {
|
|
294
|
+
* 'remote-debugging-port': '8315'
|
|
295
|
+
* }
|
|
274
296
|
*/
|
|
275
|
-
|
|
297
|
+
commandLineSwitches?: {
|
|
298
|
+
[key: string]: string;
|
|
299
|
+
};
|
|
276
300
|
/**
|
|
277
|
-
*
|
|
301
|
+
* The name of the company that the app belongs to
|
|
278
302
|
*/
|
|
279
|
-
|
|
303
|
+
companyName?: string;
|
|
280
304
|
/**
|
|
281
|
-
*
|
|
305
|
+
* URL that crash reports will be POSTed to
|
|
282
306
|
*/
|
|
283
|
-
|
|
307
|
+
crashReporter?: string;
|
|
284
308
|
/**
|
|
285
|
-
*
|
|
309
|
+
* Metadata about plugins that were manually linked into the app
|
|
286
310
|
*/
|
|
287
|
-
|
|
311
|
+
customPlugins?: CustomPlugin[];
|
|
288
312
|
/**
|
|
289
|
-
*
|
|
313
|
+
* Disable devTools on all app windows
|
|
290
314
|
*/
|
|
291
|
-
|
|
315
|
+
disableDevTools: boolean;
|
|
292
316
|
/**
|
|
293
|
-
*
|
|
317
|
+
* Disable error reporting (Sentry)
|
|
294
318
|
*/
|
|
295
|
-
|
|
319
|
+
disableErrorTracking?: boolean;
|
|
296
320
|
/**
|
|
297
|
-
*
|
|
321
|
+
* Enables NEW push notifications — uses `@cuj1559/electron-push-receiver`
|
|
298
322
|
*/
|
|
299
|
-
|
|
300
|
-
windowsIcon?: string;
|
|
301
|
-
windowsIconAssetDetails?: AppIconAssetDetails;
|
|
302
|
-
macOSIcon?: string;
|
|
303
|
-
macOSIconAssetDetails?: AppIconAssetDetails;
|
|
304
|
-
linuxIcon?: string;
|
|
305
|
-
linuxIconAssetDetails?: AppIconAssetDetails;
|
|
323
|
+
enableNewPushNotifications?: boolean;
|
|
306
324
|
/**
|
|
307
|
-
*
|
|
325
|
+
* Enables push notifications — uses `electron-push-receiver`
|
|
308
326
|
*/
|
|
309
|
-
|
|
327
|
+
enablePushNotifications?: boolean;
|
|
310
328
|
/**
|
|
311
|
-
*
|
|
329
|
+
* File assets that get bundled with the app and are available offline
|
|
312
330
|
*/
|
|
313
|
-
|
|
331
|
+
fileAssetDetailsList?: FileAssetDetails[];
|
|
314
332
|
/**
|
|
315
|
-
*
|
|
316
|
-
* Always display the dock icon while the app is open. Even if there are no windows open.
|
|
333
|
+
* Opens `accounts.google.com/o/oauth` in user's default browswer not as internal url
|
|
317
334
|
*/
|
|
318
|
-
|
|
335
|
+
googleOAuthIsExternal?: boolean;
|
|
319
336
|
/**
|
|
320
|
-
*
|
|
337
|
+
* The app icon url
|
|
321
338
|
*/
|
|
322
|
-
|
|
339
|
+
icon?: string;
|
|
340
|
+
/**
|
|
341
|
+
* Details concerning how the app icon should be handled across ToDesktop services
|
|
342
|
+
*/
|
|
343
|
+
iconAssetDetails?: AppIconAssetDetails;
|
|
344
|
+
/**
|
|
345
|
+
* App identifier
|
|
346
|
+
*/
|
|
347
|
+
id: string;
|
|
348
|
+
/**
|
|
349
|
+
* Disables the same-origin policy
|
|
350
|
+
*/
|
|
351
|
+
insecure?: boolean;
|
|
323
352
|
/**
|
|
324
353
|
* Regex patterns for internal app urls
|
|
325
354
|
*/
|
|
@@ -330,29 +359,49 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
330
359
|
*/
|
|
331
360
|
isNativeWindowOpenDisabled?: boolean;
|
|
332
361
|
/**
|
|
333
|
-
*
|
|
362
|
+
* Whether the app is secure i.e. using valid code signing certificates.
|
|
363
|
+
* Note: This value is not persisted in firestore, and is instead written locally at build time.
|
|
364
|
+
* @default false
|
|
334
365
|
*/
|
|
335
|
-
|
|
366
|
+
isSecure?: boolean;
|
|
336
367
|
/**
|
|
337
|
-
*
|
|
368
|
+
* Last todesktop builder version that was used to update the app
|
|
338
369
|
*/
|
|
339
|
-
|
|
370
|
+
lastUsedBuilderVersion?: string;
|
|
340
371
|
/**
|
|
341
|
-
*
|
|
372
|
+
* Last desktopify version that was used to update the app
|
|
342
373
|
*/
|
|
343
|
-
|
|
374
|
+
lastUsedDesktopifyVersion?: string;
|
|
375
|
+
linuxIcon?: string;
|
|
376
|
+
linuxIconAssetDetails?: AppIconAssetDetails;
|
|
377
|
+
macOSIcon?: string;
|
|
378
|
+
macOSIconAssetDetails?: AppIconAssetDetails;
|
|
344
379
|
/**
|
|
345
|
-
*
|
|
380
|
+
* The app's menus
|
|
346
381
|
*/
|
|
347
|
-
|
|
382
|
+
menus: DesktopifyAppMenu[];
|
|
348
383
|
/**
|
|
349
|
-
*
|
|
384
|
+
* The name of the app
|
|
350
385
|
*/
|
|
351
|
-
|
|
386
|
+
name: string;
|
|
352
387
|
/**
|
|
353
|
-
*
|
|
388
|
+
* Sets whether an offline screen will be displayed if the internet is disconnected
|
|
389
|
+
* on initial page load. The color of the re-connect button that is shown is customizable.
|
|
354
390
|
*/
|
|
355
|
-
|
|
391
|
+
offlineScreen?: {
|
|
392
|
+
buttonBackgroundColor: string;
|
|
393
|
+
buttonTextColor: string;
|
|
394
|
+
enabled: boolean;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* An array of plugin modules. Can work with semver specificity
|
|
398
|
+
*/
|
|
399
|
+
plugins?: (Plugin | string)[];
|
|
400
|
+
/**
|
|
401
|
+
* Unused currently
|
|
402
|
+
* @unused
|
|
403
|
+
*/
|
|
404
|
+
pollForAppUpdatesEveryXMinutes?: number;
|
|
356
405
|
/**
|
|
357
406
|
* Runtime environment variables
|
|
358
407
|
*/
|
|
@@ -360,20 +409,27 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
360
409
|
[key: string]: string;
|
|
361
410
|
};
|
|
362
411
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* @example
|
|
366
|
-
* {
|
|
367
|
-
* 'remote-debugging-port': '8315'
|
|
368
|
-
* }
|
|
412
|
+
* This option is only available when `shouldMinimizeToTray` is `true`.
|
|
413
|
+
* Always display the dock icon while the app is open. Even if there are no windows open.
|
|
369
414
|
*/
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
415
|
+
shouldAlwaysDisplayDockIcon?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Whether the app should have full access to Electron APIs
|
|
418
|
+
* @default false
|
|
419
|
+
*/
|
|
420
|
+
shouldHaveFullAccessToElectronAPIs?: boolean;
|
|
373
421
|
/**
|
|
374
422
|
* Launch App at startup
|
|
375
423
|
*/
|
|
376
424
|
shouldLaunchAtStartupByDefault?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Open same domain links in user's default browser
|
|
427
|
+
*/
|
|
428
|
+
shouldMakeSameDomainAnExternalLink?: boolean;
|
|
429
|
+
/**
|
|
430
|
+
* Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
|
|
431
|
+
*/
|
|
432
|
+
shouldMinimizeToTray?: boolean;
|
|
377
433
|
/**
|
|
378
434
|
* If `true` the app will prevent app from opening any protocols that are not
|
|
379
435
|
* already in a maybeAllowList or allowList (see `protocolLists.ts` in desktopify).
|
|
@@ -383,110 +439,58 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
|
|
|
383
439
|
* Disables non-essential logs
|
|
384
440
|
*/
|
|
385
441
|
shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Prevents the window contents from being captured by other apps.
|
|
444
|
+
*/
|
|
445
|
+
shouldProtectContent?: boolean;
|
|
386
446
|
/**
|
|
387
447
|
* Disables electron overrides which ensure renderer process are restarted on each navigation.
|
|
388
448
|
* Learn more {@link https://github.com/electron/electron/issues/18397}
|
|
389
449
|
*/
|
|
390
450
|
shouldReuseRendererProcess?: boolean;
|
|
391
451
|
/**
|
|
392
|
-
*
|
|
393
|
-
*/
|
|
394
|
-
shouldMakeSameDomainAnExternalLink?: boolean;
|
|
395
|
-
/**
|
|
396
|
-
* Enables push notifications — uses `electron-push-receiver`
|
|
397
|
-
*/
|
|
398
|
-
enablePushNotifications?: boolean;
|
|
399
|
-
/**
|
|
400
|
-
* Enables NEW push notifications — uses `@cuj1559/electron-push-receiver`
|
|
452
|
+
* Removes electron from userAgent
|
|
401
453
|
*/
|
|
402
|
-
|
|
454
|
+
shouldUseRealUserAgent?: boolean;
|
|
403
455
|
/**
|
|
404
|
-
*
|
|
456
|
+
* Only allow a single instance of this app to run
|
|
405
457
|
*/
|
|
406
|
-
|
|
458
|
+
singleInstance: boolean;
|
|
407
459
|
/**
|
|
408
460
|
* Sets theme for Electron UI elements and css.
|
|
409
461
|
*
|
|
410
462
|
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
411
463
|
*/
|
|
412
|
-
themeSource?: '
|
|
464
|
+
themeSource?: 'dark' | 'light' | 'system';
|
|
413
465
|
/**
|
|
414
466
|
* Sets theme source for only mac
|
|
415
467
|
*
|
|
416
468
|
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
417
469
|
*/
|
|
418
|
-
themeSourceMac?: '
|
|
419
|
-
/**
|
|
420
|
-
* URL that crash reports will be POSTed to
|
|
421
|
-
*/
|
|
422
|
-
crashReporter?: string;
|
|
423
|
-
/**
|
|
424
|
-
* Unused currently
|
|
425
|
-
* @unused
|
|
426
|
-
*/
|
|
427
|
-
pollForAppUpdatesEveryXMinutes?: number;
|
|
428
|
-
/**
|
|
429
|
-
* An array of plugin modules. Can work with semver specificity
|
|
430
|
-
*/
|
|
431
|
-
plugins?: (Plugin | string)[];
|
|
432
|
-
/**
|
|
433
|
-
* The app's windows
|
|
434
|
-
*/
|
|
435
|
-
windows: DesktopifyAppWindow[];
|
|
470
|
+
themeSourceMac?: 'dark' | 'light' | 'system';
|
|
436
471
|
/**
|
|
437
472
|
* The app's trays
|
|
438
473
|
*/
|
|
439
474
|
trays: DesktopifyAppTray[];
|
|
440
475
|
/**
|
|
441
|
-
*
|
|
476
|
+
* Specifys the app's user agent
|
|
442
477
|
*/
|
|
443
|
-
|
|
478
|
+
userAgent: ISwitchableValue<string>;
|
|
444
479
|
/**
|
|
445
480
|
* Prevents a potential vulnerability in URL matching in Electron
|
|
446
481
|
* https://linear.app/todesktop/issue/TD-1428/html-injection-due-to-regular-expression-bypass
|
|
447
482
|
*/
|
|
448
483
|
useSafeInternalUrlMatcher?: boolean;
|
|
449
484
|
/**
|
|
450
|
-
*
|
|
451
|
-
* Once set the menu bar will only show when users press the single Alt key.
|
|
452
|
-
*/
|
|
453
|
-
autoHideMenuBar?: boolean;
|
|
454
|
-
/**
|
|
455
|
-
* Sets whether an offline screen will be displayed if the internet is disconnected
|
|
456
|
-
* on initial page load. The color of the re-connect button that is shown is customizable.
|
|
457
|
-
*/
|
|
458
|
-
offlineScreen?: {
|
|
459
|
-
enabled: boolean;
|
|
460
|
-
buttonBackgroundColor: string;
|
|
461
|
-
buttonTextColor: string;
|
|
462
|
-
};
|
|
463
|
-
/**
|
|
464
|
-
* Sets strings to be used in the app UI. Currently only supports English
|
|
465
|
-
*/
|
|
466
|
-
appStrings?: {
|
|
467
|
-
[key in ValidTranslationKeys]?: {
|
|
468
|
-
[lang in ValidTranslationLanguages]?: string;
|
|
469
|
-
};
|
|
470
|
-
};
|
|
471
|
-
/**
|
|
472
|
-
* File assets that get bundled with the app and are available offline
|
|
473
|
-
*/
|
|
474
|
-
fileAssetDetailsList?: FileAssetDetails[];
|
|
475
|
-
/**
|
|
476
|
-
* Whether the app should have full access to Electron APIs
|
|
477
|
-
* @default false
|
|
478
|
-
*/
|
|
479
|
-
shouldHaveFullAccessToElectronAPIs?: boolean;
|
|
480
|
-
/**
|
|
481
|
-
* Whether the app is secure i.e. using valid code signing certificates.
|
|
482
|
-
* Note: This value is not persisted in firestore, and is instead written locally at build time.
|
|
483
|
-
* @default false
|
|
485
|
+
* Instead of using one icon for every platform, use a separate icon for different platforms
|
|
484
486
|
*/
|
|
485
|
-
|
|
487
|
+
useSeparateIcons?: boolean;
|
|
486
488
|
/**
|
|
487
|
-
*
|
|
489
|
+
* The app's windows
|
|
488
490
|
*/
|
|
489
|
-
|
|
491
|
+
windows: DesktopifyAppWindow[];
|
|
492
|
+
windowsIcon?: string;
|
|
493
|
+
windowsIconAssetDetails?: AppIconAssetDetails;
|
|
490
494
|
}
|
|
491
495
|
export type FindInPagePlacement = {
|
|
492
496
|
offset: number;
|