@interopio/intent-resolver-ui 1.1.1-beta.0 → 1.1.2

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.
@@ -1,116 +1,131 @@
1
- import { ComponentType } from "react";
2
-
3
- export type IOBrowserIntentResolverUIFactoryFunction = (io: any, config: IOBrowserIntentResolverUI.Config) => Promise<IOBrowserIntentResolverUI.API>;
4
-
5
- declare const IOBrowserIntentResolverUIFactory: IOBrowserIntentResolverUIFactoryFunction;
6
-
7
- export default IOBrowserIntentResolverUIFactory;
8
-
9
- export namespace IOBrowserIntentResolverUI {
10
- export interface IntentResolverProps {
11
- io: any;
12
- config: (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { uiSettings?: UISettings };
13
- onUserResponse: (response: IntentResolverResponse) => void;
14
- }
15
-
16
- export interface Config {
17
- enable: boolean;
18
- rootElement: HTMLDivElement;
19
- CustomIntentResolver?: ComponentType<IntentResolverProps>;
20
- }
21
-
22
- export interface API {
23
- open: (config: OpenConfig) => OpenResult;
24
- close: (config: CloseConfig) => void;
25
- }
26
-
27
- export interface OpenConfigWithIntentRequest {
28
- intentRequest: IntentRequest;
29
- handlerFilter?: never;
30
- }
31
-
32
- export interface OpenConfigWithHandlerFilter {
33
- handlerFilter: HandlerFilter;
34
- intentRequest?: never;
35
- }
36
-
37
- export interface UISettings {
38
- showCloseButton?: boolean;
39
- }
40
-
41
- export type OpenConfig = (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { onUserResponse: (response: { response: IntentResolverResponse }) => void, uiSettings?: UISettings };
42
-
43
- export interface UserSettings {
44
- preserveChoice: boolean;
45
- }
46
-
47
- export interface UserChoiceResponse {
48
- intent: string;
49
- handler: IntentHandler;
50
- userSettings: UserSettings;
51
- }
52
-
53
- export interface IntentResolverResponse {
54
- isExpired?: boolean;
55
- isClosed?: boolean;
56
- userChoice?: UserChoiceResponse;
57
- }
58
-
59
- export interface OpenResult {
60
- id: string;
61
- }
62
-
63
- export interface CloseConfig {
64
- id: string;
65
- }
66
-
67
- interface ApplicationStartOptions {
68
- top?: number;
69
- left?: number;
70
- width?: number;
71
- height?: number;
72
- relativeTo?: string;
73
- relativeDirection?: "top" | "left" | "right" | "bottom";
74
- waitForAGMReady?: boolean;
75
- channelId?: string;
76
- }
77
-
78
- interface IntentContext {
79
- readonly type?: string;
80
- readonly data?: { [key: string]: any };
81
- }
82
-
83
- interface IntentHandler {
84
- applicationName: string;
85
- applicationTitle?: string;
86
- applicationDescription?: string;
87
- applicationIcon?: string;
88
- type: "app" | "instance";
89
- displayName?: string;
90
- contextTypes?: string[];
91
- instanceId?: string;
92
- instanceTitle?: string;
93
- resultType?: string;
94
- }
95
-
96
- interface IntentRequest {
97
- readonly intent: string;
98
- readonly target?: "startNew" | "reuse" | { app?: string; instance?: string };
99
- readonly context?: IntentContext;
100
- readonly options?: ApplicationStartOptions;
101
- readonly handlers?: IntentHandler[];
102
- readonly timeout?: number;
103
- readonly waitUserResponseIndefinitely?: boolean;
104
- readonly clearSavedHandler?: boolean;
105
- }
106
-
107
- interface HandlerFilter {
108
- title?: string;
109
- openResolver?: boolean;
110
- timeout?: number;
111
- intent?: string;
112
- contextTypes?: string[];
113
- resultType?: string;
114
- applicationNames?: string[];
115
- }
116
- }
1
+ import { ComponentType } from "react";
2
+
3
+ export type IOBrowserIntentResolverUIFactoryFunction = (io: any, config: IOBrowserIntentResolverUI.Config) => Promise<IOBrowserIntentResolverUI.API>;
4
+
5
+ declare const IOBrowserIntentResolverUIFactory: IOBrowserIntentResolverUIFactoryFunction;
6
+
7
+ export default IOBrowserIntentResolverUIFactory;
8
+
9
+ export namespace IOBrowserIntentResolverUI {
10
+ export interface IntentResolverProps {
11
+ io: any;
12
+ config: (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { uiSettings?: UISettings };
13
+ onUserResponse: (response: IntentResolverResponse) => void;
14
+ }
15
+
16
+ export interface Config {
17
+ enable: boolean;
18
+ rootElement: HTMLDivElement;
19
+ CustomIntentResolver?: ComponentType<IntentResolverProps>;
20
+ }
21
+
22
+ export interface API {
23
+ open: (config: OpenConfig) => OpenResult;
24
+ close: (config: CloseConfig) => void;
25
+ }
26
+
27
+ export interface OpenConfigWithIntentRequest {
28
+ intentRequest: IntentRequest;
29
+ handlerFilter?: never;
30
+ }
31
+
32
+ export interface OpenConfigWithHandlerFilter {
33
+ handlerFilter: HandlerFilter;
34
+ intentRequest?: never;
35
+ }
36
+
37
+ export interface UISettings {
38
+ showCloseButton?: boolean;
39
+ }
40
+
41
+ export type OpenConfig = (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { onUserResponse: (response: { response: IntentResolverResponse }) => void, uiSettings?: UISettings };
42
+
43
+ export interface UserSettings {
44
+ preserveChoice: boolean;
45
+ }
46
+
47
+ export interface UserChoiceResponse {
48
+ intent: string;
49
+ handler: IntentHandler;
50
+ userSettings: UserSettings;
51
+ }
52
+
53
+ export interface IntentResolverResponse {
54
+ isExpired?: boolean;
55
+ isClosed?: boolean;
56
+ userChoice?: UserChoiceResponse;
57
+ }
58
+
59
+ export interface OpenResult {
60
+ id: string;
61
+ }
62
+
63
+ export interface CloseConfig {
64
+ id: string;
65
+ }
66
+
67
+ interface ApplicationStartOptions {
68
+ top?: number;
69
+ left?: number;
70
+ width?: number;
71
+ height?: number;
72
+ relativeTo?: string;
73
+ relativeDirection?: "top" | "left" | "right" | "bottom";
74
+ waitForAGMReady?: boolean;
75
+ channelId?: string;
76
+ }
77
+
78
+ interface IntentContext {
79
+ readonly type?: string;
80
+ readonly data?: { [key: string]: any };
81
+ }
82
+
83
+ interface IntentHandler {
84
+ applicationName: string;
85
+ applicationTitle?: string;
86
+ applicationDescription?: string;
87
+ applicationIcon?: string;
88
+ type: "app" | "instance";
89
+ displayName?: string;
90
+ contextTypes?: string[];
91
+ instanceId?: string;
92
+ instanceTitle?: string;
93
+ resultType?: string;
94
+ }
95
+
96
+ interface IntentRequest {
97
+ readonly intent: string;
98
+ readonly target?: "startNew" | "reuse" | { app?: string; instance?: string };
99
+ readonly context?: IntentContext;
100
+ readonly options?: ApplicationStartOptions;
101
+ readonly handlers?: IntentHandler[];
102
+ readonly timeout?: number;
103
+ readonly waitUserResponseIndefinitely?: boolean;
104
+ readonly clearSavedHandler?: boolean;
105
+ }
106
+
107
+ type HandlerExclusionCriteria = {
108
+ /**
109
+ * Name of the application to exclude. All Intent Handlers (both app and instance type) from that application will be excluded.
110
+ * When excluding by applicationName, the instanceId is not required.
111
+ */
112
+ applicationName: string;
113
+ } | {
114
+ /**
115
+ * ID of the specific instance to exclude.
116
+ * When excluding by instanceId, the applicationName is not required.
117
+ */
118
+ instanceId: string;
119
+ }
120
+
121
+ interface HandlerFilter {
122
+ title?: string;
123
+ openResolver?: boolean;
124
+ timeout?: number;
125
+ intent?: string;
126
+ contextTypes?: string[];
127
+ resultType?: string;
128
+ applicationNames?: string[];
129
+ excludeList?: HandlerExclusionCriteria[];
130
+ }
131
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interopio/intent-resolver-ui",
3
- "version": "1.1.1-beta.0",
3
+ "version": "1.1.2",
4
4
  "types": "./intent.resolver.ui.d.ts",
5
5
  "scripts": {
6
6
  "start": "vite",
@@ -37,14 +37,14 @@
37
37
  "react": ">=16.8.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@interopio/browser": "^4.1.1-beta.0",
41
- "@interopio/components-react": "^0.8.1-beta.0",
42
- "@interopio/theme": "^3.1.1-beta.0",
43
- "@interopio/utils": "^2.1.1-beta.0"
40
+ "@interopio/browser": "^4.1.2",
41
+ "@interopio/components-react": "^0.8.1",
42
+ "@interopio/theme": "^3.1.0",
43
+ "@interopio/utils": "^2.1.0"
44
44
  },
45
45
  "publishConfig": {
46
46
  "@interopio:registry": "https://registry.npmjs.org",
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "709a886c38021f8cbeda2ae4ece1af42e0cfaba1"
49
+ "gitHead": "faff5ba208b3c171a399b377b854a5822752bfbc"
50
50
  }