@todesktop/shared 7.51.0 → 7.53.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 +9 -0
- package/lib/desktopify.js +1 -0
- package/package.json +2 -1
- package/src/desktopify.ts +27 -5
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 } from "@todesktop/client-electron-types";
|
|
3
5
|
declare type appBuilderLib = PackagerOptions & PublishOptions;
|
|
4
6
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
5
7
|
config: Configuration;
|
|
@@ -137,6 +139,12 @@ 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";
|
|
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;
|
|
@@ -153,6 +161,7 @@ export interface DesktopifyAppWindow {
|
|
|
153
161
|
alwaysOnTop: boolean;
|
|
154
162
|
visibility: "visible" | "hidden" | "show-when-contents-loaded";
|
|
155
163
|
isMain: boolean;
|
|
164
|
+
applicationMenu: DesktopifyMenuItemConstructorOptions[];
|
|
156
165
|
}
|
|
157
166
|
export interface DesktopifyApp {
|
|
158
167
|
name: string;
|
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.53.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"author": "Dave Jeffery <dave@davejeffery.com>",
|
|
14
14
|
"license": "UNLICENSED",
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@todesktop/client-electron-types": "^0.1.0",
|
|
16
17
|
"@types/debug": "^4.1.1",
|
|
17
18
|
"@types/node": "^13.11.1",
|
|
18
19
|
"@types/yup": "^0.26.9",
|
package/src/desktopify.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
PackagerOptions,
|
|
5
5
|
PublishOptions,
|
|
6
6
|
} from "app-builder-lib";
|
|
7
|
+
import { MenuItemConstructorOptions } from "@todesktop/client-electron-types";
|
|
7
8
|
|
|
8
9
|
type appBuilderLib = PackagerOptions & PublishOptions;
|
|
9
10
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
@@ -250,14 +251,34 @@ export const isBuildRunning = (build: Build): boolean => {
|
|
|
250
251
|
export const isBuildCancellable = (build: Build): boolean =>
|
|
251
252
|
hasBuildKickedOff(build) && isBuildRunning(build);
|
|
252
253
|
|
|
254
|
+
type todesktopRoles =
|
|
255
|
+
| "todesktop:launch-at-startup"
|
|
256
|
+
| "todesktop:check-for-updates"
|
|
257
|
+
| "todesktop:quit"
|
|
258
|
+
| "todesktop:new-window"
|
|
259
|
+
| "todesktop:new-tab"
|
|
260
|
+
| "todesktop:check-for-updates"
|
|
261
|
+
| "todesktop:history-home"
|
|
262
|
+
| "todesktop:history-back"
|
|
263
|
+
| "todesktop:history-forward";
|
|
264
|
+
|
|
265
|
+
let s: MenuItemConstructorOptions;
|
|
266
|
+
|
|
267
|
+
export interface DesktopifyMenuItemConstructorOptions
|
|
268
|
+
extends Omit<MenuItemConstructorOptions, "role" | "submenu"> {
|
|
269
|
+
platforms?: NodeJS.Platform[];
|
|
270
|
+
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
271
|
+
role?: MenuItemConstructorOptions["role"] | todesktopRoles;
|
|
272
|
+
}
|
|
273
|
+
|
|
253
274
|
export interface DesktopifyAppWindow {
|
|
254
275
|
id: string;
|
|
255
276
|
name: string;
|
|
256
277
|
url: string;
|
|
257
278
|
fullScreen: boolean;
|
|
258
|
-
minHeight?: number;
|
|
259
|
-
minWidth?: number;
|
|
260
|
-
maxHeight?: number;
|
|
279
|
+
minHeight?: number;
|
|
280
|
+
minWidth?: number;
|
|
281
|
+
maxHeight?: number;
|
|
261
282
|
maxWidth?: number;
|
|
262
283
|
height: number;
|
|
263
284
|
width: number;
|
|
@@ -266,6 +287,7 @@ export interface DesktopifyAppWindow {
|
|
|
266
287
|
alwaysOnTop: boolean;
|
|
267
288
|
visibility: "visible" | "hidden" | "show-when-contents-loaded";
|
|
268
289
|
isMain: boolean;
|
|
290
|
+
applicationMenu: DesktopifyMenuItemConstructorOptions[];
|
|
269
291
|
}
|
|
270
292
|
|
|
271
293
|
export interface DesktopifyApp {
|
|
@@ -281,7 +303,7 @@ export interface DesktopifyApp {
|
|
|
281
303
|
minHeight?: number; // remove
|
|
282
304
|
minWidth?: number; // remove
|
|
283
305
|
maxHeight?: number; // remove
|
|
284
|
-
maxWidth?: number; // remove
|
|
306
|
+
maxWidth?: number; // remove
|
|
285
307
|
singleInstance: boolean;
|
|
286
308
|
disableContextMenu: boolean;
|
|
287
309
|
titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover"; // remove
|
|
@@ -316,4 +338,4 @@ export interface DesktopifyApp {
|
|
|
316
338
|
|
|
317
339
|
export interface DesktopifyApp2 extends DesktopifyApp {
|
|
318
340
|
windows: DesktopifyAppWindow[];
|
|
319
|
-
}
|
|
341
|
+
}
|