@todesktop/shared 7.53.0 → 7.56.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,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,45 @@ 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
- maxWidth?: number;
157
- height: number;
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
+ 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 DesktopifyAppTrayNoMenuAction = {
184
+ role: "noAction";
185
+ };
186
+ export declare type DesktopifyAppTrayAction = DesktopifyAppTrayToggleMenuAction | DesktopifyAppTrayToggleWindowAction | DesktopifyAppTrayNoMenuAction;
187
+ export interface DesktopifyAppTray {
188
+ id: string;
189
+ icon: string;
190
+ rightClick: DesktopifyAppTrayAction;
191
+ leftClick: DesktopifyAppTrayAction;
165
192
  }
166
193
  export interface DesktopifyApp {
167
194
  name: string;
@@ -210,5 +237,10 @@ export interface DesktopifyApp {
210
237
  }
211
238
  export interface DesktopifyApp2 extends DesktopifyApp {
212
239
  windows: DesktopifyAppWindow[];
240
+ trays: DesktopifyAppTray[];
241
+ }
242
+ export interface IApp2 extends IApp {
243
+ windows: DesktopifyAppWindow[];
244
+ trays: DesktopifyAppTray[];
213
245
  }
214
246
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.53.0",
3
+ "version": "7.56.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 { MenuItemConstructorOptions } from "@todesktop/client-electron-types";
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,56 @@ 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
- maxWidth?: number;
283
- height: number;
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
+ 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 DesktopifyAppTrayNoMenuAction = {
321
+ role: "noAction";
322
+ };
323
+
324
+ export type DesktopifyAppTrayAction =
325
+ | DesktopifyAppTrayToggleMenuAction
326
+ | DesktopifyAppTrayToggleWindowAction
327
+ | DesktopifyAppTrayNoMenuAction;
328
+
329
+ export interface DesktopifyAppTray {
330
+ id: string;
331
+ icon: string;
332
+ rightClick: DesktopifyAppTrayAction;
333
+ leftClick: DesktopifyAppTrayAction;
291
334
  }
292
335
 
293
336
  export interface DesktopifyApp {
@@ -338,4 +381,10 @@ export interface DesktopifyApp {
338
381
 
339
382
  export interface DesktopifyApp2 extends DesktopifyApp {
340
383
  windows: DesktopifyAppWindow[];
384
+ trays: DesktopifyAppTray[];
385
+ }
386
+
387
+ export interface IApp2 extends IApp {
388
+ windows: DesktopifyAppWindow[];
389
+ trays: DesktopifyAppTray[];
341
390
  }