@todesktop/shared 7.184.26 → 7.184.27

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.
@@ -196,7 +196,7 @@ export interface DesktopifyAppWindow {
196
196
  */
197
197
  file?: string;
198
198
  }
199
- export interface DesktopifyApp2 {
199
+ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
200
200
  /**
201
201
  * Used as appUserModelId on windows
202
202
  */
@@ -353,7 +353,7 @@ export interface DesktopifyApp2 {
353
353
  /**
354
354
  * An array of plugin modules. Can work with semver specificity
355
355
  */
356
- plugins?: (DesktopAppPlugin | string)[];
356
+ plugins?: (Plugin | string)[];
357
357
  /**
358
358
  * The app's windows
359
359
  */
@@ -413,12 +413,12 @@ export interface DesktopifyApp2 {
413
413
  */
414
414
  shouldProtectContent?: boolean;
415
415
  }
416
- export interface IApp2 extends BaseApp {
417
- desktopApp: DesktopifyApp2;
416
+ export interface IApp2<Plugin = DesktopAppPlugin> extends BaseApp {
417
+ desktopApp: DesktopifyApp2<Plugin>;
418
418
  desktopAppOverrides?: {
419
- linux?: Partial<DesktopifyApp2>;
420
- mac?: Partial<DesktopifyApp2>;
421
- windows?: Partial<DesktopifyApp2>;
419
+ linux?: Partial<DesktopifyApp2<Plugin>>;
420
+ mac?: Partial<DesktopifyApp2<Plugin>>;
421
+ windows?: Partial<DesktopifyApp2<Plugin>>;
422
422
  };
423
423
  }
424
424
  export {};
@@ -1,5 +1,6 @@
1
1
  import * as yup from 'yup';
2
- import { DesktopifyApp2 } from '.';
2
+ import { DesktopifyApp2 } from './desktopify2';
3
+ import { DesktopAppPlugin } from './plugin';
3
4
  export declare const appTitleValidation: yup.StringSchema;
4
5
  export declare const forceVersionValidation: yup.StringSchema;
5
6
  export declare const iconValidation: yup.StringSchema;
@@ -50,4 +51,4 @@ export declare const appConfigValidation: yup.ObjectSchema<{
50
51
  publishedVersions: any;
51
52
  };
52
53
  }>;
53
- export declare const shouldMinimizeToTrayIsActive: (desktopApp: DesktopifyApp2) => boolean;
54
+ export declare const shouldMinimizeToTrayIsActive: <Plugin_1 = DesktopAppPlugin>(desktopApp: DesktopifyApp2<Plugin_1>) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.184.26",
3
+ "version": "7.184.27",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -322,7 +322,7 @@ export interface DesktopifyAppWindow {
322
322
  }
323
323
  // TODO: Look into hasMinHeight, etc
324
324
 
325
- export interface DesktopifyApp2 {
325
+ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
326
326
  /**
327
327
  * Used as appUserModelId on windows
328
328
  */
@@ -481,7 +481,7 @@ export interface DesktopifyApp2 {
481
481
  /**
482
482
  * An array of plugin modules. Can work with semver specificity
483
483
  */
484
- plugins?: (DesktopAppPlugin | string)[];
484
+ plugins?: (Plugin | string)[];
485
485
  /**
486
486
  * The app's windows
487
487
  */
@@ -545,13 +545,13 @@ export interface DesktopifyApp2 {
545
545
  shouldProtectContent?: boolean;
546
546
  }
547
547
 
548
- export interface IApp2 extends BaseApp {
548
+ export interface IApp2<Plugin = DesktopAppPlugin> extends BaseApp {
549
549
  // Be careful when coercing to `IApp2` that we always check for `desktopApp` first
550
- desktopApp: DesktopifyApp2;
550
+ desktopApp: DesktopifyApp2<Plugin>;
551
551
 
552
552
  desktopAppOverrides?: {
553
- linux?: Partial<DesktopifyApp2>;
554
- mac?: Partial<DesktopifyApp2>;
555
- windows?: Partial<DesktopifyApp2>;
553
+ linux?: Partial<DesktopifyApp2<Plugin>>;
554
+ mac?: Partial<DesktopifyApp2<Plugin>>;
555
+ windows?: Partial<DesktopifyApp2<Plugin>>;
556
556
  };
557
557
  }
@@ -1,7 +1,8 @@
1
1
  import * as yup from 'yup';
2
2
  import * as semver from 'semver';
3
3
  import * as isRegex from 'is-regex';
4
- import { DesktopifyApp2 } from '.';
4
+ import { DesktopifyApp2 } from './desktopify2';
5
+ import { DesktopAppPlugin } from './plugin';
5
6
  export const appTitleValidation = yup
6
7
  .string()
7
8
  .label('App title')
@@ -174,7 +175,9 @@ export const appConfigValidation = yup.object({
174
175
  .required(),
175
176
  });
176
177
 
177
- export const shouldMinimizeToTrayIsActive = (desktopApp: DesktopifyApp2) => {
178
+ export const shouldMinimizeToTrayIsActive = <Plugin = DesktopAppPlugin>(
179
+ desktopApp: DesktopifyApp2<Plugin>
180
+ ) => {
178
181
  return desktopApp.trays.some(
179
182
  (t) =>
180
183
  t.leftClick.role === 'toggleMenu' || t.rightClick.role === 'toggleMenu'