@todesktop/shared 7.184.4 → 7.184.6
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/lib/desktopify2.d.ts +4 -4
- package/lib/validations.js +1 -0
- package/package.json +1 -1
- package/src/desktopify2.ts +4 -3
- package/src/validations.ts +5 -0
package/lib/desktopify2.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare type AssetDetails = AppIconAssetDetails | MenuIconAssetDetails |
|
|
|
31
31
|
/**
|
|
32
32
|
* Custom ToDesktop Roles for Application & Tray Menus
|
|
33
33
|
*/
|
|
34
|
-
declare type todesktopRoles = "todesktop:launch-at-startup" | "todesktop:check-for-updates" | "todesktop:quit" | "todesktop:new-window" | "todesktop:new-tab" | "todesktop:check-for-updates" | "todesktop:history-home" | "todesktop:history-back" | "todesktop:history-forward" | "todesktop:show-window" | "todesktop:hide-window" | "todesktop:toggle-window" | "todesktop:toggle-window0" | "todesktop:toggle-window1" | "todesktop:toggle-window2" | "todesktop:toggle-window3" | "todesktop:toggle-window4";
|
|
34
|
+
declare type todesktopRoles = "todesktop:launch-at-startup" | "todesktop:check-for-updates" | "todesktop:quit" | "todesktop:quit-completely" | "todesktop:new-window" | "todesktop:new-tab" | "todesktop:check-for-updates" | "todesktop:history-home" | "todesktop:history-back" | "todesktop:history-forward" | "todesktop:show-window" | "todesktop:hide-window" | "todesktop:toggle-window" | "todesktop:toggle-window0" | "todesktop:toggle-window1" | "todesktop:toggle-window2" | "todesktop:toggle-window3" | "todesktop:toggle-window4";
|
|
35
35
|
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions, "role" | "submenu"> {
|
|
36
36
|
platforms?: NodeJS.Platform[];
|
|
37
37
|
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
@@ -95,14 +95,14 @@ export declare type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
|
|
|
95
95
|
* when the window is created
|
|
96
96
|
*/
|
|
97
97
|
export declare const allowedBrowserWindowConstructorOptions: Readonly<(keyof BrowserWindowConstructorOptions)[]>;
|
|
98
|
-
export declare type whitelistedBrowserWindowConstructorOptions = typeof allowedBrowserWindowConstructorOptions[number];
|
|
98
|
+
export declare type whitelistedBrowserWindowConstructorOptions = (typeof allowedBrowserWindowConstructorOptions)[number];
|
|
99
99
|
/**
|
|
100
100
|
* Whitelist of allowed DesktopifyWindow Web Preferences Options.
|
|
101
101
|
* These attrs (if set) are passed to the webPreferences object in the `BrowserWindow` constructor
|
|
102
102
|
* when the window is created
|
|
103
103
|
*/
|
|
104
104
|
export declare const allowedWebPreferencesOptions: Readonly<(keyof WebPreferences)[]>;
|
|
105
|
-
export declare type whitelistedWebPreferencesOptions = typeof allowedWebPreferencesOptions[number];
|
|
105
|
+
export declare type whitelistedWebPreferencesOptions = (typeof allowedWebPreferencesOptions)[number];
|
|
106
106
|
/**
|
|
107
107
|
* Interface for ToDesktop App Windows
|
|
108
108
|
*/
|
|
@@ -391,7 +391,7 @@ export interface DesktopifyApp2 {
|
|
|
391
391
|
/**
|
|
392
392
|
* Whether the app should have full access to Electron APIs
|
|
393
393
|
* @default false
|
|
394
|
-
|
|
394
|
+
*/
|
|
395
395
|
shouldHaveFullAccessToElectronAPIs?: boolean;
|
|
396
396
|
}
|
|
397
397
|
export interface IApp2 extends BaseApp {
|
package/lib/validations.js
CHANGED
|
@@ -83,6 +83,7 @@ exports.appProtocolValidation = yup
|
|
|
83
83
|
.required()
|
|
84
84
|
.label("App Protocol")
|
|
85
85
|
.test("ends-with-protocol", "Protocols must end with `://`", (value) => value.endsWith("://"))
|
|
86
|
+
.test("is-lowercase", "Protocols must be lowercase", (value) => value === value.toLowerCase())
|
|
86
87
|
.matches(/^[a-zA-Z\-]+\:\/\/$/, "Protocols contain letters and dashes (-) only")
|
|
87
88
|
.min(5);
|
|
88
89
|
exports.appConfigValidation = yup.object({
|
package/package.json
CHANGED
package/src/desktopify2.ts
CHANGED
|
@@ -49,6 +49,7 @@ type todesktopRoles =
|
|
|
49
49
|
| "todesktop:launch-at-startup"
|
|
50
50
|
| "todesktop:check-for-updates"
|
|
51
51
|
| "todesktop:quit"
|
|
52
|
+
| "todesktop:quit-completely"
|
|
52
53
|
| "todesktop:new-window"
|
|
53
54
|
| "todesktop:new-tab"
|
|
54
55
|
| "todesktop:check-for-updates"
|
|
@@ -188,7 +189,7 @@ export const allowedBrowserWindowConstructorOptions: Readonly<
|
|
|
188
189
|
|
|
189
190
|
// Make type from all numbered index values
|
|
190
191
|
export type whitelistedBrowserWindowConstructorOptions =
|
|
191
|
-
typeof allowedBrowserWindowConstructorOptions[number];
|
|
192
|
+
(typeof allowedBrowserWindowConstructorOptions)[number];
|
|
192
193
|
|
|
193
194
|
/**
|
|
194
195
|
* Whitelist of allowed DesktopifyWindow Web Preferences Options.
|
|
@@ -219,7 +220,7 @@ export const allowedWebPreferencesOptions: Readonly<(keyof WebPreferences)[]> =
|
|
|
219
220
|
|
|
220
221
|
// Make type from all numbered index values
|
|
221
222
|
export type whitelistedWebPreferencesOptions =
|
|
222
|
-
typeof allowedWebPreferencesOptions[number];
|
|
223
|
+
(typeof allowedWebPreferencesOptions)[number];
|
|
223
224
|
|
|
224
225
|
/**
|
|
225
226
|
* Interface for ToDesktop App Windows
|
|
@@ -517,7 +518,7 @@ export interface DesktopifyApp2 {
|
|
|
517
518
|
/**
|
|
518
519
|
* Whether the app should have full access to Electron APIs
|
|
519
520
|
* @default false
|
|
520
|
-
|
|
521
|
+
*/
|
|
521
522
|
shouldHaveFullAccessToElectronAPIs?: boolean;
|
|
522
523
|
}
|
|
523
524
|
|
package/src/validations.ts
CHANGED
|
@@ -117,6 +117,11 @@ export const appProtocolValidation = yup
|
|
|
117
117
|
"Protocols must end with `://`",
|
|
118
118
|
(value: string) => value.endsWith("://")
|
|
119
119
|
)
|
|
120
|
+
.test(
|
|
121
|
+
"is-lowercase",
|
|
122
|
+
"Protocols must be lowercase",
|
|
123
|
+
(value) => value === value.toLowerCase()
|
|
124
|
+
)
|
|
120
125
|
.matches(
|
|
121
126
|
/^[a-zA-Z\-]+\:\/\/$/,
|
|
122
127
|
"Protocols contain letters and dashes (-) only"
|