@todesktop/shared 7.184.25 → 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.
- package/lib/desktopify2.d.ts +11 -7
- package/lib/validations.d.ts +3 -2
- package/package.json +1 -1
- package/src/desktopify2.ts +12 -7
- package/src/validations.ts +5 -2
package/lib/desktopify2.d.ts
CHANGED
|
@@ -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?: (
|
|
356
|
+
plugins?: (Plugin | string)[];
|
|
357
357
|
/**
|
|
358
358
|
* The app's windows
|
|
359
359
|
*/
|
|
@@ -408,13 +408,17 @@ export interface DesktopifyApp2 {
|
|
|
408
408
|
* @default false
|
|
409
409
|
*/
|
|
410
410
|
isSecure?: boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Prevents the window contents from being captured by other apps.
|
|
413
|
+
*/
|
|
414
|
+
shouldProtectContent?: boolean;
|
|
411
415
|
}
|
|
412
|
-
export interface IApp2 extends BaseApp {
|
|
413
|
-
desktopApp: DesktopifyApp2
|
|
416
|
+
export interface IApp2<Plugin = DesktopAppPlugin> extends BaseApp {
|
|
417
|
+
desktopApp: DesktopifyApp2<Plugin>;
|
|
414
418
|
desktopAppOverrides?: {
|
|
415
|
-
linux?: Partial<DesktopifyApp2
|
|
416
|
-
mac?: Partial<DesktopifyApp2
|
|
417
|
-
windows?: Partial<DesktopifyApp2
|
|
419
|
+
linux?: Partial<DesktopifyApp2<Plugin>>;
|
|
420
|
+
mac?: Partial<DesktopifyApp2<Plugin>>;
|
|
421
|
+
windows?: Partial<DesktopifyApp2<Plugin>>;
|
|
418
422
|
};
|
|
419
423
|
}
|
|
420
424
|
export {};
|
package/lib/validations.d.ts
CHANGED
|
@@ -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
package/src/desktopify2.ts
CHANGED
|
@@ -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?: (
|
|
484
|
+
plugins?: (Plugin | string)[];
|
|
485
485
|
/**
|
|
486
486
|
* The app's windows
|
|
487
487
|
*/
|
|
@@ -538,15 +538,20 @@ export interface DesktopifyApp2 {
|
|
|
538
538
|
* @default false
|
|
539
539
|
*/
|
|
540
540
|
isSecure?: boolean;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Prevents the window contents from being captured by other apps.
|
|
544
|
+
*/
|
|
545
|
+
shouldProtectContent?: boolean;
|
|
541
546
|
}
|
|
542
547
|
|
|
543
|
-
export interface IApp2 extends BaseApp {
|
|
548
|
+
export interface IApp2<Plugin = DesktopAppPlugin> extends BaseApp {
|
|
544
549
|
// Be careful when coercing to `IApp2` that we always check for `desktopApp` first
|
|
545
|
-
desktopApp: DesktopifyApp2
|
|
550
|
+
desktopApp: DesktopifyApp2<Plugin>;
|
|
546
551
|
|
|
547
552
|
desktopAppOverrides?: {
|
|
548
|
-
linux?: Partial<DesktopifyApp2
|
|
549
|
-
mac?: Partial<DesktopifyApp2
|
|
550
|
-
windows?: Partial<DesktopifyApp2
|
|
553
|
+
linux?: Partial<DesktopifyApp2<Plugin>>;
|
|
554
|
+
mac?: Partial<DesktopifyApp2<Plugin>>;
|
|
555
|
+
windows?: Partial<DesktopifyApp2<Plugin>>;
|
|
551
556
|
};
|
|
552
557
|
}
|
package/src/validations.ts
CHANGED
|
@@ -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 =
|
|
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'
|