@openfin/core 30.73.20 → 30.73.22

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/OpenFin.d.ts +75 -27
  3. package/src/OpenFin.js +2 -0
  4. package/src/api/events/system.d.ts +18 -3
  5. package/src/api/events/typedEventEmitter.d.ts +13 -0
  6. package/{fdc3.js → src/api/events/typedEventEmitter.js} +0 -0
  7. package/src/api/frame/Instance.d.ts +2 -1
  8. package/src/api/global-hotkey/index.d.ts +2 -1
  9. package/src/api/interop/InteropBroker.d.ts +6 -5
  10. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +8 -8
  11. package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -15
  12. package/src/api/interop/fdc3/fdc3-2.0.d.ts +23 -23
  13. package/src/api/interop/fdc3/fdc3-2.0.js +9 -9
  14. package/src/api/interop/fdc3/fdc3.d.ts +13 -0
  15. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
  16. package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
  17. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
  18. package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
  19. package/src/api/interop/fdc3/utils.d.ts +7 -6
  20. package/src/api/interop/fdc3/utils.js +2 -2
  21. package/src/api/platform/Instance.d.ts +14 -1
  22. package/src/api/platform/Instance.js +15 -0
  23. package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
  24. package/src/api/platform/layout/utils/bounds-observer.js +2 -2
  25. package/src/api/system/index.d.ts +15 -483
  26. package/src/api/system/index.js +51 -471
  27. package/src/api/view/Instance.d.ts +11 -2
  28. package/src/api/view/Instance.js +16 -0
  29. package/src/api/window/Instance.d.ts +2 -1
  30. package/src/fdc3.d.ts +3 -0
  31. package/src/mock.d.ts +1 -1
  32. package/src/shapes/protocol.d.ts +3 -1
  33. package/fdc3.ts +0 -264
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "30.73.20",
3
+ "version": "30.73.22",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./src/mock.js",
6
6
  "types": "./src/mock.d.ts",
package/src/OpenFin.d.ts CHANGED
@@ -1,17 +1,27 @@
1
- export declare type Fin<MeType extends EntityType = 'window' | 'view'> = import('./api/fin').FinApi<MeType>;
2
- export declare type Application = import('./api/application/index').Application;
3
- export declare type ExternalApplication = import('./api/external-application/index').ExternalApplication;
4
- export declare type Frame = import('./api/frame/index')._Frame;
5
- export declare type ChannelClient = import('./api/interappbus/channel/client').default;
6
- export declare type ChannelProvider = import('./api/interappbus/channel/provider').ChannelProvider;
7
- export declare type Platform = import('./api/platform/index').Platform;
8
- export declare type Layout = import('./api/platform/layout/index').Layout;
9
- export declare type View = import('./api/view/index').View;
10
- export declare type Window = import('./api/window/index')._Window;
11
- export declare type WebContent = View | Window;
12
- export declare type InteropClient = import('./api/interop/index').InteropClient;
13
- export declare type InteropBroker = import('./api/interop/index').InteropBroker;
14
- export declare type SnapshotSource = import('./api/snapshot-source/index').SnapshotSource;
1
+ import type { Application } from './api/application';
2
+ import { ApplicationEvents } from './api/events/application';
3
+ import { ExternalApplicationEvents } from './api/events/externalApplication';
4
+ import { FrameEvents } from './api/events/frame';
5
+ import { GlobalHotkeyEvents } from './api/events/globalHotkey';
6
+ import { PlatformEvents } from './api/events/platform';
7
+ import { SystemEvents } from './api/events/system';
8
+ import { ViewEvents } from './api/events/view';
9
+ import { WindowEvents, WindowOptionsChangedEvent } from './api/events/window';
10
+ import type { ExternalApplication } from './api/external-application';
11
+ import { FinApi } from './api/fin';
12
+ import type { _Frame } from './api/frame';
13
+ import type ChannelClient from './api/interappbus/channel/client';
14
+ import { MessagingProtocols } from './api/interappbus/channel/protocols';
15
+ import type { ChannelProvider } from './api/interappbus/channel/provider';
16
+ import type { InteropBroker, InteropClient } from './api/interop';
17
+ import type { Platform } from './api/platform';
18
+ import type { Layout } from './api/platform/layout';
19
+ import { SnapshotSource } from './api/snapshot-source';
20
+ import type { View } from './api/view';
21
+ import { _Window } from './api/window';
22
+ export declare type Fin<MeType extends EntityType = 'window' | 'view'> = FinApi<MeType>;
23
+ export type { Application, ExternalApplication, _Frame as Frame, ChannelClient, ChannelProvider, Platform, Layout, View, _Window as Window, InteropClient, InteropBroker, SnapshotSource };
24
+ export declare type WebContent = View | _Window;
15
25
  export declare type ApplicationIdentity = {
16
26
  uuid: string;
17
27
  };
