@todesktop/shared 7.114.0 → 7.115.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.
package/lib/plugin.d.ts CHANGED
@@ -1,6 +1,14 @@
1
1
  export interface DesktopAppPlugin {
2
- package: string;
2
+ /**
3
+ * Configuration gathered from the todesktop plugin.
4
+ * Named `todesktop` to clarify that it maps to the `todesktop` key on the package.json
5
+ */
3
6
  todesktop?: ToDesktopPlugin;
7
+ /**
8
+ * Package name, including version information.
9
+ * e.g. "@todesktop/plugin-foo", "@todesktop/plugin-baz@1.0.0"
10
+ */
11
+ package: string;
4
12
  }
5
13
  export declare type ToDesktopPlugin = {
6
14
  namespace: string;
@@ -10,26 +18,33 @@ export declare type ToDesktopPlugin = {
10
18
  preferences?: PluginPreferences;
11
19
  };
12
20
  export declare type PluginPreferences = {
13
- [id: string]: PluginSpecs;
21
+ [id: string]: PluginPreference;
14
22
  };
15
- export declare type PluginSpecs = NumberSpec | TextSpec;
23
+ export declare type PluginPreference = NumberSpec | TextSpec;
16
24
  export declare type TextSpec = PreferenceSpec<"text", {
17
25
  minLength?: number;
18
26
  maxLength?: number;
19
27
  pattern?: RegExp;
28
+ value?: string;
20
29
  defaultValue?: string;
21
30
  placeholder?: string;
22
31
  }>;
32
+ export declare type TextValue = PreferenceValue<string>;
23
33
  export declare type NumberSpec = PreferenceSpec<"number", {
24
34
  min?: number;
25
35
  max?: number;
36
+ value?: number;
26
37
  defaultValue?: number;
27
38
  placeholder?: number;
28
39
  }>;
40
+ export declare type NumberValue = PreferenceValue<string>;
29
41
  interface PreferenceSpec<T, V> {
30
42
  name: string;
31
43
  description: string;
32
44
  type: T;
33
45
  value: V;
34
46
  }
47
+ interface PreferenceValue<V> {
48
+ value: V;
49
+ }
35
50
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.114.0",
3
+ "version": "7.115.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/plugin.ts CHANGED
@@ -1,6 +1,15 @@
1
1
  export interface DesktopAppPlugin {
2
- package: string; // e.g. ["@todesktop/plugin-foo", "@todesktop/plugin-baz@1.0.0"]
2
+ /**
3
+ * Configuration gathered from the todesktop plugin.
4
+ * Named `todesktop` to clarify that it maps to the `todesktop` key on the package.json
5
+ */
3
6
  todesktop?: ToDesktopPlugin;
7
+
8
+ /**
9
+ * Package name, including version information.
10
+ * e.g. "@todesktop/plugin-foo", "@todesktop/plugin-baz@1.0.0"
11
+ */
12
+ package: string;
4
13
  }
5
14
 
6
15
  export type ToDesktopPlugin = {
@@ -12,10 +21,10 @@ export type ToDesktopPlugin = {
12
21
  };
13
22
 
14
23
  export type PluginPreferences = {
15
- [id: string]: PluginSpecs;
24
+ [id: string]: PluginPreference;
16
25
  };
17
26
 
18
- export type PluginSpecs = NumberSpec | TextSpec;
27
+ export type PluginPreference = NumberSpec | TextSpec;
19
28
 
20
29
  export type TextSpec = PreferenceSpec<
21
30
  "text",
@@ -23,20 +32,24 @@ export type TextSpec = PreferenceSpec<
23
32
  minLength?: number;
24
33
  maxLength?: number;
25
34
  pattern?: RegExp;
35
+ value?: string;
26
36
  defaultValue?: string;
27
37
  placeholder?: string;
28
38
  }
29
39
  >;
40
+ export type TextValue = PreferenceValue<string>;
30
41
 
31
42
  export type NumberSpec = PreferenceSpec<
32
43
  "number",
33
44
  {
34
45
  min?: number;
35
46
  max?: number;
47
+ value?: number;
36
48
  defaultValue?: number;
37
49
  placeholder?: number;
38
50
  }
39
51
  >;
52
+ export type NumberValue = PreferenceValue<string>;
40
53
 
41
54
  interface PreferenceSpec<T, V> {
42
55
  name: string;
@@ -44,3 +57,7 @@ interface PreferenceSpec<T, V> {
44
57
  type: T;
45
58
  value: V;
46
59
  }
60
+
61
+ interface PreferenceValue<V> {
62
+ value: V;
63
+ }