@todesktop/shared 7.128.0 → 7.129.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.
@@ -3,24 +3,26 @@ import { ISwitchableValue } from "./toDesktop";
3
3
  import { MenuItemConstructorOptions, BrowserWindowConstructorOptions, WebPreferences } from "@todesktop/client-electron-types";
4
4
  import { BaseApp } from "./base";
5
5
  import { DesktopAppPlugin } from "./plugin";
6
- export declare type AssetDetails = {
6
+ interface BaseAssetDetails {
7
7
  /**
8
8
  * Remote URL where the asset can be downloaded
9
9
  */
10
10
  url: string;
11
- /**
12
- * Whether the asset is bundled into the final built app
13
- */
14
- isBundled: boolean;
15
11
  /**
16
12
  * Local path where the asset is/should be stored. This path is relative to the app directory
17
13
  */
18
14
  relativeLocalPath: string;
19
- /**
20
- * The type of asset being stored
21
- */
22
- type: "templateImage" | "default";
23
- };
15
+ }
16
+ export interface AppIconAssetDetails extends BaseAssetDetails {
17
+ type: "appIcon";
18
+ }
19
+ export interface MenuIconAssetDetails extends BaseAssetDetails {
20
+ type: "menuIcon";
21
+ }
22
+ export interface TrayMenubarIconAssetDetails extends BaseAssetDetails {
23
+ type: "trayMenubarIcon";
24
+ }
25
+ export declare type AssetDetails = AppIconAssetDetails | MenuIconAssetDetails | TrayMenubarIconAssetDetails;
24
26
  /**
25
27
  * Custom ToDesktop Roles for Application & Tray Menus
26
28
  */
@@ -35,7 +37,7 @@ export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConst
35
37
  actionType?: "jsEvent" | "role";
36
38
  iconUrl?: string;
37
39
  bundledIcon?: string;
38
- iconAssetDetails?: AssetDetails;
40
+ iconAssetDetails?: MenuIconAssetDetails;
39
41
  useTemplateImage?: boolean;
40
42
  }
41
43
  /**
@@ -68,13 +70,13 @@ export interface DesktopifyAppTray {
68
70
  icon?: string;
69
71
  useSeparateIcons?: boolean;
70
72
  windowsIcon?: string;
71
- windowsIconAssetDetails?: AssetDetails;
73
+ windowsIconAssetDetails?: TrayMenubarIconAssetDetails;
72
74
  macOSIcon?: string;
73
- macOSIconAssetDetails?: AssetDetails;
75
+ macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
74
76
  linuxIcon?: string;
75
- linuxIconAssetDetails?: AssetDetails;
77
+ linuxIconAssetDetails?: TrayMenubarIconAssetDetails;
76
78
  bundledIcon?: string;
77
- iconAssetDetails?: AssetDetails;
79
+ iconAssetDetails?: TrayMenubarIconAssetDetails;
78
80
  useTemplateImage?: boolean;
79
81
  rightClick: DesktopifyAppTrayAction;
80
82
  leftClick: DesktopifyAppTrayAction;
@@ -202,17 +204,17 @@ export interface DesktopifyApp2 {
202
204
  /**
203
205
  * Details concerning how the app icon should be handled across ToDesktop services
204
206
  */
205
- iconAssetDetails?: AssetDetails;
207
+ iconAssetDetails?: AppIconAssetDetails;
206
208
  /**
207
209
  * Instead of using one icon for every platform, use a separate icon for different platforms
208
210
  */
209
211
  useSeparateIcons?: boolean;
210
212
  windowsIcon?: string;
211
- windowsIconAssetDetails?: AssetDetails;
213
+ windowsIconAssetDetails?: AppIconAssetDetails;
212
214
  macOSIcon?: string;
213
- macOSIconAssetDetails?: AssetDetails;
215
+ macOSIconAssetDetails?: AppIconAssetDetails;
214
216
  linuxIcon?: string;
