@openfin/core 30.73.19 → 30.73.21

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/fdc3.ts DELETED
@@ -1,264 +0,0 @@
1
- import * as OpenFin from './src/OpenFin';
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-namespace
4
- export declare namespace FDC3 {
5
- interface DesktopAgent {
6
- addContextListener(contextType: string | null, handler: OpenFin.ContextHandler): Listener & Promise<Listener>;
7
- broadcast(context: OpenFin.Context): Promise<void>;
8
- getSystemChannels(): Promise<OpenFin.ContextGroupInfo[]>;
9
- joinChannel(channelId: string): Promise<void>;
10
- leaveCurrentChannel(): Promise<void>;
11
- addIntentListener(intent: string, handler: OpenFin.ContextHandler): Listener & Promise<Listener>;
12
- raiseIntent(intent: string, context: OpenFin.Context, app?: TargetApp): Promise<IntentResolution>;
13
- findIntent(intent: string, context?: OpenFin.Context): Promise<AppIntent>;
14
- findIntentsByContext(context: OpenFin.Context): Promise<Array<AppIntent>>;
15
- raiseIntentForContext(context: OpenFin.Context, app?: TargetApp): Promise<IntentResolution>;
16
- getInfo(): ImplementationMetadata;
17
- open(app: FDC3.TargetApp, context?: OpenFin.Context): Promise<void>;
18
- getOrCreateChannel(channelId: string): Promise<Channel>;
19
- getCurrentChannel(): Promise<Channel | null>;
20
- }
21
-
22
- interface Listener {
23
- unsubscribe(): void;
24
- }
25
-
26
- interface AppMetadata {
27
- name: string;
28
- appId?: string;
29
- version?: string;
30
- title?: string;
31
- tooltip?: string;
32
- description?: string;
33
- icons?: Array<string>;
34
- images?: Array<string>;
35
- }
36
-
37
- type TargetApp = string | AppMetadata;
38
-
39
- type Intent = OpenFin.Intent<IntentMetadata>;
40
-
41
- type IntentMetadata = OpenFin.IntentMetadata<TargetApp>;
42
-
43
- interface IntentResolution {
44
- source: TargetApp | null;
45
- version: string | null;
46
- data?: any;
47
- }
48
-
49
- interface DisplayMetadata {
50
- name?: string;
51
- color?: string;
52
- glpyh?: string;
53
- }
54
- interface Channel {
55
- id: string;
56
- type: string;
57
- displayMetadata?: DisplayMetadata;
58
- addContextListener(contextType: string, handler: OpenFin.ContextHandler): Listener & Promise<Listener>;
59
- broadcast(context: OpenFin.Context): Promise<void>;
60
- getCurrentContext(contextType?: string): Promise<OpenFin.Context | null>;
61
- }
62
-
63
- interface AppIntent {
64
- intent: Intent;
65
- apps: Array<AppMetadata>;
66
- }
67
-
68
- interface ImplementationMetadata {
69
- fdc3Version: string;
70
- provider: string;
71
- providerVersion?: string;
72
- }
73
- }
74
-
75
- // eslint-disable-next-line @typescript-eslint/no-namespace
76
- export declare namespace FDC3v2 {
77
- interface DesktopAgent {
78
- // apps
79
- open(app: AppIdentifier | FDC3.TargetApp, context?: OpenFin.Context): Promise<AppIdentifier | void>;
80
- findInstances(app: AppIdentifier): Promise<Array<AppIdentifier>>;
81
- getAppMetadata(app: AppIdentifier): Promise<AppMetadata>;
82
-
83
- // context
84
- broadcast(context: OpenFin.Context): Promise<void>;
85
- addContextListener(contextType: string | null, handler: OpenFin.ContextHandler): Promise<FDC3.Listener>;
86
-
87
- // intents
88
- findIntent(intent: string, context?: OpenFin.Context, resultType?: string): Promise<AppIntent>;
89
- findIntentsByContext(context: OpenFin.Context, resultType?: string): Promise<Array<AppIntent>>;
90
- raiseIntent(
91
- intent: string,
92
- context: OpenFin.Context,
93
- app?: AppIdentifier | FDC3.TargetApp
94
- ): Promise<IntentResolution>;
95
- raiseIntentForContext(
96
- context: OpenFin.Context,
97
- app?: AppIdentifier | FDC3.TargetApp
98
- ): Promise<IntentResolution>;
99
- addIntentListener(intent: string, handler: IntentHandler): Promise<FDC3.Listener>;
100
-
101
- // channels
102
- getOrCreateChannel(channelId: string): Promise<FDC3.Channel>;
103
- createPrivateChannel(): Promise<PrivateChannel | void>;
104
- getUserChannels(): Promise<Array<OpenFin.ContextGroupInfo>>;
105
-
106
- // OPTIONAL channel management functions
107
- joinUserChannel(channelId: string): Promise<void>;
108
- getCurrentChannel(): Promise<FDC3.Channel | null>;
109
- leaveCurrentChannel(): Promise<void>;
110
-
111
- // implementation info
112
- getInfo(): Promise<FDC3.ImplementationMetadata>;
113
- }
114
-
115
- interface AppIdentifier {
116
- appId: string;
117
- instanceId?: string;
118
- }
119
- interface Listener {
120
- unsubscribe(): Promise<void>;
121
- }
122
-
123
- interface Channel {
124
- id: string;
125
- type: string;
126
- displayMetadata?: FDC3.DisplayMetadata;
127
- addContextListener(contextType: string, handler: OpenFin.ContextHandler): Promise<FDC3v2.Listener>;
128
- broadcast(context: OpenFin.Context): Promise<void>;
129
- getCurrentContext(contextType?: string): Promise<OpenFin.Context | null>;
130
- }
131
-
132
- interface PrivateChannel extends FDC3v2.Channel {
133
- // methods
134
- onAddContextListener(handler: (contextType?: string) => void): FDC3v2.Listener;
135
- onUnsubscribe(handler: (contextType?: string) => void): FDC3v2.Listener;
136
- onDisconnect(handler: () => void): FDC3v2.Listener;
137
- disconnect(): void;
138
- }
139
-
140
- interface FindIntentsByContextOptions {
141
- context: OpenFin.Context;
142
- resultType?: string;
143
- }
144
-
145
- interface ContextMetadata {
146
- /** Identifier for the app instance that sent the context and/or intent.
147
- * @experimental
148
- */
149
- readonly source: AppIdentifier;
150
- }
151
-
152
- interface IntentMetadata {
153
- /** The unique name of the intent that can be invoked by the raiseIntent call. */
154
- readonly name: string;
155
-
156
- /** A friendly display name for the intent that should be used to render UI
157
- * elements.
158
- */
159
- readonly displayName: string;
160
- }
161
-
162
- type ContextHandler = (context: OpenFin.Context, metadata?: ContextMetadata) => void;
163
- type IntentHandler = (context: OpenFin.Context, metadata?: ContextMetadata) => Promise<IntentResult> | void;
164
-
165
- type IntentResult = OpenFin.Context | FDC3.Channel | PrivateChannel;
166
- interface Icon {
167
- src: string;
168
- size?: string;
169
- type?: string;
170
- }
171
-
172
- interface Image {
173
- src: string;
174
- size?: string;
175
- type?: string;
176
- label?: string;
177
- }
178
-
179
- interface AppMetadata extends AppIdentifier {
180
- name?: string;
181
- instanceMetadata?: Record<string, any>;
182
- title?: string;
183
- tooltip?: string;
184
- description?: string;
185
- icons?: Array<Icon>;
186
- screenshots?: Array<Image>;
187
- resultType?: string | null;
188
- }
189
-
190
- interface IntentResolution {
191
- /** Identifier for the app instance that was selected (or started) to resolve
192
- * the intent. `source.instanceId` MUST be set, indicating the specific app
193
- * instance that received the intent.
194
- */
195
- readonly source: AppIdentifier;
196
-
197
- /** The intent that was raised. May be used to determine which intent the user
198
- * chose in response to `fdc3.raiseIntentForContext()`.
199
- */
200
- readonly intent: string;
201
-
202
- /** The version number of the Intents schema being used.
203
- */
204
- readonly version?: string;
205
-
206
- /** Retrieves a promise that will resolve to either `Context` data returned
207
- * by the application that resolves the raised intent or a `Channel`
208
- * established and returned by the app resolving the intent.
209
- *
210
- * A `Channel` returned MAY be of the `PrivateChannel` type. The
211
- * client can then `addContextListener()` on that channel to, for example,
212
- * receive a stream of data.
213
- *
214
- * If an error occurs (i.e. an error is thrown by the handler function,
215
- * the promise it returns is rejected, or a promise is not returned by the
216
- * handler function) then the Desktop Agent MUST reject the promise returned
217
- * by the `getResult()` function of the `IntentResolution` with a string from
218
- * the `ResultError` enumeration.
219
- */
220
-
221
- // getResult() will be implemented in a future PR
222
- getResult(): Promise<IntentResult>;
223
- }
224
-
225
- interface ImplementationMetadata {
226
- /** The version number of the FDC3 specification that the implementation
227
- * provides. The string must be a numeric semver version, e.g. 1.2 or 1.2.1.
228
- */
229
- readonly fdc3Version: string;
230
-
231
- /** The name of the provider of the FDC3 Desktop Agent Implementation
232
- * (e.g.Finsemble, Glue42, OpenFin etc.).
233
- */
234
- readonly provider: string;
235
-
236
- /** The version of the provider of the FDC3 Desktop Agent Implementation
237
- * (e.g. 5.3.0).
238
- */
239
- readonly providerVersion?: string;
240
-
241
- /** Metadata indicating whether the Desktop Agent implements optional features of
242
- * the Desktop Agent API.
243
- */
244
- readonly optionalFeatures: {
245
- /** Used to indicate whether the exposure of 'originating app metadata' for
246
- * context and intent messages is supported by the Desktop Agent. */
247
- OriginatingAppMetadata: boolean;
248
- /** Used to indicate whether the optional `fdc3.joinUserChannel`,
249
- * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by
250
- * the Desktop Agent. */
251
- UserChannelMembershipAPIs: boolean;
252
- };
253
-
254
- /** The calling application instance's own metadata, according to the
255
- * Desktop Agent (MUST include at least the `appId` and `instanceId`).
256
- */
257
- readonly appMetadata: AppMetadata;
258
- }
259
-
260
- interface AppIntent {
261
- intent: IntentMetadata;
262
- apps: Array<AppMetadata>;
263
- }
264
- }