-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathindex.ts
More file actions
36 lines (33 loc) · 1.32 KB
/
index.ts
File metadata and controls
36 lines (33 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { DesktopAgent } from '@finos/fdc3-standard';
import { getAgent } from './strategies/getAgent.js';
import { AbstractUIComponent } from './ui/AbstractUIComponent.js';
import { DefaultDesktopAgentChannelSelector } from './ui/DefaultDesktopAgentChannelSelector.js';
import { DefaultDesktopAgentIntentResolver } from './ui/DefaultDesktopAgentIntentResolver.js';
import { NullChannelSelector } from './ui/NullChannelSelector.js';
import { NullIntentResolver } from './ui/NullIntentResolver.js';
const DEFAULT_WAIT_FOR_MS = 20000;
export {
getAgent,
AbstractUIComponent,
DefaultDesktopAgentChannelSelector,
DefaultDesktopAgentIntentResolver,
NullChannelSelector,
NullIntentResolver,
};
/**
* Replaces the original fdc3Ready function from FDC3 2.0 with a new one that uses the new getAgent function.
*
* @param waitForMs Amount of time to wait before failing the promise (20 seconds is the default).
* @returns A DesktopAgent promise.
*
* @deprecated This function is provided for backwards compatibility. Use `const fdc3 = getAgent()` to retrieve (and
* wait for) a reference to the FDC3 API instead.
*/
export function fdc3Ready(waitForMs = DEFAULT_WAIT_FOR_MS): Promise<DesktopAgent> {
return getAgent({
timeoutMs: waitForMs,
dontSetWindowFdc3: false,
channelSelector: true,
intentResolver: true,
});
}