@todesktop/shared 7.57.0 → 7.61.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,5 @@
1
1
  /// <reference types="node" />
2
- import { IApp, ISwitchableValue } from "./toDesktop";
2
+ import { IApp, ISwitchableValue, Schemable } from "./toDesktop";
3
3
  import { MenuItemConstructorOptions, BrowserWindowConstructorOptions, WebPreferences } from "@todesktop/client-electron-types";
4
4
  /**
5
5
  * Custom ToDesktop Roles for Application & Tray Menus
@@ -41,6 +41,7 @@ export interface DesktopifyAppTray {
41
41
  rightClick: DesktopifyAppTrayAction;
42
42
  leftClick: DesktopifyAppTrayAction;
43
43
  }
44
+ export declare type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
44
45
  /**
45
46
  * Whitelist of allowed DesktopifyWindow Options.
46
47
  * These attrs (if set) are passed to the `BrowserWindow` constructor
@@ -82,7 +83,7 @@ export interface DesktopifyAppWindow {
82
83
  /**
83
84
  * The window's application menu
84
85
  */
85
- applicationMenu: DesktopifyMenuItemConstructorOptions[];
86
+ applicationMenu: DesktopifyAppMenu[];
86
87
  /**
87
88
  * Keyboard shortcut to toggle window visibility
88
89
  */
@@ -134,15 +135,19 @@ export interface DesktopifyAppWindow {
134
135
  webPreferences?: Pick<WebPreferences, whitelistedWebPreferencesOptions>;
135
136
  };
136
137
  }
