@todesktop/shared 7.53.0 → 7.54.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 +28 -5
- package/package.json +3 -2
- package/src/desktopify.ts +42 -5
package/lib/desktopify.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IApp } from "./toDesktop";
|
|
3
3
|
import { Configuration, PackagerOptions, PublishOptions } from "app-builder-lib";
|
|
4
|
-
import { MenuItemConstructorOptions } from "@todesktop/client-electron-types";
|
|
4
|
+
import { MenuItemConstructorOptions, BrowserWindowConstructorOptions } from "@todesktop/client-electron-types";
|
|
5
5
|
declare type appBuilderLib = PackagerOptions & PublishOptions;
|
|
6
6
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
7
7
|
config: Configuration;
|
|
@@ -139,7 +139,7 @@ export declare const isPlatformBuildRunning: (platformBuild: PlatformBuild) => b
|
|
|
139
139
|
export declare const isCiBuildRunning: (build: Build) => boolean;
|
|
140
140
|
export declare const isBuildRunning: (build: Build) => boolean;
|
|
141
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";
|
|
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
143
|
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions, "role" | "submenu"> {
|
|
144
144
|
platforms?: NodeJS.Platform[];
|
|
145
145
|
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
@@ -150,18 +150,40 @@ export interface DesktopifyAppWindow {
|
|
|
150
150
|
name: string;
|
|
151
151
|
url: string;
|
|
152
152
|
fullScreen: boolean;
|
|
153
|
+
height: number;
|
|
153
154
|
minHeight?: number;
|
|
154
|
-
minWidth?: number;
|
|
155
155
|
maxHeight?: number;
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
hasMinHeight?: boolean;
|
|
157
|
+
hasMaxHeight?: boolean;
|
|
158
158
|
width: number;
|
|
159
|
+
minWidth?: number;
|
|
160
|
+
maxWidth?: number;
|
|
161
|
+
hasMinWidth?: boolean;
|
|
162
|
+
hasMaxWidth?: boolean;
|
|
159
163
|
isResizable: boolean;
|
|
160
164
|
titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover";
|
|
161
165
|
alwaysOnTop: boolean;
|
|
162
166
|
visibility: "visible" | "hidden" | "show-when-contents-loaded";
|
|
163
167
|
isMain: boolean;
|
|
164
168
|
applicationMenu: DesktopifyMenuItemConstructorOptions[];
|
|
169
|
+
type: "menubar" | "app";
|
|
170
|
+
transparentTitlebar: boolean;
|
|
171
|
+
shouldResetDimensions?: boolean;
|
|
172
|
+
vibrancy?: BrowserWindowConstructorOptions["vibrancy"];
|
|
173
|
+
}
|
|
174
|
+
export declare type DesktopifyAppTrayToggleWindowAction = {
|
|
175
|
+
role: "toggleWindow";
|
|
176
|
+
windowId: string;
|
|
177
|
+
};
|
|
178
|
+
export declare type DesktopifyAppTrayToggleMenuAction = {
|
|
179
|
+
role: "toggleMenu";
|
|
180
|
+
menu: DesktopifyMenuItemConstructorOptions[];
|
|
181
|
+
};
|
|
182
|
+
export declare type DesktopifyAppTrayAction = DesktopifyAppTrayToggleMenuAction | DesktopifyAppTrayToggleWindowAction;
|
|
183
|
+
export interface DesktopifyAppTray {
|
|
184
|
+
icon: string;
|
|
185
|
+
rightClick?: DesktopifyAppTrayAction;
|
|
186
|
+
leftClick?: DesktopifyAppTrayAction;
|
|
165
187
|
}
|
|
166
188
|
export interface DesktopifyApp {
|
|
167
189
|
name: string;
|
|
@@ -210,5 +232,6 @@ export interface DesktopifyApp {
|
|
|
210
232
|
}
|
|
211
233
|
export interface DesktopifyApp2 extends DesktopifyApp {
|
|
212
234
|
windows: DesktopifyAppWindow[];
|
|
235
|
+
trays: DesktopifyAppTray[];
|
|
213
236
|
}
|
|
214
237
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todesktop/shared",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.54.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -8,7 +8,8 @@
|
|
|
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",
|
package/src/desktopify.ts
CHANGED
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
PackagerOptions,
|
|
5
5
|
PublishOptions,
|
|
6
6
|
} from "app-builder-lib";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
MenuItemConstructorOptions,
|
|
9
|
+
BrowserWindowConstructorOptions,
|
|
10
|
+
} from "@todesktop/client-electron-types";
|
|
8
11
|
|
|
9
12
|
type appBuilderLib = PackagerOptions & PublishOptions;
|
|
10
13
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
@@ -260,7 +263,9 @@ type todesktopRoles =
|
|
|
260
263
|
| "todesktop:check-for-updates"
|
|
261
264
|
| "todesktop:history-home"
|
|
262
265
|
| "todesktop:history-back"
|
|
263
|
-
| "todesktop:history-forward"
|
|
266
|
+
| "todesktop:history-forward"
|
|
267
|
+
| "todesktop:show-window"
|
|
268
|
+
| "todesktop:hide-window";
|
|
264
269
|
|
|
265
270
|
let s: MenuItemConstructorOptions;
|
|
266
271
|
|
|
@@ -276,18 +281,49 @@ export interface DesktopifyAppWindow {
|
|
|
276
281
|
name: string;
|
|
277
282
|
url: string;
|
|
278
283
|
fullScreen: boolean;
|
|
284
|
+
|
|
285
|
+
height: number;
|
|
279
286
|
minHeight?: number;
|
|
280
|
-
minWidth?: number;
|
|
281
287
|
maxHeight?: number;
|
|
282
|
-
|
|
283
|
-
|
|
288
|
+
hasMinHeight?: boolean;
|
|
289
|
+
hasMaxHeight?: boolean;
|
|
290
|
+
|
|
284
291
|
width: number;
|
|
292
|
+
minWidth?: number;
|
|
293
|
+
maxWidth?: number;
|
|
294
|
+
hasMinWidth?: boolean;
|
|
295
|
+
hasMaxWidth?: boolean;
|
|
296
|
+
|
|
285
297
|
isResizable: boolean;
|
|
286
298
|
titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover";
|
|
287
299
|
alwaysOnTop: boolean;
|
|
288
300
|
visibility: "visible" | "hidden" | "show-when-contents-loaded";
|
|
289
301
|
isMain: boolean;
|
|
290
302
|
applicationMenu: DesktopifyMenuItemConstructorOptions[];
|
|
303
|
+
type: "menubar" | "app";
|
|
304
|
+
transparentTitlebar: boolean;
|
|
305
|
+
shouldResetDimensions?: boolean;
|
|
306
|
+
vibrancy?: BrowserWindowConstructorOptions["vibrancy"];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type DesktopifyAppTrayToggleWindowAction = {
|
|
310
|
+
role: "toggleWindow";
|
|
311
|
+
windowId: string;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export type DesktopifyAppTrayToggleMenuAction = {
|
|
315
|
+
role: "toggleMenu";
|
|
316
|
+
menu: DesktopifyMenuItemConstructorOptions[];
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export type DesktopifyAppTrayAction =
|
|
320
|
+
| DesktopifyAppTrayToggleMenuAction
|
|
321
|
+
| DesktopifyAppTrayToggleWindowAction;
|
|
322
|
+
|
|
323
|
+
export interface DesktopifyAppTray {
|
|
324
|
+
icon: string;
|
|
325
|
+
rightClick?: DesktopifyAppTrayAction;
|
|
326
|
+
leftClick?: DesktopifyAppTrayAction;
|
|
291
327
|
}
|
|
292
328
|
|
|
293
329
|
export interface DesktopifyApp {
|
|
@@ -338,4 +374,5 @@ export interface DesktopifyApp {
|
|
|
338
374
|
|
|
339
375
|
export interface DesktopifyApp2 extends DesktopifyApp {
|
|
340
376
|
windows: DesktopifyAppWindow[];
|
|
377
|
+
trays: DesktopifyAppTray[];
|
|
341
378
|
}
|