@@ -419,6 +429,12 @@ export declare type ConstViewOptions = {
419
429
  enableBeforeUnload: boolean;
420
430
  accelerator?: Partial<Accelerator>;
421
431
  };
432
+ export declare type ViewState = ViewCreationOptions & {
433
+ backgroundThrottling: boolean;
434
+ componentName: 'view';
435
+ initialUrl: string;
436
+ minWidth?: number;
437
+ };
422
438
  export declare type Certificate = {
423
439
  data: string;
424
440
  fingerprint: string;
@@ -655,7 +671,7 @@ export declare type PlatformProvider = {
655
671
  * @param { Identity } [identity] If {@link Platform#createWindow Platform.createWindow} was called, the identity of the caller will be here.
656
672
  * If `createWindow` was called as part of applying a snapshot or creating a view without a target window, `identity` will be undefined.
657
673
  */
658
- createWindow(options: PlatformWindowCreationOptions, identity?: Identity): Promise<Window>;
674
+ createWindow(options: PlatformWindowCreationOptions, identity?: Identity): Promise<_Window>;
659
675
  /**
660
676
  * Gets the current state of windows and their views and returns a snapshot object containing that info.
661
677
  * @param { undefined } payload Undefined unless you've defined a custom `getSnapshot` protocol.
@@ -663,6 +679,14 @@ export declare type PlatformProvider = {
663
679
  * @return { Promise<Snapshot> } Snapshot of current platform state.
664
680
  */
665
681
  getSnapshot(payload: undefined, identity: Identity): Promise<Snapshot>;
682
+ /**
683
+ * Gets the current state of a single view and returns an object with the options needed to restore that view as part of a snapshot.
684
+ * @param { Identity } payload Identity of the view.
685
+ * @return { Promise<ViewState> }
686
+ */
687
+ getViewSnapshot(payload: {
688
+ viewIdentity: Identity;
689
+ }): Promise<ViewState>;
666
690
  /**
667
691
  * Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen.
668
692
  * Returns an array of windows with modified positions, such that any off-screen windows are positioned in the top left
@@ -746,7 +770,7 @@ export declare type PlatformProvider = {
746
770
  * The new context will be contained as `payload.diff.customContext.newVal`.
747
771
  * @return { Promise<HostContextChangedPayload> } The event that it raised.
748
772
  */
749
- onWindowContextUpdated(payload: import('./api/events/window').WindowOptionsChangedEvent<'window', 'options-changed'>): Promise<HostContextChangedPayload | undefined>;
773
+ onWindowContextUpdated(payload: WindowOptionsChangedEvent<'window', 'options-changed'>): Promise<HostContextChangedPayload | undefined>;
750
774
  /**
751
775
  * Closes a Window.
752
776
  * By default it will fire any before unload handler set by a View in the Window.
@@ -939,10 +963,42 @@ export declare type RVMInfo = {
939
963
  'version': string;
940
964
  'working-dir': string;
941
965
  };
966
+ export declare type AppVersionProgress = {
967
+ manifest: string | null;
968
+ srcManifest: string;
969
+ };
970
+ export declare type AppVersionError = {
971
+ error: string;
972
+ srcManifest: string;
973
+ };
974
+ export declare type AppVersionRuntimeInfo = {
975
+ version: string | null;
976
+ exists: boolean | null;
977
+ writeAccess: boolean | null;
978
+ reachable: boolean | null;
979
+ healthCheck: boolean | null;
980
+ error: string | null;
981
+ };
982
+ export declare type AppVersionProgressEvent = {
983
+ type: 'app-version-progress';
984
+ } & AppVersionProgress;
985
+ export declare type AppVersionErrorEvent = {
986
+ type: 'app-version-error';
987
+ } & AppVersionError;
988
+ export declare type AppVersionCompleteEvent = {
989
+ type: 'app-version-complete';
990
+ } & AppVersionProgress;
991
+ export declare type AppVersionRuntimeStatusEvent = {
992
+ type: 'runtime-status';
993
+ } & AppVersionRuntimeInfo;
994
+ export declare type AppVersionEvents = AppVersionProgressEvent | AppVersionRuntimeStatusEvent | AppVersionCompleteEvent | AppVersionErrorEvent;
995
+ export declare type AppVersionEventNames = AppVersionEvents['type'];
996
+ export declare type LaunchEmitter = import('./api/events/typedEventEmitter').TypedEventEmitter<AppVersionEvents>;
942
997
  export declare type RvmLaunchOptions = {
943
998
  noUi?: boolean;
944
999
  userAppConfigArgs?: object;
945
1000
  timeToLive?: number;
1001
+ subscribe?: (launch: LaunchEmitter) => void;
946
1002
  };
947
1003
  export declare type ShortCutConfig = {
948
1004
  desktop?: boolean;
@@ -1211,7 +1267,7 @@ export declare type SessionContextGroup = {
1211
1267
  unsubscribe: () => void;
1212
1268
  }>;
1213
1269
  };
1214
- export declare type MessagingProtocols = import('./api/interappbus/channel/protocols/index').MessagingProtocols;
1270
+ export type { MessagingProtocols };
1215
1271
  export declare type ChannelCreateOptions = {
1216
1272
  protocols?: MessagingProtocols[];
1217
1273
  };
@@ -1364,7 +1420,7 @@ export interface PopupOptions {
1364
1420
  resultDispatchBehavior?: PopupResultBehavior;
1365
1421
  hideOnClose?: boolean;
1366
1422
  focus?: boolean;
1367
- onPopupReady?: (popupWindow: Window) => any;
1423
+ onPopupReady?: (popupWindow: _Window) => any;
1368
1424
  onPopupResult?: (payload: PopupResult) => any;
1369
1425
  }
1370
1426
  export declare type PopupInteraction = 'clicked' | 'dismissed';
@@ -1377,14 +1433,7 @@ export interface PopupResult<T = any> {
1377
1433
  data?: T;
1378
1434
  lastDispatchResult?: PopupResult;
1379
1435
  }
1380
- export declare type SystemEvents = import('./api/events/system').SystemEvents;
1381
- export declare type ApplicationEvents = import('./api/events/application').ApplicationEvents;
1382
- export declare type WindowEvents = import('./api/events/window').WindowEvents;
1383
- export declare type ViewEvents = import('./api/events/view').ViewEvents;
1384
- export declare type GlobalHotkeyEvents = import('./api/events/globalHotkey').GlobalHotkeyEvents;
1385
- export declare type FrameEvents = import('./api/events/frame').FrameEvents;
1386
- export declare type PlatformEvents = import('./api/events/platform').PlatformEvents;
1387
- export declare type ExternalApplicationEvents = import('./api/events/externalApplication').ExternalApplicationEvents;
1436
+ export type { SystemEvents, ApplicationEvents, WindowEvents, ViewEvents, GlobalHotkeyEvents, FrameEvents, PlatformEvents, ExternalApplicationEvents };
1388
1437
  export declare type ContextMenuOptions = {
1389
1438
  template?: Array<PrebuiltContextMenuItem>;
1390
1439
  enabled?: boolean;
@@ -1401,4 +1450,3 @@ export interface InteropActionLoggingOption {
1401
1450
  }
1402
1451
  export declare type InteropLoggingActions = 'beforeAction' | 'afterAction';
1403
1452
  export declare type InteropLoggingOptions = Record<InteropLoggingActions, InteropActionLoggingOption>;
1404
- export {};
package/src/OpenFin.js CHANGED
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const snapshot_source_1 = require("./api/snapshot-source");
4
+ const window_1 = require("./api/window");
@@ -11,13 +11,28 @@ export declare type MonitorEvent<Topic, Type> = OpenFin.MonitorInfo & BaseEvent<
11
11
  export interface SessionChangedEvent<Topic, Type> extends BaseEvent<Topic, Type> {
12
12
  reason: 'lock' | 'unlock' | 'remote-connect' | 'remote-disconnect' | 'unknown';
13
13
  }
14
- export interface SystemEventMapping<Topic = string, Type = string> extends BaseEventMap {
14
+ export declare type SystemEventMapping<Topic = string, Type = string> = BaseEventMap & {
15
15
  'application-created': ApplicationEvent<Topic, Type>;
16
16
  'desktop-icon-clicked': ApplicationEvent<Topic, Type>;
17
17
  'idle-state-changed': IdleEvent<Topic, Type>;
18
18
  'monitor-info-changed': MonitorEvent<Topic, Type>;
19
19
  'session-changed': SessionChangedEvent<Topic, Type>;
20
- }
20
+ };
21
+ export declare type WithId<T extends AppVersionEventNames> = `${T}.${string}`;
22
+ export declare type WithoutId<T extends string> = T extends WithId<infer U> ? U : never;
23
+ declare type AppVersionEventNames = OpenFin.AppVersionEvents['type'];
24
+ declare type IdEventNames = WithId<AppVersionEventNames>;
25
+ export declare type AppVersionTypeFromIdEvent<T extends IdEventNames> = Extract<OpenFin.AppVersionEvents, {
26
+ type: WithoutId<T>;
27
+ }>;
28
+ export declare type AppVersionEventsWithId = {
29
+ [key in IdEventNames]: Omit<AppVersionTypeFromIdEvent<key>, 'type'> & {
30
+ type: key;
31
+ topic: 'system';
32
+ appVersionId: string;
33
+ };
34
+ };
21
35
  export declare type SystemEvents = PropagatedWindowEvents<'system'> & PropagatedApplicationEvents<'system'> & PropagatedViewEvents<'system'> & {
22
36
  [Type in keyof SystemEventMapping]: SystemEventMapping<'system', Type>[Type];
23
- };
37
+ } & AppVersionEventsWithId;
38
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare type Listener<T extends {
2
+ type: string;
3
+ }> = (payload: T) => void;
4
+ export interface TypedEventEmitter<Events extends {
5
+ type: string;
6
+ }> {
7
+ on<Event extends Events>(event: Event['type'], listener: Listener<Event>): this;
8
+ once<Event extends Events>(event: Event['type'], listener: Listener<Event>): this;
9
+ addListener<Event extends Events>(event: Event['type'], listener: Listener<Event>): this;
10
+ removeListener<Event extends Events>(event: Event['type'], listener: Listener<Event>): this;
11
+ removeAllListeners<Event extends Events>(event?: Event['type']): this;
12
+ emit<Event extends Events>(event: Event['type'], payload: Event): boolean;
13
+ }
File without changes
@@ -1,7 +1,7 @@
1
1
  import * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
3
  import Transport from '../../transport/transport';
4
- import FrameEvents = OpenFin.FrameEvents;
4
+ declare type FrameEvents = OpenFin.FrameEvents;
5
5
  /**
6
6
  * @classdesc
7
7
  * An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
@@ -120,3 +120,4 @@ export declare class _Frame extends EmitterBase<FrameEvents> {
120
120
  */
121
121
  getParentWindow(): Promise<OpenFin.FrameInfo>;
122
122
  }
123
+ export {};
@@ -1,7 +1,7 @@
1
1
  import * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
3
  import Transport from '../../transport/transport';
4
- import GlobalHotkeyEvents = OpenFin.GlobalHotkeyEvents;
4
+ declare type GlobalHotkeyEvents = OpenFin.GlobalHotkeyEvents;
5
5
  /**
6
6
  * The GlobalHotkey module can register/unregister a global hotkeys.
7
7
  * @namespace
@@ -37,3 +37,4 @@ export default class GlobalHotkey extends EmitterBase<GlobalHotkeyEvents> {
37
37
  */
38
38
  isRegistered(hotkey: string): Promise<boolean>;
39
39
  }
40
+ export {};
@@ -1,4 +1,5 @@
1
- import { FDC3, FDC3v2 } from '../../../fdc3';
1
+ import { TargetApp } from './fdc3/shapes/fdc3v1';
2
+ import { AppIdentifier } from './fdc3/shapes/fdc3v2';
2
3
  import * as OpenFin from '../../OpenFin';
3
4
  import { Base } from '../base';
4
5
  import type Transport from '../../transport/transport';
@@ -358,23 +359,23 @@ export declare class InteropBroker extends Base {
358
359
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
359
360
  */
360
361
  fdc3HandleOpen({ app, context }: {
361
- app: FDC3.TargetApp | FDC3v2.AppIdentifier;
362
+ app: TargetApp | AppIdentifier;
362
363
  context: OpenFin.Context;
363
- }, clientIdentity: OpenFin.ClientIdentity): Promise<void | FDC3v2.AppIdentifier>;
364
+ }, clientIdentity: OpenFin.ClientIdentity): Promise<void | AppIdentifier>;
364
365
  /**
365
366
  * Responsible for resolving the fdc3.findInstances call.
366
367
  * Must be overridden
367
368
  * @param { AppIdentifier(2) } app AppIdentifier that was passed to fdc3.findInstances
368
369
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
369
370
  */