137
- export interface DesktopifyApp2 {
138
- /**
139
- * The name of the app
140
- */
141
- name: string;
138
+ export interface DesktopifyApp2 extends Schemable {
142
139
  /**
143
140
  * A unique app id
144
141
  */
145
142
  id: string;
143
+ /**
144
+ * The current schema version, 2 or higher
145
+ */
146
+ schemaVersion: number;
147
+ /**
148
+ * The name of the app
149
+ */
150
+ name: string;
146
151
  /**
147
152
  * The app icon
148
153
  */
@@ -244,9 +249,14 @@ export interface DesktopifyApp2 {
244
249
  * The app's trays
245
250
  */
246
251
  trays: DesktopifyAppTray[];
252
+ /**
253
+ * The app's menus
254
+ */
255
+ menus: DesktopifyAppMenu[];
247
256
  }
248
257
  export interface IApp2 extends IApp {
249
258
  windows: DesktopifyAppWindow[];
250
259
  trays: DesktopifyAppTray[];
260
+ menus: DesktopifyAppMenu[];
251
261
  }
252
262
  export {};
@@ -43,7 +43,7 @@ exports.allowedBrowserWindowConstructorOptions = [
43
43
  "visualEffectState",
44
44
  "titleBarStyle",
45
45
  "trafficLightPosition",
46
- "roundedCorners",
46
+ // "roundedCorners",
47
47
  "fullscreenWindowTitle",
48
48
  "thickFrame",
49
49
  "type",
@@ -1,4 +1,7 @@
1
1
  import { ExtraFileReference, FilePath, IAppBuilderLib, URL } from "./desktopify";
2
+ export interface Schemable {
3
+ schemaVersion?: number;
4
+ }
2
5
  export declare type IUploadFileStatus = "error" | "success" | "done" | "uploading" | "removed";
3
6
  export interface IUploadFile {
4
7
  uid: string;
@@ -233,7 +236,7 @@ export interface CustomWindowsCodeSignEV {
233
236
  hsmCertType: WindowsHSMCertType.ev;
234
237
  hsmCertName: string;
235
238
  }
236
- export interface IApp {
239
+ export interface IApp extends Schemable {
237
240
  appModelId: string;
238
241
  appPkgName?: string;
239
242
  appProtocol?: ISwitchableValue<string>;
@@ -302,9 +305,8 @@ export interface IApp {
302
305
  windowOptions: IWindowOptions;
303
306
  pollForAppUpdatesEveryXMinutes?: number;
304
307
  }
305
- export interface IUser {
308
+ export interface IUser extends Schemable {
306
309
  id: string;
307
- schemaVersion?: number;
308
310
  authInfo?: {};
309
311
  avatar?: string;
310
312
  currentApplication?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.57.0",
3
+ "version": "7.61.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,4 +1,4 @@
1
- import { IApp, ISwitchableValue } from "./toDesktop";
1
+ import { IApp, ISwitchableValue, Schemable } from "./toDesktop";
2
2
  import {
3
3
  MenuItemConstructorOptions,
4
4
  BrowserWindowConstructorOptions,
@@ -67,6 +67,8 @@ export interface DesktopifyAppTray {
67
67
  leftClick: DesktopifyAppTrayAction;
68
68
  }
69
69
 
70
+ export type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
71
+
70
72
  /**
71
73
  * Whitelist of allowed DesktopifyWindow Options.
72
74
  * These attrs (if set) are passed to the `BrowserWindow` constructor
@@ -112,7 +114,7 @@ export const allowedBrowserWindowConstructorOptions: Readonly<
112
114
  "visualEffectState",
113
115
  "titleBarStyle",
114
116
  "trafficLightPosition",
115
- "roundedCorners",
117
+ // "roundedCorners",
116
118
  "fullscreenWindowTitle",
117
119
  "thickFrame",
118
120
  "type",
@@ -183,7 +185,7 @@ export interface DesktopifyAppWindow {
183
185
  /**
184
186
  * The window's application menu
185
187
  */
186
- applicationMenu: DesktopifyMenuItemConstructorOptions[];
188
+ applicationMenu: DesktopifyAppMenu[];
187
189
  /**
188
190
  * Keyboard shortcut to toggle window visibility
189
191
  */
@@ -240,15 +242,19 @@ export interface DesktopifyAppWindow {
240
242
  }
241
243
  // TODO: Look into hasMinHeight, etc
242
244
 
243
- export interface DesktopifyApp2 {
244
- /**
245
- * The name of the app
246
- */
247
- name: string;
245
+ export interface DesktopifyApp2 extends Schemable {
248
246
  /**
249
247
  * A unique app id
250
248
  */
251
249
  id: string;
250
+ /**
251
+ * The current schema version, 2 or higher
252
+ */
253
+ schemaVersion: number;
254
+ /**
255
+ * The name of the app
256
+ */
257
+ name: string;
252
258
  /**
253
259
  * The app icon
254
260
  */
@@ -350,9 +356,14 @@ export interface DesktopifyApp2 {
350
356
  * The app's trays
351
357
  */
352
358
  trays: DesktopifyAppTray[];
359
+ /**
360
+ * The app's menus
361
+ */
362
+ menus: DesktopifyAppMenu[];
353
363
  }
354
364
 
355
365
  export interface IApp2 extends IApp {
356
366
  windows: DesktopifyAppWindow[];
357
367
  trays: DesktopifyAppTray[];
368
+ menus: DesktopifyAppMenu[];
358
369
  }
package/src/toDesktop.ts CHANGED
@@ -5,6 +5,10 @@ import {
5
5
  URL,
6
6
  } from "./desktopify";
7
7
 
8
+ export interface Schemable {
9
+ schemaVersion?: number;
10
+ }
11
+
8
12
  export type IUploadFileStatus =
9
13
  | "error"
10
14
  | "success"
@@ -267,7 +271,7 @@ export interface CustomWindowsCodeSignEV {
267
271
  hsmCertName: string;
268
272
  }
269
273
 
270
- export interface IApp {
274
+ export interface IApp extends Schemable {
271
275
  appModelId: string;
272
276
  appPkgName?: string;
273
277
  appProtocol?: ISwitchableValue<string>;
@@ -334,9 +338,8 @@ export interface IApp {
334
338
  pollForAppUpdatesEveryXMinutes?: number;
335
339
  }
336
340
 
337
- export interface IUser {
341
+ export interface IUser extends Schemable {
338
342
  id: string;
339
- schemaVersion?: number;
340
343
  authInfo?: {};
341
344
  avatar?: string;
342
345
  currentApplication?: string;