@todesktop/shared 7.184.18 → 7.184.20

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/src/desktopify.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { IApp2 } from "./desktopify2";
2
- import { IApp } from "./toDesktop";
1
+ import { IApp2 } from './desktopify2';
2
+ import { IApp } from './toDesktop';
3
3
  import {
4
4
  Configuration,
5
5
  PackagerOptions,
6
6
  PublishOptions,
7
7
  // app-builder-lib shouldn't be installed as a dependency for dependent
8
8
  // packages since it's too large
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
10
  // @ts-ignore
10
- } from "app-builder-lib";
11
+ } from 'app-builder-lib';
11
12
 
12
13
  type appBuilderLib = PackagerOptions & PublishOptions;
13
14
  export interface IAppBuilderLib extends appBuilderLib {
@@ -22,9 +23,9 @@ export interface ExtraFileReference {
22
23
  export type ISODate = string; // TODO: define more
23
24
 
24
25
  export enum PlatformName {
25
- linux = "linux",
26
- mac = "mac",
27
- windows = "windows",
26
+ linux = 'linux',
27
+ mac = 'mac',
28
+ windows = 'windows',
28
29
  }
29
30
 
30
31
  export type FilePath = string;
@@ -32,30 +33,30 @@ export type SemanticVersion = string; // TODO: define more
32
33
  export type URL = string; // TODO: define more
33
34
 
34
35
  export enum PackageManager {
35
- npm = "npm",
36
- yarn = "yarn",
37
- pnpm = "pnpm",
36
+ npm = 'npm',
37
+ yarn = 'yarn',
38
+ pnpm = 'pnpm',
38
39
  }
39
40
 
40
41
  export enum BuildStatus {
41
- queued = "queued",
42
- failed = "failed",
43
- building = "building",
44
- preparation = "preparation",
45
- succeeded = "succeeded",
46
- cancelled = "cancelled",
42
+ queued = 'queued',
43
+ failed = 'failed',
44
+ building = 'building',
45
+ preparation = 'preparation',
46
+ succeeded = 'succeeded',
47
+ cancelled = 'cancelled',
47
48
  }
48
49
 
49
- export type Arch = "ia32" | "x64" | "arm64";
50
- export type MacArch = "ia32" | "x64" | "arm64" | "universal";
51
- export type LinuxArtifactName = "appImage" | "deb" | "rpm" | "snap";
52
- export type MacArtifactName = "dmg" | "zip" | "installer";
50
+ export type Arch = 'ia32' | 'x64' | 'arm64';
51
+ export type MacArch = 'ia32' | 'x64' | 'arm64' | 'universal';
52
+ export type LinuxArtifactName = 'appImage' | 'deb' | 'rpm' | 'snap';
53
+ export type MacArtifactName = 'dmg' | 'zip' | 'installer';
53
54
  export type WindowsArtifactName =
54
- | "msi"
55
- | "nsis"
56
- | "nsis-web"
57
- | "nsis-web-7z"
58
- | "appx";
55
+ | 'msi'
56
+ | 'nsis'
57
+ | 'nsis-web'
58
+ | 'nsis-web-7z'
59
+ | 'appx';
59
60
 
60
61
  type ArtifactDownload = Record<
61
62
  Arch,
@@ -71,7 +72,7 @@ export type WindowsArtifactDownloads = Record<
71
72
  ArtifactDownload
72
73
  >;
73
74
 
74
- export type CodeSignSkipReason = "no-cert" | "user-disabled";
75
+ export type CodeSignSkipReason = 'no-cert' | 'user-disabled';
75
76
 
76
77
  export interface PlatformBuild {
77
78
  appBuilderLibConfig?: IAppBuilderLib;
@@ -104,7 +105,7 @@ export interface PlatformBuild {
104
105
  status: BuildStatus;
105
106
  }
106
107
 
107
- export type CIRunner = "circle" | "azure";
108
+ export type CIRunner = 'circle' | 'azure';
108
109
 
109
110
  export interface Build {
110
111
  appCustomDomain?: string;
@@ -126,7 +127,7 @@ export interface Build {
126
127
  endedAt?: ISODate;
127
128
  electronVersionSpecified?: SemanticVersion;
128
129
  electronVersionUsed?: SemanticVersion;
129
- environmentVariables?: IApp["environmentVariables"];
130
+ environmentVariables?: IApp['environmentVariables'];
130
131
  errorMessage?: string;
131
132
  icon?: string;
132
133
  id: string;
@@ -167,21 +168,21 @@ export interface Build {
167
168
 
168
169
  export type ComputedBuildProperties = Pick<
169
170
  Build,
170
- | "desktopifyVersion"
171
- | "electronVersionUsed"
172
- | "endedAt"
173
- | "errorMessage"
174
- | "releasedAt"
175
- | "standardUniversalDownloadUrl"
176
- | "startedAt"
177
- | "status"
178
- | "universalDownloadUrl"
171
+ | 'desktopifyVersion'
172
+ | 'electronVersionUsed'
173
+ | 'endedAt'
174
+ | 'errorMessage'
175
+ | 'releasedAt'
176
+ | 'standardUniversalDownloadUrl'
177
+ | 'startedAt'
178
+ | 'status'
179
+ | 'universalDownloadUrl'
179
180
  >;
180
181
 
181
182
  export enum ManifestCategory {
182
- primary = "primary",
183
- buildStamped = "build-stamped",
184
- versioned = "versioned",
183
+ primary = 'primary',
184
+ buildStamped = 'build-stamped',
185
+ versioned = 'versioned',
185
186
  }
186
187
 
187
188
  export interface CustomManifestArtifactDetails {
@@ -227,7 +228,7 @@ export interface SmokeTestProgress {
227
228
  message?: string;
228
229
  progress: number;
229
230
  screenshot?: string;
230
- state: "progress" | "done" | "error" | "skipped";
231
+ state: 'progress' | 'done' | 'error' | 'skipped';
231
232
  updatedAppHasNoMainErrors?: boolean;
232
233
  }
233
234
 
@@ -246,8 +247,8 @@ export const isPlatformBuildRunning = (
246
247
  }
247
248
  return (
248
249
  !platformBuild.shouldSkip && // <-- Noteworthy
249
- !["cancelled", "succeeded"].includes(platformBuild.status) &&
250
- ("failed" !== platformBuild.status ||
250
+ !['cancelled', 'succeeded'].includes(platformBuild.status) &&
251
+ ('failed' !== platformBuild.status ||
251
252
  platformBuild.numberOfAttemptedBuilds < 2)
252
253
  );
253
254
  };
@@ -258,12 +259,12 @@ export const isCiBuildRunning = (build: Build): boolean => {
258
259
  return false;
259
260
  }
260
261
  return (
261
- build.status === "building" ||
262
- (build.status === "failed" &&
263
- ["linux", "mac", "windows"].some(
262
+ build.status === 'building' ||
263
+ (build.status === 'failed' &&
264
+ ['linux', 'mac', 'windows'].some(
264
265
  (platform) =>
265
- build.status === "building" ||
266
- (build.status === "failed" && isPlatformBuildRunning(build[platform]))
266
+ build.status === 'building' ||
267
+ (build.status === 'failed' && isPlatformBuildRunning(build[platform]))
267
268
  ))
268
269
  );
269
270
  };
@@ -273,8 +274,8 @@ export const isBuildRunning = (build: Build): boolean => {
273
274
  return false;
274
275
  }
275
276
  return (
276
- !["cancelled", "succeeded"].includes(build.status) &&
277
- ["linux", "mac", "windows"].some((platform) =>
277
+ !['cancelled', 'succeeded'].includes(build.status) &&
278
+ ['linux', 'mac', 'windows'].some((platform) =>
278
279
  isPlatformBuildRunning(build[platform])
279
280
  )
280
281
  );
@@ -299,7 +300,7 @@ export interface DesktopifyApp {
299
300
  maxWidth?: number; // remove
300
301
  singleInstance: boolean;
301
302
  disableContextMenu: boolean;
302
- titleBarStyle?: "hidden" | "hiddenInset" | "customButtonsOnHover"; // remove
303
+ titleBarStyle?: 'hidden' | 'hiddenInset' | 'customButtonsOnHover'; // remove
303
304
  alwaysOnTop: boolean; // remove
304
305
  internalUrls?: string;
305
306
  isNativeWindowOpenDisabled?: boolean;
@@ -322,8 +323,8 @@ export interface DesktopifyApp {
322
323
  shouldReuseRendererProcess?: boolean;
323
324
  shouldMakeSameDomainAnExternalLink?: boolean;
324
325
  enablePushNotifications?: boolean;
325
- themeSource?: "system" | "light" | "dark";
326
- themeSourceMac?: "system" | "light" | "dark";
326
+ themeSource?: 'system' | 'light' | 'dark';
327
+ themeSourceMac?: 'system' | 'light' | 'dark';
327
328
  crashReporter?: string;
328
329
  companyName?: string;
329
330
  pollForAppUpdatesEveryXMinutes?: number;
@@ -1,12 +1,12 @@
1
- import { ISwitchableValue } from "./toDesktop";
1
+ import { ISwitchableValue } from './toDesktop';
2
2
  import {
3
3
  MenuItemConstructorOptions,
4
4
  BrowserWindowConstructorOptions,
5
5
  WebPreferences,
6
- } from "@todesktop/client-electron-types";
7
- import { BaseApp, Schemable } from "./base";
8
- import { DesktopAppPlugin } from "./plugin";
9
- import { ValidTranslationKeys, ValidTranslationLanguages } from "./translation";
6
+ } from '@todesktop/client-electron-types';
7
+ import { BaseApp } from './base';
8
+ import { DesktopAppPlugin } from './plugin';
9
+ import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
10
10
 
11
11
  interface BaseAssetDetails {
12
12
  /**
@@ -20,20 +20,20 @@ interface BaseAssetDetails {
20
20
  }
21
21
 
22
22
  export interface AppIconAssetDetails extends BaseAssetDetails {
23
- type: "appIcon";
23
+ type: 'appIcon';
24
24
  }
25
25
 
26
26
  export interface MenuIconAssetDetails extends BaseAssetDetails {
27
- type: "menuIcon";
27
+ type: 'menuIcon';
28
28
  }
29
29
 
30
30
  export interface TrayMenubarIconAssetDetails extends BaseAssetDetails {
31
- type: "trayMenubarIcon";
31
+ type: 'trayMenubarIcon';
32
32
  }
33
33
 
34
34
  export interface FileAssetDetails extends BaseAssetDetails {
35
35
  md5Hash: string;
36
- type: "file";
36
+ type: 'file';
37
37
  }
38
38
 
39
39
  export type AssetDetails =
@@ -46,39 +46,39 @@ export type AssetDetails =
46
46
  * Custom ToDesktop Roles for Application & Tray Menus
47
47
  */
48
48
  type todesktopRoles =
49
- | "todesktop:launch-at-startup"
50
- | "todesktop:check-for-updates"
51
- | "todesktop:quit"
52
- | "todesktop:quit-completely"
53
- | "todesktop:new-window"
54
- | "todesktop:new-tab"
55
- | "todesktop:check-for-updates"
56
- | "todesktop:history-home"
57
- | "todesktop:history-back"
58
- | "todesktop:history-forward"
59
- | "todesktop:show-window"
60
- | "todesktop:hide-window"
61
- | "todesktop:toggle-window"
62
- | "todesktop:toggle-window0"
63
- | "todesktop:toggle-window1"
64
- | "todesktop:toggle-window2"
65
- | "todesktop:toggle-window3"
66
- | "todesktop:toggle-window4";
49
+ | 'todesktop:launch-at-startup'
50
+ | 'todesktop:check-for-updates'
51
+ | 'todesktop:quit'
52
+ | 'todesktop:quit-completely'
53
+ | 'todesktop:new-window'
54
+ | 'todesktop:new-tab'
55
+ | 'todesktop:check-for-updates'
56
+ | 'todesktop:history-home'
57
+ | 'todesktop:history-back'
58
+ | 'todesktop:history-forward'
59
+ | 'todesktop:show-window'
60
+ | 'todesktop:hide-window'
61
+ | 'todesktop:toggle-window'
62
+ | 'todesktop:toggle-window0'
63
+ | 'todesktop:toggle-window1'
64
+ | 'todesktop:toggle-window2'
65
+ | 'todesktop:toggle-window3'
66
+ | 'todesktop:toggle-window4';
67
67
 
68
68
  export interface DesktopifyMenuItemConstructorOptions
69
- extends Omit<MenuItemConstructorOptions, "role" | "submenu"> {
69
+ extends Omit<MenuItemConstructorOptions, 'role' | 'submenu'> {
70
70
  platforms?: NodeJS.Platform[];
71
71
  submenu?: DesktopifyMenuItemConstructorOptions[];
72
- role?: MenuItemConstructorOptions["role"] | todesktopRoles;
72
+ role?: MenuItemConstructorOptions['role'] | todesktopRoles;
73
73
  useSystemLabel?: boolean;
74
74
  event?: string;
75
75
  targetWindowId?: string;
76
- actionType?: "jsEvent" | "role";
76
+ actionType?: 'jsEvent' | 'role';
77
77
  iconUrl?: string;
78
78
  bundledIcon?: string;
79
79
  iconAssetDetails?: MenuIconAssetDetails;
80
80
  useTemplateImage?: boolean;
81
- acceleratorBehaviour?: "none" | "default" | "custom";
81
+ acceleratorBehaviour?: 'none' | 'default' | 'custom';
82
82
  }
83
83
 
84
84
  /**
@@ -87,7 +87,7 @@ export interface DesktopifyMenuItemConstructorOptions
87
87
  * @param windowId - The id of the window to toggle
88
88
  */
89
89
  export type DesktopifyAppTrayToggleWindowAction = {
90
- role: "toggleWindow";
90
+ role: 'toggleWindow';
91
91
  windowId: string;
92
92
  };
93
93
 
@@ -97,7 +97,7 @@ export type DesktopifyAppTrayToggleWindowAction = {
97
97
  * @param menu - The menu to show when action triggered
98
98
  */
99
99
  export type DesktopifyAppTrayToggleMenuAction = {
100
- role: "toggleMenu";
100
+ role: 'toggleMenu';
101
101
  menu: DesktopifyMenuItemConstructorOptions[];
102
102
  };
103
103
 
@@ -105,7 +105,7 @@ export type DesktopifyAppTrayToggleMenuAction = {
105
105
  * No Action Tray Action
106
106
  */
107
107
  export type DesktopifyAppTrayNoAction = {
108
- role: "noAction";
108
+ role: 'noAction';
109
109
  };
110
110
 
111
111
  export type DesktopifyAppTrayAction =
@@ -141,52 +141,52 @@ export type DesktopifyAppMenu = DesktopifyMenuItemConstructorOptions;
141
141
  export const allowedBrowserWindowConstructorOptions: Readonly<
142
142
  (keyof BrowserWindowConstructorOptions)[]
143
143
  > = [
144
- "width",
145
- "height",
144
+ 'width',
145
+ 'height',
146
146
  // "x",
147
147
  // "y",
148
- "useContentSize",
149
- "center",
150
- "minWidth",
151
- "minHeight",
152
- "maxWidth",
153
- "maxHeight",
154
- "resizable",
155
- "movable",
156
- "minimizable",
157
- "maximizable",
158
- "closable",
159
- "focusable",
160
- "alwaysOnTop",
161
- "fullscreen",
162
- "fullscreenable",
163
- "simpleFullscreen",
164
- "skipTaskbar",
165
- "kiosk",
166
- "icon",
167
- "paintWhenInitiallyHidden",
168
- "frame",
169
- "acceptFirstMouse",
170
- "disableAutoHideCursor",
171
- "autoHideMenuBar",
172
- "enableLargerThanScreen",
173
- "backgroundColor",
174
- "hasShadow",
175
- "opacity",
176
- "darkTheme",
177
- "transparent",
178
- "visualEffectState",
179
- "titleBarStyle",
180
- "trafficLightPosition",
148
+ 'useContentSize',
149
+ 'center',
150
+ 'minWidth',
151
+ 'minHeight',
152
+ 'maxWidth',
153
+ 'maxHeight',
154
+ 'resizable',
155
+ 'movable',
156
+ 'minimizable',
157
+ 'maximizable',
158
+ 'closable',
159
+ 'focusable',
160
+ 'alwaysOnTop',
161
+ 'fullscreen',
162
+ 'fullscreenable',
163
+ 'simpleFullscreen',
164
+ 'skipTaskbar',
165
+ 'kiosk',
166
+ 'icon',
167
+ 'paintWhenInitiallyHidden',
168
+ 'frame',
169
+ 'acceptFirstMouse',
170
+ 'disableAutoHideCursor',
171
+ 'autoHideMenuBar',
172
+ 'enableLargerThanScreen',
173
+ 'backgroundColor',
174
+ 'hasShadow',
175
+ 'opacity',
176
+ 'darkTheme',
177
+ 'transparent',
178
+ 'visualEffectState',
179
+ 'titleBarStyle',
180
+ 'trafficLightPosition',
181
181
  // "roundedCorners",
182
- "fullscreenWindowTitle",
183
- "thickFrame",
184
- "type",
185
- "vibrancy",
186
- "zoomToPageWidth",
187
- "tabbingIdentifier",
188
- "webPreferences",
189
- "titleBarOverlay",
182
+ 'fullscreenWindowTitle',
183
+ 'thickFrame',
184
+ 'type',
185
+ 'vibrancy',
186
+ 'zoomToPageWidth',
187
+ 'tabbingIdentifier',
188
+ 'webPreferences',
189
+ 'titleBarOverlay',
190
190
  ] as const;
191
191
 
192
192
  // Make type from all numbered index values
@@ -200,24 +200,24 @@ export type whitelistedBrowserWindowConstructorOptions =
200
200
  */
201
201
  export const allowedWebPreferencesOptions: Readonly<(keyof WebPreferences)[]> =
202
202
  [
203
- "devTools",
204
- "zoomFactor",
205
- "textAreasAreResizable",
206
- "scrollBounce",
207
- "defaultFontFamily",
208
- "defaultFontSize",
209
- "defaultMonospaceFontSize",
210
- "minimumFontSize",
211
- "defaultEncoding",
212
- "backgroundThrottling",
213
- "offscreen",
214
- "safeDialogs",
215
- "safeDialogsMessage",
216
- "navigateOnDragDrop",
217
- "autoplayPolicy",
218
- "disableHtmlFullscreenWindowResize",
219
- "accessibleTitle",
220
- "spellcheck",
203
+ 'devTools',
204
+ 'zoomFactor',
205
+ 'textAreasAreResizable',
206
+ 'scrollBounce',
207
+ 'defaultFontFamily',
208
+ 'defaultFontSize',
209
+ 'defaultMonospaceFontSize',
210
+ 'minimumFontSize',
211
+ 'defaultEncoding',
212
+ 'backgroundThrottling',
213
+ 'offscreen',
214
+ 'safeDialogs',
215
+ 'safeDialogsMessage',
216
+ 'navigateOnDragDrop',
217
+ 'autoplayPolicy',
218
+ 'disableHtmlFullscreenWindowResize',
219
+ 'accessibleTitle',
220
+ 'spellcheck',
221
221
  ] as const;
222
222
 
223
223
  // Make type from all numbered index values
@@ -247,7 +247,7 @@ export interface DesktopifyAppWindow {
247
247
  /**
248
248
  * The type of window
249
249
  */
250
- type: "menubar" | "app" | "panel";
250
+ type: 'menubar' | 'app' | 'panel';
251
251
  /**
252
252
  * Keyboard shortcut to toggle window visibility
253
253
  */
@@ -272,7 +272,7 @@ export interface DesktopifyAppWindow {
272
272
  /**
273
273
  * Inital visibility of window
274
274
  */
275
- visibility: "visible" | "hidden" | "show-when-contents-loaded";
275
+ visibility: 'visible' | 'hidden' | 'show-when-contents-loaded';
276
276
  /**
277
277
  * MacOS option for whether the window should be visible on all workspaces
278
278
  */
@@ -461,13 +461,13 @@ export interface DesktopifyApp2 {
461
461
  *
462
462
  * See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
463
463
  */
464
- themeSource?: "system" | "light" | "dark";
464
+ themeSource?: 'system' | 'light' | 'dark';
465
465
  /**
466
466
  * Sets theme source for only mac
467
467
  *
468
468
  * See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
469
469
  */
470
- themeSourceMac?: "system" | "light" | "dark";
470
+ themeSourceMac?: 'system' | 'light' | 'dark';
471
471
  /**
472
472
  * URL that crash reports will be POSTed to
473
473
  */
@@ -7,7 +7,7 @@ export interface IAppFromServerProps {
7
7
  html?: string;
8
8
  iconUrl?: string;
9
9
  secret: string;
10
- appType: "app" | "menubar" | "tabbed" | "electron";
10
+ appType: 'app' | 'menubar' | 'tabbed' | 'electron';
11
11
  // dimension: IAppFromServerPropsDimension;
12
12
  }
13
13
 
package/src/index.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { version } from "../package.json";
1
+ import { version } from '../package.json';
2
2
 
3
- export * from "./toDesktop";
4
- export * from "./desktopify";
5
- export * from "./validations";
6
- export * from "./getSiteInfo";
7
- export * from "./plans";
3
+ export * from './toDesktop';
4
+ export * from './desktopify';
5
+ export * from './validations';
6
+ export * from './getSiteInfo';
7
+ export * from './plans';
8
8
  export * from './base';
9
9
  export * from './plugin';
10
10
 
11
- export * from "./desktopify2";
11
+ export * from './desktopify2';
12
12
 
13
13
  const schemaVersion = version;
14
14
  export { schemaVersion };
package/src/json.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- declare module "*.json" {
1
+ declare module '*.json' {
2
2
  const value: any;
3
3
  export const version: string;
4
4
  export default value;
5
5
  }
6
6
 
7
- declare module "is-regex";
7
+ declare module 'is-regex';
8
8
 
9
9
  // declare module "debug";