215
- linuxIconAssetDetails?: AssetDetails;
217
+ linuxIconAssetDetails?: AppIconAssetDetails;
216
218
  /**
217
219
  * The name of the company that the app belongs to
218
220
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.128.0",
3
+ "version": "7.129.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -7,24 +7,33 @@ import {
7
7
  import { BaseApp, Schemable } from "./base";
8
8
  import { DesktopAppPlugin } from "./plugin";
9
9
 
10
- export type AssetDetails = {
10
+ interface BaseAssetDetails {
11
11
  /**
12
12
  * Remote URL where the asset can be downloaded
13
13
  */
14
14
  url: string;
15
- /**
16
- * Whether the asset is bundled into the final built app
17
- */
18
- isBundled: boolean;
19
15
  /**
20
16
  * Local path where the asset is/should be stored. This path is relative to the app directory
21
17
  */
22
18
  relativeLocalPath: string;
23
- /**
24
- * The type of asset being stored
25
- */
26
- type: "templateImage" | "default"
27
- };
19
+ }
20
+
21
+ export interface AppIconAssetDetails extends BaseAssetDetails {
22
+ type: "appIcon";
23
+ }
24
+
25
+ export interface MenuIconAssetDetails extends BaseAssetDetails {
26
+ type: "menuIcon";
27
+ }
28
+
29
+ export interface TrayMenubarIconAssetDetails extends BaseAssetDetails {
30
+ type: "trayMenubarIcon";
31
+ }
32
+
33
+ export type AssetDetails =
34
+ | AppIconAssetDetails
35
+ | MenuIconAssetDetails
36
+ | TrayMenubarIconAssetDetails;
28
37
 
29
38
  /**
30
39
  * Custom ToDesktop Roles for Application & Tray Menus
@@ -59,7 +68,7 @@ export interface DesktopifyMenuItemConstructorOptions
59
68
  actionType?: "jsEvent" | "role";
60
69
  iconUrl?: string;
61
70
  bundledIcon?: string;
62
- iconAssetDetails?: AssetDetails;
71
+ iconAssetDetails?: MenuIconAssetDetails;
63
72
  useTemplateImage?: boolean;
64
73
  }
65
74
 
@@ -100,13 +109,13 @@ export interface DesktopifyAppTray {
100
109
  icon?: string;
101
110
  useSeparateIcons?: boolean;
102
111
  windowsIcon?: string;
103
- windowsIconAssetDetails?: AssetDetails;
112
+ windowsIconAssetDetails?: TrayMenubarIconAssetDetails;
104
113
  macOSIcon?: string;
105
- macOSIconAssetDetails?: AssetDetails;
114
+ macOSIconAssetDetails?: TrayMenubarIconAssetDetails;
106
115
  linuxIcon?: string;
107
- linuxIconAssetDetails?: AssetDetails;
116
+ linuxIconAssetDetails?: TrayMenubarIconAssetDetails;
108
117
  bundledIcon?: string;
109
- iconAssetDetails?: AssetDetails;
118
+ iconAssetDetails?: TrayMenubarIconAssetDetails;
110
119
  useTemplateImage?: boolean;
111
120
  rightClick: DesktopifyAppTrayAction;
112
121
  leftClick: DesktopifyAppTrayAction;
@@ -316,19 +325,19 @@ export interface DesktopifyApp2 {
316
325
  /**
317
326
  * Details concerning how the app icon should be handled across ToDesktop services
318
327
  */
319
- iconAssetDetails?: AssetDetails;
328
+ iconAssetDetails?: AppIconAssetDetails;
320
329
  /**
321
330
  * Instead of using one icon for every platform, use a separate icon for different platforms
322
331
  */
323
332
  useSeparateIcons?: boolean;
324
333
  windowsIcon?: string;
325
- windowsIconAssetDetails?: AssetDetails;
334
+ windowsIconAssetDetails?: AppIconAssetDetails;
326
335
 
327
336
  macOSIcon?: string;
328
- macOSIconAssetDetails?: AssetDetails;
337
+ macOSIconAssetDetails?: AppIconAssetDetails;
329
338
 
330
339
  linuxIcon?: string;
331
- linuxIconAssetDetails?: AssetDetails;
340
+ linuxIconAssetDetails?: AppIconAssetDetails;
332
341
  /**
333
342
  * The name of the company that the app belongs to
334
343
  */