370
- fdc3HandleFindInstances(app: FDC3v2.AppIdentifier, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
371
+ fdc3HandleFindInstances(app: AppIdentifier, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
371
372
  /**
372
373
  * Responsible for resolving the fdc3.getAppMetadata call.
373
374
  * Must be overridden
374
375
  * @param { AppIdentifier(2) } app AppIdentifier that was passed to fdc3.getAppMetadata
375
376
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
376
377
  */
377
- fdc3HandleGetAppMetadata(app: FDC3v2.AppIdentifier, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
378
+ fdc3HandleGetAppMetadata(app: AppIdentifier, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
378
379
  /**
379
380
  * This function is called by the Interop Broker whenever a Context handler would fire.
380
381
  * For FDC3 2.0 you would need to override this function and add the contextMetadata as
@@ -1,19 +1,19 @@
1
- import { FDC3v2 } from '../../../../fdc3';
2
1
  import * as OpenFin from '../../../OpenFin';
2
+ import type { Listener, Context, ContextHandler } from './shapes/fdc3v2';
3
3
  declare type HandlerId = string;
4
4
  export declare class PrivateChannelClient {
5
5
  id: string;
6
6
  client: OpenFin.ChannelClient;
7
- listeners: Map<HandlerId, FDC3v2.Listener>;
7
+ listeners: Map<HandlerId, Listener>;
8
8
  constructor(client: OpenFin.ChannelClient, id: string);
9
- broadcast(context: OpenFin.Context): Promise<void>;
10
- getCurrentContext(contextType?: string): Promise<OpenFin.Context | null>;
11
- addContextListener(contextType: string | null, handler: OpenFin.ContextHandler): Promise<FDC3v2.Listener>;
9
+ broadcast(context: Context): Promise<void>;
10
+ getCurrentContext(contextType?: string): Promise<Context | null>;
11
+ addContextListener(contextType: string | null, handler: ContextHandler): Promise<Listener>;
12
12
  private createNonStandardUnsubscribeCb;
13
13
  private createContextUnsubscribeCb;
14
- onAddContextListener(handler: (contextType?: string) => void): FDC3v2.Listener;
15
- onDisconnect(handler: () => void): FDC3v2.Listener;
16
- onUnsubscribe(handler: (contextType?: string) => void): FDC3v2.Listener;
14
+ onAddContextListener(handler: (contextType?: string) => void): Listener;
15
+ onDisconnect(handler: () => void): Listener;
16
+ onUnsubscribe(handler: (contextType?: string) => void): Listener;
17
17
  disconnect(): Promise<void>;
18
18
  }
19
19
  export {};
@@ -1,5 +1,4 @@
1
- import { FDC3 } from '../../../../fdc3';
2
- import * as OpenFin from '../../../OpenFin';
1
+ import * as FDC3v1 from './shapes/fdc3v1';
3
2
  import { Base } from '../../base';
4
3
  /**
5
4
  * @typedef { object } Listener
@@ -90,7 +89,7 @@ import { Base } from '../../base';
90
89
  * }
91
90
  * ```
92
91
  */
93
- export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
92
+ export default class Fdc3Module extends Base implements FDC3v1.DesktopAgent {
94
93
  /**
95
94
  * Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts. If you wish to listen for all incoming contexts, pass `null` for the contextType argument.
96
95
  * @param { string | null } contextType - The type of context you wish to handle.
@@ -99,7 +98,7 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
99
98
  * @tutorial fdc3.addContextListener
100
99
  * @static
101
100
  */
102
- addContextListener(contextType: string | null, handler: OpenFin.ContextHandler): FDC3.Listener & Promise<FDC3.Listener>;
101
+ addContextListener(contextType: string | null, handler: FDC3v1.ContextHandler): FDC3v1.Listener & Promise<FDC3v1.Listener>;
103
102
  /**
104
103
  * Broadcasts a context for the channel of the current entity.
105
104
  * @param { Context } context - New context to set.
@@ -107,14 +106,14 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
107
106
  * @tutorial fdc3.broadcast
108
107
  * @static
109
108
  */
110
- broadcast(context: OpenFin.Context): Promise<void>;
109
+ broadcast(context: FDC3v1.Context): Promise<void>;
111
110
  /**
112
111
  * Returns the Interop-Broker-defined context groups available for an entity to join.
113
112
  * @returns { Promise<Channel[]>}
114
113
  * @tutorial fdc3.getSystemChannels
115
114
  * @static
116
115
  */
117
- getSystemChannels(): Promise<OpenFin.ContextGroupInfo[]>;
116
+ getSystemChannels(): Promise<FDC3v1.SystemChannel[]>;
118
117
  /**
119
118
  * Join all Interop Clients at the given identity to context group `contextGroupId`.
120
119
  * If no target is specified, it adds the sender to the context group.
@@ -143,7 +142,7 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
143
142
  * @tutorial fdc3.addIntentListener
144
143
  * @static
145
144
  */
146
- addIntentListener(intent: string, handler: OpenFin.ContextHandler): FDC3.Listener & Promise<FDC3.Listener>;
145
+ addIntentListener(intent: string, handler: FDC3v1.ContextHandler): FDC3v1.Listener & Promise<FDC3v1.Listener>;
147
146
  /**
148
147
  * Raises a specific intent.
149
148
  * @param { string } intent Name of the Intent.
@@ -153,13 +152,13 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
153
152
  * @tutorial fdc3.raiseIntent
154
153
  * @static
155
154
  */
156
- raiseIntent(intent: string, context: OpenFin.Context, app?: FDC3.TargetApp): Promise<FDC3.IntentResolution>;
155
+ raiseIntent(intent: string, context: FDC3v1.Context, app?: FDC3v1.TargetApp): Promise<FDC3v1.IntentResolution>;
157
156
  /**
158
157
  * Returns the Channel that the entity is subscribed to. Returns null if not joined to a channel.
159
158
  * @returns { Channel | null }
160
159
  * @tutorial fdc3.getCurrentChannel
161
160
  */
162
- getCurrentChannel(): Promise<FDC3.Channel | null>;
161
+ getCurrentChannel(): Promise<FDC3v1.Channel | null>;
163
162
  /**
164
163
  * Find out more information about a particular intent by passing its name, and optionally its context.
165
164
  * @param { string } intent Name of the Intent
@@ -167,14 +166,14 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
167
166
  * @return { Promise<AppIntent> }
168
167
  * @tutorial fdc3.findIntent
169
168
  */
170
- findIntent(intent: string, context?: OpenFin.Context): Promise<FDC3.AppIntent>;
169
+ findIntent(intent: string, context?: FDC3v1.Context): Promise<FDC3v1.AppIntent>;
171
170
  /**
172
171
  * Find all the available intents for a particular context.
173
172
  * @param { Context } context
174
173
  * @return { Promise<Array<AppIntent>> }
175
174
  * @tutorial fdc3.findIntentsByContext
176
175
  */
177
- findIntentsByContext(context: OpenFin.Context): Promise<Array<FDC3.AppIntent>>;
176
+ findIntentsByContext(context: FDC3v1.Context): Promise<Array<FDC3v1.AppIntent>>;
178
177
  /**
179
178
  * Finds and raises an intent against a target app based purely on context data.
180
179
  * @param { Context } context
@@ -182,20 +181,20 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
182
181
  * @return { Promise<IntentResolution> }
183
182
  * @tutorial fdc3.raiseIntentForContext
184
183
  */
185
- raiseIntentForContext(context: OpenFin.Context, app?: FDC3.TargetApp): Promise<FDC3.IntentResolution>;
184
+ raiseIntentForContext(context: FDC3v1.Context, app?: FDC3v1.TargetApp): Promise<FDC3v1.IntentResolution>;
186
185
  /**
187
186
  * Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.
188
187
  * @param channelId
189
188
  * @returns { Promise<Channel> }
190
189
  * @tutorial fdc3.getOrCreateChannel
191
190
  */
192
- getOrCreateChannel(channelId: string): Promise<FDC3.Channel>;
191
+ getOrCreateChannel(channelId: string): Promise<FDC3v1.Channel>;
193
192
  /**
194
193
  * Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.
195
194
  * @return { Promise<ImplementationMetadata> }
196
195
  * @tutorial fdc3.getInfo
197
196
  */
198
- getInfo(): FDC3.ImplementationMetadata;
197
+ getInfo(): FDC3v1.ImplementationMetadata;
199
198
  /**
200
199
  * Launches an app with target information, which can either be a string or an AppMetadata object.
201
200
  * @param { TargetApp } app
@@ -203,7 +202,7 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
203
202
  * @return { Promise<void> }
204
203
  * @tutorial fdc3.open
205
204
  */
206
- open(app: FDC3.TargetApp, context?: OpenFin.Context): Promise<void>;
205
+ open(app: FDC3v1.TargetApp, context?: FDC3v1.Context): Promise<void>;
207
206
  private getCurrentContextGroupInfo;
208
207
  private buildChannelObject;
209
208
  }
@@ -1,5 +1,5 @@
1
- import { FDC3, FDC3v2 } from '../../../../fdc3';
2
- import * as OpenFin from '../../../OpenFin';
1
+ import * as FDC3v1 from './shapes/fdc3v1';
2
+ import * as FDC3v2 from './shapes/fdc3v2';
3
3
  import { Base } from '../../base';
4
4
  import Transport from '../../../transport/transport';
5
5
  /**
@@ -166,19 +166,19 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
166
166
  * @returns { Promise<AppIdentifier> }
167
167
  * @tutorial fdc3.open
168
168
  */
169
- open(app: FDC3v2.AppIdentifier | FDC3.TargetApp, context?: OpenFin.Context): Promise<FDC3v2.AppIdentifier>;
169
+ open(app: FDC3v2.AppIdentifier | FDC3v1.TargetApp, context?: FDC3v2.Context): Promise<FDC3v2.AppIdentifier>;
170
170
  /**
171
171
  * Find all the available instances for a particular application.
172
172
  * @param { AppIdentifier } app
173
173
  * @returns { Promise<Array<AppIdentifier>> }
174
- * @tutorial fdc3v2.findInstances
174
+ * @tutorial findInstances
175
175
  */
176
176
  findInstances(app: FDC3v2.AppIdentifier): Promise<Array<FDC3v2.AppIdentifier>>;
177
177
  /**
178
178
  * Retrieves the AppMetadata for an AppIdentifier, which provides additional metadata (such as icons, a title and description) from the App Directory record for the application, that may be used for display purposes.
179
179
  * @param { AppIdentifier } app
180
180
  * @returns { Promise<AppMetadata(2)> }
181
- * @tutorial fdc3v2.getAppMetadata
181
+ * @tutorial getAppMetadata
182
182
  */
183
183
  getAppMetadata(app: FDC3v2.AppIdentifier): Promise<FDC3v2.AppMetadata>;
184
184
  /**
@@ -187,7 +187,7 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
187
187
  * @returns { Promise<void> }
188
188
  * @tutorial fdc3.broadcast
189
189
  */
190
- broadcast(context: OpenFin.Context): Promise<void>;
190
+ broadcast(context: FDC3v2.Context): Promise<void>;
191
191
  /**
192
192
  * Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts. If you wish to listen for all incoming contexts, pass `null` for the contextType argument.
193
193
  * @param { string | null } contextType
@@ -195,7 +195,7 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
195
195
  * @returns { Listener }
196
196
  * @tutorial fdc3.addContextListener
197
197
  */
198
- addContextListener(contextType: string | null, handler: FDC3v2.ContextHandler): Promise<FDC3.Listener>;
198
+ addContextListener(contextType: string | null, handler: FDC3v2.ContextHandler): Promise<FDC3v2.Listener>;
199
199
  /**
200
200
  * Find out more information about a particular intent by passing its name, and optionally its context and resultType.
201
201
  * @param { string } intent Name of the Intent
@@ -204,32 +204,32 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
204
204
  * @returns { Promise<AppIntent(2)> }
205
205
  * @tutorial fdc3.findIntent
206
206
  */
207
- findIntent(intent: string, context?: OpenFin.Context, resultType?: string): Promise<FDC3v2.AppIntent>;
207
+ findIntent(intent: string, context?: FDC3v2.Context, resultType?: string): Promise<FDC3v2.AppIntent>;
208
208
  /**
209
209
  * Find all the available intents for a particular context.
210
210
  * @param { Context } context
211
211
  * @param { string } [resultType] The type of result returned for any intent specified during resolution.
212
212
  * @returns { Promise<Array<AppIntent(2)>> }
213
- * @tutorial fdc3v2.findIntentsByContext
213
+ * @tutorial findIntentsByContext
214
214
  */
215
- findIntentsByContext(context: OpenFin.Context, resultType?: string): Promise<Array<FDC3v2.AppIntent>>;
215
+ findIntentsByContext(context: FDC3v2.Context, resultType?: string): Promise<Array<FDC3v2.AppIntent>>;
216
216
  /**
217
217
  * Raises a specific intent for resolution against apps registered with the desktop agent.
218
218
  * @param { string } intent Name of the Intent
219
219
  * @param { Context } context Context associated with the Intent
220
220
  * @param { AppIdentifier | TargetApp } [app]
221
221
  * @returns { Promise<IntentResolution(2)> }
222
- * @tutorial fdc3v2.raiseIntent
222
+ * @tutorial raiseIntent
223
223
  */
224
- raiseIntent(intent: string, context: OpenFin.Context, app?: FDC3v2.AppIdentifier | FDC3.TargetApp): Promise<FDC3v2.IntentResolution>;
224
+ raiseIntent(intent: string, context: FDC3v2.Context, app?: FDC3v2.AppIdentifier | FDC3v1.TargetApp): Promise<FDC3v2.IntentResolution>;
225
225
  /**
226
226
  * Finds and raises an intent against apps registered with the desktop agent based purely on the type of the context data.
227
227
  * @param { Context } context Context associated with the Intent
228
228
  * @param { AppIdentifier | TargetApp } [app]
229
229
  * @returns { Promise<IntentResolution(2)> }
230
- * @tutorial fdc3v2.raiseIntentForContext
230
+ * @tutorial raiseIntentForContext
231
231
  */
232
- raiseIntentForContext(context: OpenFin.Context, app?: FDC3v2.AppIdentifier | FDC3.TargetApp): Promise<FDC3v2.IntentResolution>;
232
+ raiseIntentForContext(context: FDC3v2.Context, app?: FDC3v2.AppIdentifier | FDC3v1.TargetApp): Promise<FDC3v2.IntentResolution>;
233
233
  /**
234
234
  * Adds a listener for incoming intents.
235
235
  * @param { string } intent Name of the Intent
@@ -237,38 +237,38 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
237
237
  * @returns { Promise<Listener> }
238
238
  * @tutorial fdc3.addIntentListener
239
239
  */
240
- addIntentListener(intent: string, handler: FDC3v2.IntentHandler): Promise<FDC3.Listener>;
240
+ addIntentListener(intent: string, handler: FDC3v2.IntentHandler): Promise<FDC3v1.Listener>;
241
241
  /**
242
242
  * Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.
243
243
  * @param channelId
244
244
  * @returns { Promise<Channel> }
245
245
  * @tutorial fdc3.getOrCreateChannel
246
246
  */
247
- getOrCreateChannel(channelId: string): Promise<FDC3.Channel>;
247
+ getOrCreateChannel(channelId: string): Promise<FDC3v1.Channel>;
248
248
  /**
249
249
  * Returns a Channel with an auto-generated identity that is intended for private communication between applications. Primarily used to create channels that will be returned to other applications via an IntentResolution for a raised intent.
250
250
  * @returns { Promise<PrivateChannel> }
251
- * @tutorial fdc3v2.createPrivateChannel
251
+ * @tutorial createPrivateChannel
252
252
  */
253
253
  createPrivateChannel(): Promise<FDC3v2.PrivateChannel>;
254
254
  /**
255
255
  * Retrieves a list of the User Channels available for the app to join.
256
256
  * @returns { Promise<Channel[]>}
257
- * @tutorial fdc3v2.getUserChannels
257
+ * @tutorial getUserChannels
258
258
  */
259
- getUserChannels(): Promise<Array<OpenFin.ContextGroupInfo>>;
259
+ getUserChannels(): Promise<Array<FDC3v1.SystemChannel>>;
260
260
  /**
261
261
  * Retrieves a list of the User Channels available for the app to join.
262
262
  * @returns { Promise<Channel[]>}
263
263
  * @deprecated Please use {@link fdc3.getUserChannels fdc3.getUserChannels} instead
264
264
  * @tutorial fdc3.getSystemChannels
265
265
  */
266
- getSystemChannels(): Promise<Array<OpenFin.ContextGroupInfo>>;
266
+ getSystemChannels(): Promise<Array<FDC3v1.SystemChannel>>;
267
267
  /**
268
268
  * Join an app to a specified User channel.
269
269
  * @param { string } channelId Channel name
270
270
  * @returns { Promise<void> }
271
- * @tutorial fdc3v2.joinUserChannel
271
+ * @tutorial joinUserChannel
272
272
  */
273
273
  joinUserChannel(channelId: string): Promise<void>;
274
274
  /**
@@ -283,7 +283,7 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
283
283
  * Returns the Channel object for the current User channel membership
284
284
  * @returns { Promise<FDC3.Channel | null> }
285
285
  */
286
- getCurrentChannel(): Promise<FDC3.Channel | null>;
286
+ getCurrentChannel(): Promise<FDC3v1.Channel | null>;
287
287
  /**
288
288
  * Removes the app from any User channel membership.
289
289
  * @returns { Promise<void> }
@@ -294,7 +294,7 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
294
294
  * Retrieves information about the FDC3 implementation, including the supported version of the FDC3 specification, the name of the provider of the implementation, its own version number, details of whether optional API features are implemented and the metadata of the calling application according to the desktop agent.
295
295
  * fdc3HandleGetInfo must be overridden in the InteropBroker so that the ImplementationMetadata will have the appMetadata info.
296
296
  * @returns { Promise<ImplementationMetadata(2)> }
297
- * @tutorial fdc3v2.getInfo
297
+ * @tutorial getInfo
298
298
  */
299
299
  getInfo(): Promise<FDC3v2.ImplementationMetadata>;
300
300
  }