@todesktop/shared 7.49.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.
@@ -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,30 @@ 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
+ }
148
+ export interface DesktopifyAppWindow {
149
+ id: string;
150
+ name: string;
151
+ url: string;
152
+ fullScreen: boolean;
153
+ minHeight?: number;
154
+ minWidth?: number;
155
+ maxHeight?: number;
156
+ maxWidth?: number;
157
+ height: number;
158
+ width: number;
159
+ isResizable: boolean;
160
+ titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover";
161
+ alwaysOnTop: boolean;
162
+ visibility: "visible" | "hidden" | "show-when-contents-loaded";
163
+ isMain: boolean;
164
+ applicationMenu: DesktopifyMenuItemConstructorOptions[];
165
+ }
140
166
  export interface DesktopifyApp {
141
167
  name: string;
142
168
  targetUrl: string;
@@ -182,4 +208,7 @@ export interface DesktopifyApp {
182
208
  companyName?: string;
183
209
  pollForAppUpdatesEveryXMinutes?: number;
184
210
  }
211
+ export interface DesktopifyApp2 extends DesktopifyApp {
212
+ windows: DesktopifyAppWindow[];
213
+ }
185
214
  export {};
package/lib/desktopify.js CHANGED
@@ -59,3 +59,4 @@ exports.isBuildRunning = (build) => {
59
59
  ["linux", "mac", "windows"].some((platform) => exports.isPlatformBuildRunning(build[platform])));
60
60
  };
61
61
  exports.isBuildCancellable = (build) => exports.hasBuildKickedOff(build) && exports.isBuildRunning(build);
62
+ let s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.49.0",
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,24 +251,63 @@ export const isBuildRunning = (build: Build): boolean => {
250
251
  export const isBuildCancellable = (build: Build): boolean =>
251
252
  hasBuildKickedOff(build) && isBuildRunning(build);
252
253
 
253
- export interface DesktopifyApp {
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
+
274
+ export interface DesktopifyAppWindow {
275
+ id: string;
254
276
  name: string;
255
- targetUrl: string;
256
- appId: string;
257
- autoHideMenuBar?: boolean;
258
- height: number;
259
- width: number;
277
+ url: string;
260
278
  fullScreen: boolean;
261
- isResizable: boolean;
262
- isTitleStatic?: boolean;
263
279
  minHeight?: number;
264
280
  minWidth?: number;
265
281
  maxHeight?: number;
266
282
  maxWidth?: number;
267
- singleInstance: boolean;
268
- disableContextMenu: boolean;
283
+ height: number;
284
+ width: number;
285
+ isResizable: boolean;
269
286
  titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover";
270
287
  alwaysOnTop: boolean;
288
+ visibility: "visible" | "hidden" | "show-when-contents-loaded";
289
+ isMain: boolean;
290
+ applicationMenu: DesktopifyMenuItemConstructorOptions[];
291
+ }
292
+
293
+ export interface DesktopifyApp {
294
+ name: string;
295
+ targetUrl: string;
296
+ appId: string;
297
+ autoHideMenuBar?: boolean; // remove
298
+ height: number; // remove
299
+ width: number; // remove
300
+ fullScreen: boolean; // remove
301
+ isResizable: boolean; // remove
302
+ isTitleStatic?: boolean;
303
+ minHeight?: number; // remove
304
+ minWidth?: number; // remove
305
+ maxHeight?: number; // remove
306
+ maxWidth?: number; // remove
307
+ singleInstance: boolean;
308
+ disableContextMenu: boolean;
309
+ titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover"; // remove
310
+ alwaysOnTop: boolean; // remove
271
311
  internalUrls?: string;
272
312
  isNativeWindowOpenDisabled?: boolean;
273
313
  isFindInPageEnabled?: boolean;
@@ -295,3 +335,7 @@ export interface DesktopifyApp {
295
335
  companyName?: string;
296
336
  pollForAppUpdatesEveryXMinutes?: number;
297
337
  }
338
+
339
+ export interface DesktopifyApp2 extends DesktopifyApp {
340
+ windows: DesktopifyAppWindow[];
341
+ }