@todesktop/shared 7.51.0 → 7.55.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/lib/desktopify.d.ts +36 -3
- package/lib/desktopify.js +1 -0
- package/package.json +4 -2
- package/src/desktopify.ts +66 -6
package/lib/desktopify.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { IApp } from "./toDesktop";
|
|
2
3
|
import { Configuration, PackagerOptions, PublishOptions } from "app-builder-lib";
|
|
4
|
+
import { MenuItemConstructorOptions, BrowserWindowConstructorOptions } from "@todesktop/client-electron-types";
|
|
3
5
|
declare type appBuilderLib = PackagerOptions & PublishOptions;
|
|
4
6
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
5
7
|
config: Configuration;
|
|
@@ -137,22 +139,52 @@ export declare const isPlatformBuildRunning: (platformBuild: PlatformBuild) => b
|
|
|
137
139
|
export declare const isCiBuildRunning: (build: Build) => boolean;
|
|
138
140
|
export declare const isBuildRunning: (build: Build) => boolean;
|
|
139
141
|
export declare const isBuildCancellable: (build: Build) => boolean;
|
|
142
|
+
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";
|
|
143
|
+
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions, "role" | "submenu"> {
|
|
144
|
+
platforms?: NodeJS.Platform[];
|
|
145
|
+
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
146
|
+
role?: MenuItemConstructorOptions["role"] | todesktopRoles;
|
|
147
|
+
}
|
|
140
148
|
export interface DesktopifyAppWindow {
|
|
141
149
|
id: string;
|
|
142
150
|
name: string;
|
|
143
151
|
url: string;
|
|
144
152
|
fullScreen: boolean;
|
|
153
|
+
height: number;
|
|
145
154
|
minHeight?: number;
|
|
146
|
-
minWidth?: number;
|
|
147
155
|
maxHeight?: number;
|
|
148
|
-
|
|
149
|
-
|
|
156
|
+
hasMinHeight?: boolean;
|
|
157
|
+
hasMaxHeight?: boolean;
|
|
150
158
|
width: number;
|
|
159
|
+
minWidth?: number;
|
|
160
|
+
maxWidth?: number;
|
|
161
|
+
hasMinWidth?: boolean;
|
|
162
|
+
hasMaxWidth?: boolean;
|
|
151
163
|
isResizable: boolean;
|
|
152
164
|
titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover";
|
|
153
165
|
alwaysOnTop: boolean;
|
|
154
166
|
visibility: "visible" | "hidden" | "show-when-contents-loaded";
|
|
155
167
|
isMain: boolean;
|
|
168
|
+
applicationMenu: DesktopifyMenuItemConstructorOptions[];
|
|
169
|
+
type: "menubar" | "app";
|
|
170
|
+
transparentTitlebar: boolean;
|
|
171
|
+
shouldResetDimensions?: boolean;
|
|
172
|
+
vibrancy?: BrowserWindowConstructorOptions["vibrancy"];
|
|
173
|
+
toggleVisibilityKeyboardShortcut?: string;
|
|
174
|
+
}
|
|
175
|
+
export declare type DesktopifyAppTrayToggleWindowAction = {
|
|
176
|
+
role: "toggleWindow";
|
|
177
|
+
windowId: string;
|
|
178
|
+
};
|
|
179
|
+
export declare type DesktopifyAppTrayToggleMenuAction = {
|
|
180
|
+
role: "toggleMenu";
|
|
181
|
+
menu: DesktopifyMenuItemConstructorOptions[];
|
|
182
|
+
};
|
|
183
|
+
export declare type DesktopifyAppTrayAction = DesktopifyAppTrayToggleMenuAction | DesktopifyAppTrayToggleWindowAction;
|
|
184
|
+
export interface DesktopifyAppTray {
|
|
185
|
+
icon: string;
|
|
186
|
+
rightClick?: DesktopifyAppTrayAction;
|
|
187
|
+
leftClick?: DesktopifyAppTrayAction;
|
|
156
188
|
}
|
|
157
189
|
export interface DesktopifyApp {
|
|
158
190
|
name: string;
|
|
@@ -201,5 +233,6 @@ export interface DesktopifyApp {
|
|
|
201
233
|
}
|
|
202
234
|
export interface DesktopifyApp2 extends DesktopifyApp {
|
|
203
235
|
windows: DesktopifyAppWindow[];
|
|
236
|
+
trays: DesktopifyAppTray[];
|
|
204
237
|
}
|
|
205
238
|
export {};
|
package/lib/desktopify.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todesktop/shared",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.55.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"build": "rm -f ./lib/* && tsc",
|
|
10
10
|
"prepublishOnly": "npm run build",
|
|
11
|
-
"bump": "npm version minor && git push && npm publish"
|
|
11
|
+
"bump": "npm version minor && git push && npm publish",
|
|
12
|
+
"dev": "tsc"
|
|
12
13
|
},
|
|
13
14
|
"author": "Dave Jeffery <dave@davejeffery.com>",
|
|
14
15
|
"license": "UNLICENSED",
|
|
15
16
|
"dependencies": {
|
|
17
|
+
"@todesktop/client-electron-types": "^0.1.0",
|
|
16
18
|
"@types/debug": "^4.1.1",
|
|
17
19
|
"@types/node": "^13.11.1",
|
|
18
20
|
"@types/yup": "^0.26.9",
|
package/src/desktopify.ts
CHANGED
|
@@ -4,6 +4,10 @@ import {
|
|
|
4
4
|
PackagerOptions,
|
|
5
5
|
PublishOptions,
|
|
6
6
|
} from "app-builder-lib";
|
|
7
|
+
import {
|
|
8
|
+
MenuItemConstructorOptions,
|
|
9
|
+
BrowserWindowConstructorOptions,
|
|
10
|
+
} from "@todesktop/client-electron-types";
|
|
7
11
|
|
|
8
12
|
type appBuilderLib = PackagerOptions & PublishOptions;
|
|
9
13
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
@@ -250,22 +254,77 @@ export const isBuildRunning = (build: Build): boolean => {
|
|
|
250
254
|
export const isBuildCancellable = (build: Build): boolean =>
|
|
251
255
|
hasBuildKickedOff(build) && isBuildRunning(build);
|
|
252
256
|
|
|
257
|
+
type todesktopRoles =
|
|
258
|
+
| "todesktop:launch-at-startup"
|
|
259
|
+
| "todesktop:check-for-updates"
|
|
260
|
+
| "todesktop:quit"
|
|
261
|
+
| "todesktop:new-window"
|
|
262
|
+
| "todesktop:new-tab"
|
|
263
|
+
| "todesktop:check-for-updates"
|
|
264
|
+
| "todesktop:history-home"
|
|
265
|
+
| "todesktop:history-back"
|
|
266
|
+
| "todesktop:history-forward"
|
|
267
|
+
| "todesktop:show-window"
|
|
268
|
+
| "todesktop:hide-window";
|
|
269
|
+
|
|
270
|
+
let s: MenuItemConstructorOptions;
|
|
271
|
+
|
|
272
|
+
export interface DesktopifyMenuItemConstructorOptions
|
|
273
|
+
extends Omit<MenuItemConstructorOptions, "role" | "submenu"> {
|
|
274
|
+
platforms?: NodeJS.Platform[];
|
|
275
|
+
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
276
|
+
role?: MenuItemConstructorOptions["role"] | todesktopRoles;
|
|
277
|
+
}
|
|
278
|
+
|
|
253
279
|
export interface DesktopifyAppWindow {
|
|
254
280
|
id: string;
|
|
255
281
|
name: string;
|
|
256
282
|
url: string;
|
|
257
283
|
fullScreen: boolean;
|
|
258
|
-
|
|
259
|
-
minWidth?: number;
|
|
260
|
-
maxHeight?: number;
|
|
261
|
-
maxWidth?: number;
|
|
284
|
+
|
|
262
285
|
height: number;
|
|
286
|
+
minHeight?: number;
|
|
287
|
+
maxHeight?: number;
|
|
288
|
+
hasMinHeight?: boolean;
|
|
289
|
+
hasMaxHeight?: boolean;
|
|
290
|
+
|
|
263
291
|
width: number;
|
|
292
|
+
minWidth?: number;
|
|
293
|
+
maxWidth?: number;
|
|
294
|
+
hasMinWidth?: boolean;
|
|
295
|
+
hasMaxWidth?: boolean;
|
|
296
|
+
|
|
264
297
|
isResizable: boolean;
|
|
265
298
|
titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover";
|
|
266
299
|
alwaysOnTop: boolean;
|
|
267
300
|
visibility: "visible" | "hidden" | "show-when-contents-loaded";
|
|
268
301
|
isMain: boolean;
|
|
302
|
+
applicationMenu: DesktopifyMenuItemConstructorOptions[];
|
|
303
|
+
type: "menubar" | "app";
|
|
304
|
+
transparentTitlebar: boolean;
|
|
305
|
+
shouldResetDimensions?: boolean;
|
|
306
|
+
vibrancy?: BrowserWindowConstructorOptions["vibrancy"];
|
|
307
|
+
toggleVisibilityKeyboardShortcut?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export type DesktopifyAppTrayToggleWindowAction = {
|
|
311
|
+
role: "toggleWindow";
|
|
312
|
+
windowId: string;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
export type DesktopifyAppTrayToggleMenuAction = {
|
|
316
|
+
role: "toggleMenu";
|
|
317
|
+
menu: DesktopifyMenuItemConstructorOptions[];
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
export type DesktopifyAppTrayAction =
|
|
321
|
+
| DesktopifyAppTrayToggleMenuAction
|
|
322
|
+
| DesktopifyAppTrayToggleWindowAction;
|
|
323
|
+
|
|
324
|
+
export interface DesktopifyAppTray {
|
|
325
|
+
icon: string;
|
|
326
|
+
rightClick?: DesktopifyAppTrayAction;
|
|
327
|
+
leftClick?: DesktopifyAppTrayAction;
|
|
269
328
|
}
|
|
270
329
|
|
|
271
330
|
export interface DesktopifyApp {
|
|
@@ -281,7 +340,7 @@ export interface DesktopifyApp {
|
|
|
281
340
|
minHeight?: number; // remove
|
|
282
341
|
minWidth?: number; // remove
|
|
283
342
|
maxHeight?: number; // remove
|
|
284
|
-
maxWidth?: number; // remove
|
|
343
|
+
maxWidth?: number; // remove
|
|
285
344
|
singleInstance: boolean;
|
|
286
345
|
disableContextMenu: boolean;
|
|
287
346
|
titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover"; // remove
|
|
@@ -316,4 +375,5 @@ export interface DesktopifyApp {
|
|
|
316
375
|
|
|
317
376
|
export interface DesktopifyApp2 extends DesktopifyApp {
|
|
318
377
|
windows: DesktopifyAppWindow[];
|
|
319
|
-
|
|
378
|
+
trays: DesktopifyAppTray[];
|
|
379
|
+
}
|