@openfin/core 34.78.6 → 34.78.8

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.
@@ -2971,7 +2971,7 @@ declare class ClassicStrategy implements ChannelStrategy<EndpointPayload> {
2971
2971
  private messageReceiver;
2972
2972
  private endpointId;
2973
2973
  private providerIdentity;
2974
- constructor(wire: Transport, messageReceiver: MessageReceiver, endpointId: string, // Provider endpointId is channelId
2974
+ constructor(wire: Transport, messageReceiver: MessageReceiver_2, endpointId: string, // Provider endpointId is channelId
2975
2975
  providerIdentity: ProviderIdentity_4);
2976
2976
  onEndpointDisconnect(endpointId: string, listener: () => void): void;
2977
2977
  receive(listener: (action: string, payload: any, identity: OpenFin_2.ClientIdentity | OpenFin_2.ClientIdentityMultiRuntime | ProviderIdentity_4) => Promise<any>): void;
@@ -3450,7 +3450,7 @@ declare type ConstViewOptions = {
3450
3450
  /**
3451
3451
  * Controls interaction of the view with its parent window's download shelf.
3452
3452
  */
3453
- downloadShelf: {
3453
+ downloadShelf?: {
3454
3454
  /**
3455
3455
  * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3456
3456
  */
@@ -4355,6 +4355,14 @@ declare type CreateViewTarget = LayoutIdentity & {
4355
4355
  };
4356
4356
  };
4357
4357
 
4358
+ /**
4359
+ * Define possible options for Custom protocol.
4360
+ * @interface
4361
+ */
4362
+ declare type CustomProtocolOptions = {
4363
+ protocolName: string;
4364
+ };
4365
+
4358
4366
  /**
4359
4367
  * Custom headers for requests sent by the window.
4360
4368
  *
@@ -4372,6 +4380,8 @@ declare type CustomRequestHeaders = {
4372
4380
  headers: WebRequestHeader[];
4373
4381
  };
4374
4382
 
4383
+ declare type DataChannelReadyState = RTCDataChannel['readyState'];
4384
+
4375
4385
  /**
4376
4386
  * @interface
4377
4387
  */
@@ -4653,7 +4663,7 @@ declare type DownloadShelfOptions = {
4653
4663
  /**
4654
4664
  * Styling options for the download shelf border.
4655
4665
  */
4656
- border: {
4666
+ border?: {
4657
4667
  /**
4658
4668
  * Thickness of the border in pixels. Default 1 pixel. Used only for frameless windows.
4659
4669
  *
@@ -5129,7 +5139,7 @@ declare namespace ExternalApplicationEvents {
5129
5139
  }
5130
5140
 
5131
5141
  /**
5132
- * Union of possible `type` values for a {@link OpenFin.ApplicationEvents.ApplicationEvent}.
5142
+ * Union of possible `type` values for a {@link ApplicationEvent}.
5133
5143
  */
5134
5144
  declare type ExternalApplicationEventType = ExternalApplicationEvent['type'];
5135
5145
 
@@ -5455,6 +5465,8 @@ declare type FindIntentsByContextOptions<MetadataType = IntentMetadata_3> = {
5455
5465
  metadata?: MetadataType;
5456
5466
  };
5457
5467
 
5468
+ declare type FlexReadyState = WebSocketReadyState | DataChannelReadyState;
5469
+
5458
5470
  /**
5459
5471
  * Generated when a WebContents gains focus.
5460
5472
  * @interface
@@ -9095,7 +9107,17 @@ declare interface Message<T> {
9095
9107
 
9096
9108
  declare type MessageHandler = (data: any) => boolean;
9097
9109
 
9098
- declare class MessageReceiver extends Base {
9110
+ declare interface MessageReceiver {
9111
+ addEventListener(e: 'open', listener: (ev: Event) => void): void;
9112
+ addEventListener(e: 'error', listener: (ev: Event) => void): void;
9113
+ addEventListener(e: 'message', listener: (ev: MessageEvent) => void): void;
9114
+ addEventListener(e: 'close', listener: (ev: Event) => void): void;
9115
+ send(data: unknown): void;
9116
+ close(): void;
9117
+ readyState: FlexReadyState;
9118
+ }
9119
+
9120
+ declare class MessageReceiver_2 extends Base {
9099
9121
  private endpointMap;
9100
9122
  private latestEndpointIdByChannelId;
9101
9123
  constructor(wire: Transport);
@@ -9661,6 +9683,7 @@ declare namespace OpenFin_2 {
9661
9683
  Rectangle,
9662
9684
  ApplicationCreationOptions,
9663
9685
  ApplicationOptions,
9686
+ CustomProtocolOptions,
9664
9687
  InteropBrokerOptions,
9665
9688
  ContextGroupInfo,
9666
9689
  DisplayMetadata_3 as DisplayMetadata,
@@ -11900,7 +11923,7 @@ declare type PropagatedEventType<Topic extends string, Type extends string> = `$
11900
11923
 
11901
11924
  /**
11902
11925
  * A view event that has propagated to a parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
11903
- * or {@link Openfin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11926
+ * or {@link OpenFin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11904
11927
  * event type key with `'view-'`.
11905
11928
  */
11906
11929
  declare type PropagatedViewEvent<TargetTopic extends string> = PropagatedEvent<'view', TargetTopic, ViewEvent> & {
@@ -11914,7 +11937,7 @@ declare type PropagatedViewEventType = PropagatedViewEvent<string>['type'];
11914
11937
 
11915
11938
  /**
11916
11939
  * A Window event that has propagated to the parent {@link OpenFin.ApplicationEvents Application} and {@link OpenFin.SystemEvents System},
11917
- * prefixing the type string with `'window-'`. Only {@link NativeWindowEvent native window events} will propagate
11940
+ * prefixing the type string with `'window-'`. Only {@link WindowSourcedEvent window-sourced events} will propagate
11918
11941
  * this way; those that have {@link OpenFin.ViewEvents.PropagatedViewEvent propagated} from {@link OpenFin.ViewEvents}
11919
11942
  * will *not* re-propagate.
11920
11943
  *
@@ -12132,6 +12155,10 @@ declare interface ProtocolMap extends ProtocolMapBase {
12132
12155
  anchor: OpenFin_2.AnchorType;
12133
12156
  }>>;
12134
12157
  'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin_2.Bounds>>>;
12158
+ 'register-custom-protocol': ApiCall<OpenFin_2.CustomProtocolOptions, void>;
12159
+ 'unregister-custom-protocol': ApiCall<{
12160
+ protocolName: string;
12161
+ }, void>;
12135
12162
  }
12136
12163
 
12137
12164
  declare interface ProtocolMapBase {
@@ -12263,6 +12290,10 @@ declare interface ReactComponentConfig extends ItemConfig {
12263
12290
  */
12264
12291
  declare type ReadImageClipboardRequest = BaseClipboardRequest & ImageFormatOptions;
12265
12292
 
12293
+ declare interface ReceiverConfig extends Omit<RemoteConfig, 'address'> {
12294
+ receiver: MessageReceiver;
12295
+ }
12296
+
12266
12297
  /**
12267
12298
  * A rectangular area on the screen.
12268
12299
  *
@@ -12902,6 +12933,41 @@ declare type ShortcutOverride = Hotkey & {
12902
12933
 
12903
12934
  /**
12904
12935
  * Generated when the Download Shelf 'Show All' button is clicked.
12936
+ *
12937
+ * @remarks By default, OpenFin does not handle the clicking of the `Show All` button on the download
12938
+ * shelf. Instead, it fires this event, which leaves rendering a download manager to the user. For a simple
12939
+ * implementation, the `chrome://downloads` page can be used (see the example below):
12940
+ *
12941
+ * @example
12942
+ *
12943
+ * ```typescript
12944
+ * const platform = await fin.Platform.getCurrentSync();
12945
+ * // Listen to the propagated event at the Platform level, so that we only need one listener for a click from any window
12946
+ * platform.on('window-show-all-downloads', () => {
12947
+ * // Render the `chrome://downloads` window when a user clicks on the download shelf `Show All` button
12948
+ * platform.createWindow({
12949
+ * name: 'show-download-window',
12950
+ * layout: {
12951
+ * content: [
12952
+ * {
12953
+ * type: 'stack',
12954
+ * content: [
12955
+ * {
12956
+ * type: 'component',
12957
+ * componentName: 'view',
12958
+ * componentState: {
12959
+ * name: 'show-download-view',
12960
+ * url: 'chrome://downloads'
12961
+ * }
12962
+ * }
12963
+ * ]
12964
+ * }
12965
+ * ]
12966
+ * }
12967
+ * });
12968
+ * })
12969
+ * ```
12970
+ *
12905
12971
  * @interface
12906
12972
  */
12907
12973
  declare type ShowAllDownloadsEvent = BaseWindowEvent & {
@@ -13942,6 +14008,52 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
13942
14008
  * ```
13943
14009
  */
13944
14010
  openUrlWithBrowser(url: string): Promise<void>;
14011
+ /**
14012
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
14013
+ * overwrites the existing registry entry if the given custom protocol name already exists.
14014
+ *
14015
+ * Note: This method is restricted by default and must be enabled via
14016
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14017
+ *
14018
+ *
14019
+ * @remarks These protocols are reserved and cannot be registered:
14020
+ * - fin
14021
+ * - fins
14022
+ * - openfin
14023
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14024
+ *
14025
+ * @throws if a given custom protocol failed to be registered.
14026
+ * @throws if a manifest URL contains the '%1' string.
14027
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
14028
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
14029
+ *
14030
+ * @example
14031
+ * ```js
14032
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
14033
+ * ```
14034
+ */
14035
+ registerCustomProtocol(options: OpenFin_2.CustomProtocolOptions): Promise<void>;
14036
+ /**
14037
+ * Removes the registry entry for a given custom protocol.
14038
+ *
14039
+ * Note: This method is restricted by default and must be enabled via
14040
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14041
+ *
14042
+ *
14043
+ * @remarks These protocols are reserved and cannot be unregistered:
14044
+ * - fin
14045
+ * - fins
14046
+ * - openfin
14047
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14048
+ *
14049
+ * @throws if a protocol entry failed to be removed in registry.
14050
+ *
14051
+ * @example
14052
+ * ```js
14053
+ * await fin.System.unregisterCustomProtocol('protocol1');
14054
+ * ```
14055
+ */
14056
+ unregisterCustomProtocol(protocolName: string): Promise<void>;
13945
14057
  /**
13946
14058
  * Removes the process entry for the passed UUID obtained from a prior call
13947
14059
  * of fin.System.launchExternalProcess().
@@ -14638,6 +14750,14 @@ declare type SystemPermissions = {
14638
14750
  enabled: boolean;
14639
14751
  protocols: string[];
14640
14752
  };
14753
+ registerCustomProtocol: boolean | {
14754
+ enabled: boolean;
14755
+ protocols: string[];
14756
+ };
14757
+ unregisterCustomProtocol: boolean | {
14758
+ enabled: boolean;
14759
+ protocols: string[];
14760
+ };
14641
14761
  };
14642
14762
 
14643
14763
  /**
@@ -14986,7 +15106,7 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
14986
15106
  connectSync: () => void;
14987
15107
  getPort: () => string;
14988
15108
  shutdown(): Promise<void>;
14989
- connect(config: InternalConnectConfig | RemoteConfig): Promise<string | void>;
15109
+ connect(config: InternalConnectConfig | RemoteConfig | ReceiverConfig): Promise<string | void>;
14990
15110
  private connectRemote;
14991
15111
  connectByPort(config: ExistingConnectConfig): Promise<void>;
14992
15112
  private authorize;
@@ -17037,6 +17157,8 @@ declare type WebRequestHeader = {
17037
17157
  [key: string]: string;
17038
17158
  };
17039
17159
 
17160
+ declare type WebSocketReadyState = WebSocket['readyState'];
17161
+
17040
17162
  /**
17041
17163
  * Generated when a window is being moved by the user.
17042
17164
  * @remarks For use with monitor scaling that is not 100%. Bounds are given in DIP (adjusted for monitor scale factor).
@@ -19041,7 +19163,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
19041
19163
  };
19042
19164
 
19043
19165
  declare type Wire = EventEmitter & {
19044
- connect(address: string, WsConstructor: typeof WebSocket): Promise<any>;
19166
+ connect(messageReciever: MessageReceiver): Promise<any>;
19045
19167
  connectSync(): any;
19046
19168
  send(data: any): Promise<any>;
19047
19169
  shutdown(): Promise<void>;
@@ -2971,7 +2971,7 @@ declare class ClassicStrategy implements ChannelStrategy<EndpointPayload> {
2971
2971
  private messageReceiver;
2972
2972
  private endpointId;
2973
2973
  private providerIdentity;
2974
- constructor(wire: Transport, messageReceiver: MessageReceiver, endpointId: string, // Provider endpointId is channelId
2974
+ constructor(wire: Transport, messageReceiver: MessageReceiver_2, endpointId: string, // Provider endpointId is channelId
2975
2975
  providerIdentity: ProviderIdentity_4);
2976
2976
  onEndpointDisconnect(endpointId: string, listener: () => void): void;
2977
2977
  receive(listener: (action: string, payload: any, identity: OpenFin_2.ClientIdentity | OpenFin_2.ClientIdentityMultiRuntime | ProviderIdentity_4) => Promise<any>): void;
@@ -3450,7 +3450,7 @@ declare type ConstViewOptions = {
3450
3450
  /**
3451
3451
  * Controls interaction of the view with its parent window's download shelf.
3452
3452
  */
3453
- downloadShelf: {
3453
+ downloadShelf?: {
3454
3454
  /**
3455
3455
  * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3456
3456
  */
@@ -4355,6 +4355,14 @@ declare type CreateViewTarget = LayoutIdentity & {
4355
4355
  };
4356
4356
  };
4357
4357
 
4358
+ /**
4359
+ * Define possible options for Custom protocol.
4360
+ * @interface
4361
+ */
4362
+ declare type CustomProtocolOptions = {
4363
+ protocolName: string;
4364
+ };
4365
+
4358
4366
  /**
4359
4367
  * Custom headers for requests sent by the window.
4360
4368
  *
@@ -4372,6 +4380,8 @@ declare type CustomRequestHeaders = {
4372
4380
  headers: WebRequestHeader[];
4373
4381
  };
4374
4382
 
4383
+ declare type DataChannelReadyState = RTCDataChannel['readyState'];
4384
+
4375
4385
  /**
4376
4386
  * @interface
4377
4387
  */
@@ -4653,7 +4663,7 @@ declare type DownloadShelfOptions = {
4653
4663
  /**
4654
4664
  * Styling options for the download shelf border.
4655
4665
  */
4656
- border: {
4666
+ border?: {
4657
4667
  /**
4658
4668
  * Thickness of the border in pixels. Default 1 pixel. Used only for frameless windows.
4659
4669
  *
@@ -5129,7 +5139,7 @@ declare namespace ExternalApplicationEvents {
5129
5139
  }
5130
5140
 
5131
5141
  /**
5132
- * Union of possible `type` values for a {@link OpenFin.ApplicationEvents.ApplicationEvent}.
5142
+ * Union of possible `type` values for a {@link ApplicationEvent}.
5133
5143
  */
5134
5144
  declare type ExternalApplicationEventType = ExternalApplicationEvent['type'];
5135
5145
 
@@ -5455,6 +5465,8 @@ declare type FindIntentsByContextOptions<MetadataType = IntentMetadata_3> = {
5455
5465
  metadata?: MetadataType;
5456
5466
  };
5457
5467
 
5468
+ declare type FlexReadyState = WebSocketReadyState | DataChannelReadyState;
5469
+
5458
5470
  /**
5459
5471
  * Generated when a WebContents gains focus.
5460
5472
  * @interface
@@ -9095,7 +9107,17 @@ declare interface Message<T> {
9095
9107
 
9096
9108
  declare type MessageHandler = (data: any) => boolean;
9097
9109
 
9098
- declare class MessageReceiver extends Base {
9110
+ declare interface MessageReceiver {
9111
+ addEventListener(e: 'open', listener: (ev: Event) => void): void;
9112
+ addEventListener(e: 'error', listener: (ev: Event) => void): void;
9113
+ addEventListener(e: 'message', listener: (ev: MessageEvent) => void): void;
9114
+ addEventListener(e: 'close', listener: (ev: Event) => void): void;
9115
+ send(data: unknown): void;
9116
+ close(): void;
9117
+ readyState: FlexReadyState;
9118
+ }
9119
+
9120
+ declare class MessageReceiver_2 extends Base {
9099
9121
  private endpointMap;
9100
9122
  private latestEndpointIdByChannelId;
9101
9123
  constructor(wire: Transport);
@@ -9661,6 +9683,7 @@ declare namespace OpenFin_2 {
9661
9683
  Rectangle,
9662
9684
  ApplicationCreationOptions,
9663
9685
  ApplicationOptions,
9686
+ CustomProtocolOptions,
9664
9687
  InteropBrokerOptions,
9665
9688
  ContextGroupInfo,
9666
9689
  DisplayMetadata_3 as DisplayMetadata,
@@ -11900,7 +11923,7 @@ declare type PropagatedEventType<Topic extends string, Type extends string> = `$
11900
11923
 
11901
11924
  /**
11902
11925
  * A view event that has propagated to a parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
11903
- * or {@link Openfin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11926
+ * or {@link OpenFin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11904
11927
  * event type key with `'view-'`.
11905
11928
  */
11906
11929
  declare type PropagatedViewEvent<TargetTopic extends string> = PropagatedEvent<'view', TargetTopic, ViewEvent> & {
@@ -11914,7 +11937,7 @@ declare type PropagatedViewEventType = PropagatedViewEvent<string>['type'];
11914
11937
 
11915
11938
  /**
11916
11939
  * A Window event that has propagated to the parent {@link OpenFin.ApplicationEvents Application} and {@link OpenFin.SystemEvents System},
11917
- * prefixing the type string with `'window-'`. Only {@link NativeWindowEvent native window events} will propagate
11940
+ * prefixing the type string with `'window-'`. Only {@link WindowSourcedEvent window-sourced events} will propagate
11918
11941
  * this way; those that have {@link OpenFin.ViewEvents.PropagatedViewEvent propagated} from {@link OpenFin.ViewEvents}
11919
11942
  * will *not* re-propagate.
11920
11943
  *
@@ -12132,6 +12155,10 @@ declare interface ProtocolMap extends ProtocolMapBase {
12132
12155
  anchor: OpenFin_2.AnchorType;
12133
12156
  }>>;
12134
12157
  'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin_2.Bounds>>>;
12158
+ 'register-custom-protocol': ApiCall<OpenFin_2.CustomProtocolOptions, void>;
12159
+ 'unregister-custom-protocol': ApiCall<{
12160
+ protocolName: string;
12161
+ }, void>;
12135
12162
  }
12136
12163
 
12137
12164
  declare interface ProtocolMapBase {
@@ -12263,6 +12290,10 @@ declare interface ReactComponentConfig extends ItemConfig {
12263
12290
  */
12264
12291
  declare type ReadImageClipboardRequest = BaseClipboardRequest & ImageFormatOptions;
12265
12292
 
12293
+ declare interface ReceiverConfig extends Omit<RemoteConfig, 'address'> {
12294
+ receiver: MessageReceiver;
12295
+ }
12296
+
12266
12297
  /**
12267
12298
  * A rectangular area on the screen.
12268
12299
  *
@@ -12902,6 +12933,41 @@ declare type ShortcutOverride = Hotkey & {
12902
12933
 
12903
12934
  /**
12904
12935
  * Generated when the Download Shelf 'Show All' button is clicked.
12936
+ *
12937
+ * @remarks By default, OpenFin does not handle the clicking of the `Show All` button on the download
12938
+ * shelf. Instead, it fires this event, which leaves rendering a download manager to the user. For a simple
12939
+ * implementation, the `chrome://downloads` page can be used (see the example below):
12940
+ *
12941
+ * @example
12942
+ *
12943
+ * ```typescript
12944
+ * const platform = await fin.Platform.getCurrentSync();
12945
+ * // Listen to the propagated event at the Platform level, so that we only need one listener for a click from any window
12946
+ * platform.on('window-show-all-downloads', () => {
12947
+ * // Render the `chrome://downloads` window when a user clicks on the download shelf `Show All` button
12948
+ * platform.createWindow({
12949
+ * name: 'show-download-window',
12950
+ * layout: {
12951
+ * content: [
12952
+ * {
12953
+ * type: 'stack',
12954
+ * content: [
12955
+ * {
12956
+ * type: 'component',
12957
+ * componentName: 'view',
12958
+ * componentState: {
12959
+ * name: 'show-download-view',
12960
+ * url: 'chrome://downloads'
12961
+ * }
12962
+ * }
12963
+ * ]
12964
+ * }
12965
+ * ]
12966
+ * }
12967
+ * });
12968
+ * })
12969
+ * ```
12970
+ *
12905
12971
  * @interface
12906
12972
  */
12907
12973
  declare type ShowAllDownloadsEvent = BaseWindowEvent & {
@@ -13942,6 +14008,52 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
13942
14008
  * ```
13943
14009
  */
13944
14010
  openUrlWithBrowser(url: string): Promise<void>;
14011
+ /**
14012
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
14013
+ * overwrites the existing registry entry if the given custom protocol name already exists.
14014
+ *
14015
+ * Note: This method is restricted by default and must be enabled via
14016
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14017
+ *
14018
+ *
14019
+ * @remarks These protocols are reserved and cannot be registered:
14020
+ * - fin
14021
+ * - fins
14022
+ * - openfin
14023
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14024
+ *
14025
+ * @throws if a given custom protocol failed to be registered.
14026
+ * @throws if a manifest URL contains the '%1' string.
14027
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
14028
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
14029
+ *
14030
+ * @example
14031
+ * ```js
14032
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
14033
+ * ```
14034
+ */
14035
+ registerCustomProtocol(options: OpenFin_2.CustomProtocolOptions): Promise<void>;
14036
+ /**
14037
+ * Removes the registry entry for a given custom protocol.
14038
+ *
14039
+ * Note: This method is restricted by default and must be enabled via
14040
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14041
+ *
14042
+ *
14043
+ * @remarks These protocols are reserved and cannot be unregistered:
14044
+ * - fin
14045
+ * - fins
14046
+ * - openfin
14047
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14048
+ *
14049
+ * @throws if a protocol entry failed to be removed in registry.
14050
+ *
14051
+ * @example
14052
+ * ```js
14053
+ * await fin.System.unregisterCustomProtocol('protocol1');
14054
+ * ```
14055
+ */
14056
+ unregisterCustomProtocol(protocolName: string): Promise<void>;
13945
14057
  /**
13946
14058
  * Removes the process entry for the passed UUID obtained from a prior call
13947
14059
  * of fin.System.launchExternalProcess().
@@ -14638,6 +14750,14 @@ declare type SystemPermissions = {
14638
14750
  enabled: boolean;
14639
14751
  protocols: string[];
14640
14752
  };
14753
+ registerCustomProtocol: boolean | {
14754
+ enabled: boolean;
14755
+ protocols: string[];
14756
+ };
14757
+ unregisterCustomProtocol: boolean | {
14758
+ enabled: boolean;
14759
+ protocols: string[];
14760
+ };
14641
14761
  };
14642
14762
 
14643
14763
  /**
@@ -14986,7 +15106,7 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
14986
15106
  connectSync: () => void;
14987
15107
  getPort: () => string;
14988
15108
  shutdown(): Promise<void>;
14989
- connect(config: InternalConnectConfig | RemoteConfig): Promise<string | void>;
15109
+ connect(config: InternalConnectConfig | RemoteConfig | ReceiverConfig): Promise<string | void>;
14990
15110
  private connectRemote;
14991
15111
  connectByPort(config: ExistingConnectConfig): Promise<void>;
14992
15112
  private authorize;
@@ -17037,6 +17157,8 @@ declare type WebRequestHeader = {
17037
17157
  [key: string]: string;
17038
17158
  };
17039
17159
 
17160
+ declare type WebSocketReadyState = WebSocket['readyState'];
17161
+
17040
17162
  /**
17041
17163
  * Generated when a window is being moved by the user.
17042
17164
  * @remarks For use with monitor scaling that is not 100%. Bounds are given in DIP (adjusted for monitor scale factor).
@@ -19041,7 +19163,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
19041
19163
  };
19042
19164
 
19043
19165
  declare type Wire = EventEmitter & {
19044
- connect(address: string, WsConstructor: typeof WebSocket): Promise<any>;
19166
+ connect(messageReciever: MessageReceiver): Promise<any>;
19045
19167
  connectSync(): any;
19046
19168
  send(data: any): Promise<any>;
19047
19169
  shutdown(): Promise<void>;
@@ -2971,7 +2971,7 @@ declare class ClassicStrategy implements ChannelStrategy<EndpointPayload> {
2971
2971
  private messageReceiver;
2972
2972
  private endpointId;
2973
2973
  private providerIdentity;
2974
- constructor(wire: Transport, messageReceiver: MessageReceiver, endpointId: string, // Provider endpointId is channelId
2974
+ constructor(wire: Transport, messageReceiver: MessageReceiver_2, endpointId: string, // Provider endpointId is channelId
2975
2975
  providerIdentity: ProviderIdentity_4);
2976
2976
  onEndpointDisconnect(endpointId: string, listener: () => void): void;
2977
2977
  receive(listener: (action: string, payload: any, identity: OpenFin_2.ClientIdentity | OpenFin_2.ClientIdentityMultiRuntime | ProviderIdentity_4) => Promise<any>): void;
@@ -3450,7 +3450,7 @@ declare type ConstViewOptions = {
3450
3450
  /**
3451
3451
  * Controls interaction of the view with its parent window's download shelf.
3452
3452
  */
3453
- downloadShelf: {
3453
+ downloadShelf?: {
3454
3454
  /**
3455
3455
  * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3456
3456
  */
@@ -4355,6 +4355,14 @@ declare type CreateViewTarget = LayoutIdentity & {
4355
4355
  };
4356
4356
  };
4357
4357
 
4358
+ /**
4359
+ * Define possible options for Custom protocol.
4360
+ * @interface
4361
+ */
4362
+ declare type CustomProtocolOptions = {
4363
+ protocolName: string;
4364
+ };
4365
+
4358
4366
  /**
4359
4367
  * Custom headers for requests sent by the window.
4360
4368
  *
@@ -4372,6 +4380,8 @@ declare type CustomRequestHeaders = {
4372
4380
  headers: WebRequestHeader[];
4373
4381
  };
4374
4382
 
4383
+ declare type DataChannelReadyState = RTCDataChannel['readyState'];
4384
+
4375
4385
  /**
4376
4386
  * @interface
4377
4387
  */
@@ -4653,7 +4663,7 @@ declare type DownloadShelfOptions = {
4653
4663
  /**
4654
4664
  * Styling options for the download shelf border.
4655
4665
  */
4656
- border: {
4666
+ border?: {
4657
4667
  /**
4658
4668
  * Thickness of the border in pixels. Default 1 pixel. Used only for frameless windows.
4659
4669
  *
@@ -5129,7 +5139,7 @@ declare namespace ExternalApplicationEvents {
5129
5139
  }
5130
5140
 
5131
5141
  /**
5132
- * Union of possible `type` values for a {@link OpenFin.ApplicationEvents.ApplicationEvent}.
5142
+ * Union of possible `type` values for a {@link ApplicationEvent}.
5133
5143
  */
5134
5144
  declare type ExternalApplicationEventType = ExternalApplicationEvent['type'];
5135
5145
 
@@ -5455,6 +5465,8 @@ declare type FindIntentsByContextOptions<MetadataType = IntentMetadata_3> = {
5455
5465
  metadata?: MetadataType;
5456
5466
  };
5457
5467
 
5468
+ declare type FlexReadyState = WebSocketReadyState | DataChannelReadyState;
5469
+
5458
5470
  /**
5459
5471
  * Generated when a WebContents gains focus.
5460
5472
  * @interface
@@ -9095,7 +9107,17 @@ declare interface Message<T> {
9095
9107
 
9096
9108
  declare type MessageHandler = (data: any) => boolean;
9097
9109
 
9098
- declare class MessageReceiver extends Base {
9110
+ declare interface MessageReceiver {
9111
+ addEventListener(e: 'open', listener: (ev: Event) => void): void;
9112
+ addEventListener(e: 'error', listener: (ev: Event) => void): void;
9113
+ addEventListener(e: 'message', listener: (ev: MessageEvent) => void): void;
9114
+ addEventListener(e: 'close', listener: (ev: Event) => void): void;
9115
+ send(data: unknown): void;
9116
+ close(): void;
9117
+ readyState: FlexReadyState;
9118
+ }
9119
+
9120
+ declare class MessageReceiver_2 extends Base {
9099
9121
  private endpointMap;
9100
9122
  private latestEndpointIdByChannelId;
9101
9123
  constructor(wire: Transport);
@@ -9661,6 +9683,7 @@ declare namespace OpenFin_2 {
9661
9683
  Rectangle,
9662
9684
  ApplicationCreationOptions,
9663
9685
  ApplicationOptions,
9686
+ CustomProtocolOptions,
9664
9687
  InteropBrokerOptions,
9665
9688
  ContextGroupInfo,
9666
9689
  DisplayMetadata_3 as DisplayMetadata,
@@ -11900,7 +11923,7 @@ declare type PropagatedEventType<Topic extends string, Type extends string> = `$
11900
11923
 
11901
11924
  /**
11902
11925
  * A view event that has propagated to a parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
11903
- * or {@link Openfin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11926
+ * or {@link OpenFin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11904
11927
  * event type key with `'view-'`.
11905
11928
  */
11906
11929
  declare type PropagatedViewEvent<TargetTopic extends string> = PropagatedEvent<'view', TargetTopic, ViewEvent> & {
@@ -11914,7 +11937,7 @@ declare type PropagatedViewEventType = PropagatedViewEvent<string>['type'];
11914
11937
 
11915
11938
  /**
11916
11939
  * A Window event that has propagated to the parent {@link OpenFin.ApplicationEvents Application} and {@link OpenFin.SystemEvents System},
11917
- * prefixing the type string with `'window-'`. Only {@link NativeWindowEvent native window events} will propagate
11940
+ * prefixing the type string with `'window-'`. Only {@link WindowSourcedEvent window-sourced events} will propagate
11918
11941
  * this way; those that have {@link OpenFin.ViewEvents.PropagatedViewEvent propagated} from {@link OpenFin.ViewEvents}
11919
11942
  * will *not* re-propagate.
11920
11943
  *
@@ -12132,6 +12155,10 @@ declare interface ProtocolMap extends ProtocolMapBase {
12132
12155
  anchor: OpenFin_2.AnchorType;
12133
12156
  }>>;
12134
12157
  'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin_2.Bounds>>>;
12158
+ 'register-custom-protocol': ApiCall<OpenFin_2.CustomProtocolOptions, void>;
12159
+ 'unregister-custom-protocol': ApiCall<{
12160
+ protocolName: string;
12161
+ }, void>;
12135
12162
  }
12136
12163
 
12137
12164
  declare interface ProtocolMapBase {
@@ -12263,6 +12290,10 @@ declare interface ReactComponentConfig extends ItemConfig {
12263
12290
  */
12264
12291
  declare type ReadImageClipboardRequest = BaseClipboardRequest & ImageFormatOptions;
12265
12292
 
12293
+ declare interface ReceiverConfig extends Omit<RemoteConfig, 'address'> {
12294
+ receiver: MessageReceiver;
12295
+ }
12296
+
12266
12297
  /**
12267
12298
  * A rectangular area on the screen.
12268
12299
  *
@@ -12902,6 +12933,41 @@ declare type ShortcutOverride = Hotkey & {
12902
12933
 
12903
12934
  /**
12904
12935
  * Generated when the Download Shelf 'Show All' button is clicked.
12936
+ *
12937
+ * @remarks By default, OpenFin does not handle the clicking of the `Show All` button on the download
12938
+ * shelf. Instead, it fires this event, which leaves rendering a download manager to the user. For a simple
12939
+ * implementation, the `chrome://downloads` page can be used (see the example below):
12940
+ *
12941
+ * @example
12942
+ *
12943
+ * ```typescript
12944
+ * const platform = await fin.Platform.getCurrentSync();
12945
+ * // Listen to the propagated event at the Platform level, so that we only need one listener for a click from any window
12946
+ * platform.on('window-show-all-downloads', () => {
12947
+ * // Render the `chrome://downloads` window when a user clicks on the download shelf `Show All` button
12948
+ * platform.createWindow({
12949
+ * name: 'show-download-window',
12950
+ * layout: {
12951
+ * content: [
12952
+ * {
12953
+ * type: 'stack',
12954
+ * content: [
12955
+ * {
12956
+ * type: 'component',
12957
+ * componentName: 'view',
12958
+ * componentState: {
12959
+ * name: 'show-download-view',
12960
+ * url: 'chrome://downloads'
12961
+ * }
12962
+ * }
12963
+ * ]
12964
+ * }
12965
+ * ]
12966
+ * }
12967
+ * });
12968
+ * })
12969
+ * ```
12970
+ *
12905
12971
  * @interface
12906
12972
  */
12907
12973
  declare type ShowAllDownloadsEvent = BaseWindowEvent & {
@@ -13942,6 +14008,52 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
13942
14008
  * ```
13943
14009
  */
13944
14010
  openUrlWithBrowser(url: string): Promise<void>;
14011
+ /**
14012
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
14013
+ * overwrites the existing registry entry if the given custom protocol name already exists.
14014
+ *
14015
+ * Note: This method is restricted by default and must be enabled via
14016
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14017
+ *
14018
+ *
14019
+ * @remarks These protocols are reserved and cannot be registered:
14020
+ * - fin
14021
+ * - fins
14022
+ * - openfin
14023
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14024
+ *
14025
+ * @throws if a given custom protocol failed to be registered.
14026
+ * @throws if a manifest URL contains the '%1' string.
14027
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
14028
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
14029
+ *
14030
+ * @example
14031
+ * ```js
14032
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
14033
+ * ```
14034
+ */
14035
+ registerCustomProtocol(options: OpenFin_2.CustomProtocolOptions): Promise<void>;
14036
+ /**
14037
+ * Removes the registry entry for a given custom protocol.
14038
+ *
14039
+ * Note: This method is restricted by default and must be enabled via
14040
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14041
+ *
14042
+ *
14043
+ * @remarks These protocols are reserved and cannot be unregistered:
14044
+ * - fin
14045
+ * - fins
14046
+ * - openfin
14047
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14048
+ *
14049
+ * @throws if a protocol entry failed to be removed in registry.
14050
+ *
14051
+ * @example
14052
+ * ```js
14053
+ * await fin.System.unregisterCustomProtocol('protocol1');
14054
+ * ```
14055
+ */
14056
+ unregisterCustomProtocol(protocolName: string): Promise<void>;
13945
14057
  /**
13946
14058
  * Removes the process entry for the passed UUID obtained from a prior call
13947
14059
  * of fin.System.launchExternalProcess().
@@ -14638,6 +14750,14 @@ declare type SystemPermissions = {
14638
14750
  enabled: boolean;
14639
14751
  protocols: string[];
14640
14752
  };
14753
+ registerCustomProtocol: boolean | {
14754
+ enabled: boolean;
14755
+ protocols: string[];
14756
+ };
14757
+ unregisterCustomProtocol: boolean | {
14758
+ enabled: boolean;
14759
+ protocols: string[];
14760
+ };
14641
14761
  };
14642
14762
 
14643
14763
  /**
@@ -14986,7 +15106,7 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
14986
15106
  connectSync: () => void;
14987
15107
  getPort: () => string;
14988
15108
  shutdown(): Promise<void>;
14989
- connect(config: InternalConnectConfig | RemoteConfig): Promise<string | void>;
15109
+ connect(config: InternalConnectConfig | RemoteConfig | ReceiverConfig): Promise<string | void>;
14990
15110
  private connectRemote;
14991
15111
  connectByPort(config: ExistingConnectConfig): Promise<void>;
14992
15112
  private authorize;
@@ -17037,6 +17157,8 @@ declare type WebRequestHeader = {
17037
17157
  [key: string]: string;
17038
17158
  };
17039
17159
 
17160
+ declare type WebSocketReadyState = WebSocket['readyState'];
17161
+
17040
17162
  /**
17041
17163
  * Generated when a window is being moved by the user.
17042
17164
  * @remarks For use with monitor scaling that is not 100%. Bounds are given in DIP (adjusted for monitor scale factor).
@@ -19041,7 +19163,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
19041
19163
  };
19042
19164
 
19043
19165
  declare type Wire = EventEmitter & {
19044
- connect(address: string, WsConstructor: typeof WebSocket): Promise<any>;
19166
+ connect(messageReciever: MessageReceiver): Promise<any>;
19045
19167
  connectSync(): any;
19046
19168
  send(data: any): Promise<any>;
19047
19169
  shutdown(): Promise<void>;
package/out/mock.d.ts CHANGED
@@ -3011,7 +3011,7 @@ declare class ClassicStrategy implements ChannelStrategy<EndpointPayload> {
3011
3011
  private messageReceiver;
3012
3012
  private endpointId;
3013
3013
  private providerIdentity;
3014
- constructor(wire: Transport, messageReceiver: MessageReceiver, endpointId: string, // Provider endpointId is channelId
3014
+ constructor(wire: Transport, messageReceiver: MessageReceiver_2, endpointId: string, // Provider endpointId is channelId
3015
3015
  providerIdentity: ProviderIdentity_4);
3016
3016
  onEndpointDisconnect(endpointId: string, listener: () => void): void;
3017
3017
  receive(listener: (action: string, payload: any, identity: OpenFin_2.ClientIdentity | OpenFin_2.ClientIdentityMultiRuntime | ProviderIdentity_4) => Promise<any>): void;
@@ -3544,7 +3544,7 @@ declare type ConstViewOptions = {
3544
3544
  /**
3545
3545
  * Controls interaction of the view with its parent window's download shelf.
3546
3546
  */
3547
- downloadShelf: {
3547
+ downloadShelf?: {
3548
3548
  /**
3549
3549
  * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3550
3550
  */
@@ -4449,6 +4449,14 @@ declare type CreateViewTarget = LayoutIdentity & {
4449
4449
  };
4450
4450
  };
4451
4451
 
4452
+ /**
4453
+ * Define possible options for Custom protocol.
4454
+ * @interface
4455
+ */
4456
+ declare type CustomProtocolOptions = {
4457
+ protocolName: string;
4458
+ };
4459
+
4452
4460
  /**
4453
4461
  * Custom headers for requests sent by the window.
4454
4462
  *
@@ -4466,6 +4474,8 @@ declare type CustomRequestHeaders = {
4466
4474
  headers: WebRequestHeader[];
4467
4475
  };
4468
4476
 
4477
+ declare type DataChannelReadyState = RTCDataChannel['readyState'];
4478
+
4469
4479
  /**
4470
4480
  * @interface
4471
4481
  */
@@ -4747,7 +4757,7 @@ declare type DownloadShelfOptions = {
4747
4757
  /**
4748
4758
  * Styling options for the download shelf border.
4749
4759
  */
4750
- border: {
4760
+ border?: {
4751
4761
  /**
4752
4762
  * Thickness of the border in pixels. Default 1 pixel. Used only for frameless windows.
4753
4763
  *
@@ -5247,7 +5257,7 @@ declare namespace ExternalApplicationEvents {
5247
5257
  }
5248
5258
 
5249
5259
  /**
5250
- * Union of possible `type` values for a {@link OpenFin.ApplicationEvents.ApplicationEvent}.
5260
+ * Union of possible `type` values for a {@link ApplicationEvent}.
5251
5261
  */
5252
5262
  declare type ExternalApplicationEventType = ExternalApplicationEvent['type'];
5253
5263
 
@@ -5573,6 +5583,8 @@ declare type FindIntentsByContextOptions<MetadataType = IntentMetadata_3> = {
5573
5583
  metadata?: MetadataType;
5574
5584
  };
5575
5585
 
5586
+ declare type FlexReadyState = WebSocketReadyState | DataChannelReadyState;
5587
+
5576
5588
  /**
5577
5589
  * Generated when a WebContents gains focus.
5578
5590
  * @interface
@@ -9423,7 +9435,17 @@ declare interface Message<T> {
9423
9435
 
9424
9436
  declare type MessageHandler = (data: any) => boolean;
9425
9437
 
9426
- declare class MessageReceiver extends Base {
9438
+ declare interface MessageReceiver {
9439
+ addEventListener(e: 'open', listener: (ev: Event) => void): void;
9440
+ addEventListener(e: 'error', listener: (ev: Event) => void): void;
9441
+ addEventListener(e: 'message', listener: (ev: MessageEvent) => void): void;
9442
+ addEventListener(e: 'close', listener: (ev: Event) => void): void;
9443
+ send(data: unknown): void;
9444
+ close(): void;
9445
+ readyState: FlexReadyState;
9446
+ }
9447
+
9448
+ declare class MessageReceiver_2 extends Base {
9427
9449
  private endpointMap;
9428
9450
  private latestEndpointIdByChannelId;
9429
9451
  constructor(wire: Transport);
@@ -10000,6 +10022,7 @@ declare namespace OpenFin_2 {
10000
10022
  Rectangle,
10001
10023
  ApplicationCreationOptions,
10002
10024
  ApplicationOptions,
10025
+ CustomProtocolOptions,
10003
10026
  InteropBrokerOptions,
10004
10027
  ContextGroupInfo,
10005
10028
  DisplayMetadata_3 as DisplayMetadata,
@@ -12320,7 +12343,7 @@ declare type PropagatedEventType<Topic extends string, Type extends string> = `$
12320
12343
 
12321
12344
  /**
12322
12345
  * A view event that has propagated to a parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
12323
- * or {@link Openfin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
12346
+ * or {@link OpenFin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
12324
12347
  * event type key with `'view-'`.
12325
12348
  */
12326
12349
  declare type PropagatedViewEvent<TargetTopic extends string> = PropagatedEvent<'view', TargetTopic, ViewEvent> & {
@@ -12334,7 +12357,7 @@ declare type PropagatedViewEventType = PropagatedViewEvent<string>['type'];
12334
12357
 
12335
12358
  /**
12336
12359
  * A Window event that has propagated to the parent {@link OpenFin.ApplicationEvents Application} and {@link OpenFin.SystemEvents System},
12337
- * prefixing the type string with `'window-'`. Only {@link NativeWindowEvent native window events} will propagate
12360
+ * prefixing the type string with `'window-'`. Only {@link WindowSourcedEvent window-sourced events} will propagate
12338
12361
  * this way; those that have {@link OpenFin.ViewEvents.PropagatedViewEvent propagated} from {@link OpenFin.ViewEvents}
12339
12362
  * will *not* re-propagate.
12340
12363
  *
@@ -12552,6 +12575,10 @@ declare interface ProtocolMap extends ProtocolMapBase {
12552
12575
  anchor: OpenFin_2.AnchorType;
12553
12576
  }>>;
12554
12577
  'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin_2.Bounds>>>;
12578
+ 'register-custom-protocol': ApiCall<OpenFin_2.CustomProtocolOptions, void>;
12579
+ 'unregister-custom-protocol': ApiCall<{
12580
+ protocolName: string;
12581
+ }, void>;
12555
12582
  }
12556
12583
 
12557
12584
  declare interface ProtocolMapBase {
@@ -12683,6 +12710,10 @@ declare interface ReactComponentConfig extends ItemConfig {
12683
12710
  */
12684
12711
  declare type ReadImageClipboardRequest = BaseClipboardRequest & ImageFormatOptions;
12685
12712
 
12713
+ declare interface ReceiverConfig extends Omit<RemoteConfig, 'address'> {
12714
+ receiver: MessageReceiver;
12715
+ }
12716
+
12686
12717
  /**
12687
12718
  * A rectangular area on the screen.
12688
12719
  *
@@ -13322,6 +13353,41 @@ declare type ShortcutOverride = Hotkey & {
13322
13353
 
13323
13354
  /**
13324
13355
  * Generated when the Download Shelf 'Show All' button is clicked.
13356
+ *
13357
+ * @remarks By default, OpenFin does not handle the clicking of the `Show All` button on the download
13358
+ * shelf. Instead, it fires this event, which leaves rendering a download manager to the user. For a simple
13359
+ * implementation, the `chrome://downloads` page can be used (see the example below):
13360
+ *
13361
+ * @example
13362
+ *
13363
+ * ```typescript
13364
+ * const platform = await fin.Platform.getCurrentSync();
13365
+ * // Listen to the propagated event at the Platform level, so that we only need one listener for a click from any window
13366
+ * platform.on('window-show-all-downloads', () => {
13367
+ * // Render the `chrome://downloads` window when a user clicks on the download shelf `Show All` button
13368
+ * platform.createWindow({
13369
+ * name: 'show-download-window',
13370
+ * layout: {
13371
+ * content: [
13372
+ * {
13373
+ * type: 'stack',
13374
+ * content: [
13375
+ * {
13376
+ * type: 'component',
13377
+ * componentName: 'view',
13378
+ * componentState: {
13379
+ * name: 'show-download-view',
13380
+ * url: 'chrome://downloads'
13381
+ * }
13382
+ * }
13383
+ * ]
13384
+ * }
13385
+ * ]
13386
+ * }
13387
+ * });
13388
+ * })
13389
+ * ```
13390
+ *
13325
13391
  * @interface
13326
13392
  */
13327
13393
  declare type ShowAllDownloadsEvent = BaseWindowEvent & {
@@ -14368,6 +14434,52 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
14368
14434
  * ```
14369
14435
  */
14370
14436
  openUrlWithBrowser(url: string): Promise<void>;
14437
+ /**
14438
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
14439
+ * overwrites the existing registry entry if the given custom protocol name already exists.
14440
+ *
14441
+ * Note: This method is restricted by default and must be enabled via
14442
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14443
+ *
14444
+ *
14445
+ * @remarks These protocols are reserved and cannot be registered:
14446
+ * - fin
14447
+ * - fins
14448
+ * - openfin
14449
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14450
+ *
14451
+ * @throws if a given custom protocol failed to be registered.
14452
+ * @throws if a manifest URL contains the '%1' string.
14453
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
14454
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
14455
+ *
14456
+ * @example
14457
+ * ```js
14458
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
14459
+ * ```
14460
+ */
14461
+ registerCustomProtocol(options: OpenFin_2.CustomProtocolOptions): Promise<void>;
14462
+ /**
14463
+ * Removes the registry entry for a given custom protocol.
14464
+ *
14465
+ * Note: This method is restricted by default and must be enabled via
14466
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14467
+ *
14468
+ *
14469
+ * @remarks These protocols are reserved and cannot be unregistered:
14470
+ * - fin
14471
+ * - fins
14472
+ * - openfin
14473
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14474
+ *
14475
+ * @throws if a protocol entry failed to be removed in registry.
14476
+ *
14477
+ * @example
14478
+ * ```js
14479
+ * await fin.System.unregisterCustomProtocol('protocol1');
14480
+ * ```
14481
+ */
14482
+ unregisterCustomProtocol(protocolName: string): Promise<void>;
14371
14483
  /**
14372
14484
  * Removes the process entry for the passed UUID obtained from a prior call
14373
14485
  * of fin.System.launchExternalProcess().
@@ -15064,6 +15176,14 @@ declare type SystemPermissions = {
15064
15176
  enabled: boolean;
15065
15177
  protocols: string[];
15066
15178
  };
15179
+ registerCustomProtocol: boolean | {
15180
+ enabled: boolean;
15181
+ protocols: string[];
15182
+ };
15183
+ unregisterCustomProtocol: boolean | {
15184
+ enabled: boolean;
15185
+ protocols: string[];
15186
+ };
15067
15187
  };
15068
15188
 
15069
15189
  /**
@@ -15469,7 +15589,7 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
15469
15589
  connectSync: () => void;
15470
15590
  getPort: () => string;
15471
15591
  shutdown(): Promise<void>;
15472
- connect(config: InternalConnectConfig | RemoteConfig): Promise<string | void>;
15592
+ connect(config: InternalConnectConfig | RemoteConfig | ReceiverConfig): Promise<string | void>;
15473
15593
  private connectRemote;
15474
15594
  connectByPort(config: ExistingConnectConfig): Promise<void>;
15475
15595
  private authorize;
@@ -17557,6 +17677,8 @@ declare type WebRequestHeader = {
17557
17677
  [key: string]: string;
17558
17678
  };
17559
17679
 
17680
+ declare type WebSocketReadyState = WebSocket['readyState'];
17681
+
17560
17682
  /**
17561
17683
  * Generated when a window is being moved by the user.
17562
17684
  * @remarks For use with monitor scaling that is not 100%. Bounds are given in DIP (adjusted for monitor scale factor).
@@ -19645,7 +19767,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
19645
19767
  };
19646
19768
 
19647
19769
  declare type Wire = EventEmitter & {
19648
- connect(address: string, WsConstructor: typeof WebSocket): Promise<any>;
19770
+ connect(messageReciever: MessageReceiver): Promise<any>;
19649
19771
  connectSync(): any;
19650
19772
  send(data: any): Promise<any>;
19651
19773
  shutdown(): Promise<void>;
package/out/mock.js CHANGED
@@ -26,9 +26,9 @@ var application$1 = {};
26
26
  * child {@link OpenFin.Window windows} and {@link OpenFin.View views} are defined in the {@link OpenFin.WindowEvents} and
27
27
  * {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all* application events, see {@link Application.on Application.on}.
28
28
  *
29
- * {@link NativeApplicationEvent Native application events} (i.e. those that have not propagated from {@link OpenFin.ViewEvents Views}
29
+ * {@link ApplicationSourcedEvent Application-sourced events} (i.e. those that have not propagated from {@link OpenFin.ViewEvents Views}
30
30
  * or {@link OpenFin.WindowEvents Windows} re-propagate to {@link OpenFin.SystemEvents System} with their type string prefixed with `application-`.
31
- * {@link OpenFin.ApplicationEvents.ApplicationWindowEvent Application events that are tied to Windows but do not propagate from them}
31
+ * {@link ApplicationWindowEvent Application events that are tied to Windows but do not propagate from them}
32
32
  * are propagated to `System` without any type string prefixing.
33
33
  *
34
34
  * "Requested" events (e.g. {@link RunRequestedEvent}) do not propagate.
@@ -151,7 +151,7 @@ var window$2 = {};
151
151
  * propagate from `View` are defined in {@link OpenFin.ViewEvents}. For a list of valid string keys for *all* Window events, see
152
152
  * {@link Window.on Window.on}
153
153
  *
154
- * {@link OpenFin.WindowEvents.NativeWindowEvent Native window events} (i.e. those that are not propagated from a
154
+ * {@link OpenFin.WindowEvents.WindowSourcedEvent Window-sourced events} (i.e. those that are not propagated from a
155
155
  * {@link OpenFin.ViewEvents View}) propagate to their parent {@link OpenFin.ApplicationEvents Application} and
156
156
  * {@link OpenFin.SystemEvents System} with their event types prefixed with `'window-'`).
157
157
  *
@@ -196,10 +196,10 @@ Object.defineProperty(window$2, "__esModule", { value: true });
196
196
  * finally to the OpenFin runtime itself at the "system" level. For details on propagation semantics, see the namespace for
197
197
  * the propagating (or propagated-to) entity.
198
198
  *
199
- * If you need the payload type for a specific type of event (especially propagated events), use the emitting topic's `EventPayload`
200
- * (e.g. {@link WindowEvents.WindowEventPayload}) generic with the event's `type` string. For example, the payload of
199
+ * If you need the payload type for a specific type of event (especially propagated events), use the emitting topic's `Payload` generic
200
+ * (e.g. {@link WindowEvents.Payload}) with the event's `type` string. For example, the payload of
201
201
  * a {@link ViewEvents.CreatedEvent} after it has propagated to its parent {@link WindowEvents Window} can be found with
202
- * `WindowEventPayload<'view-created'>`.
202
+ * `WindowEvents.Payload<'view-created'>`.
203
203
  *
204
204
  * @packageDocumentation
205
205
  */
@@ -7656,6 +7656,59 @@ class System extends base_1$j.EmitterBase {
7656
7656
  openUrlWithBrowser(url) {
7657
7657
  return this.wire.sendAction('open-url-with-browser', { url }).then(() => undefined);
7658
7658
  }
7659
+ /**
7660
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
7661
+ * overwrites the existing registry entry if the given custom protocol name already exists.
7662
+ *
7663
+ * Note: This method is restricted by default and must be enabled via
7664
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7665
+ *
7666
+ *
7667
+ * @remarks These protocols are reserved and cannot be registered:
7668
+ * - fin
7669
+ * - fins
7670
+ * - openfin
7671
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7672
+ *
7673
+ * @throws if a given custom protocol failed to be registered.
7674
+ * @throws if a manifest URL contains the '%1' string.
7675
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
7676
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
7677
+ *
7678
+ * @example
7679
+ * ```js
7680
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
7681
+ * ```
7682
+ */
7683
+ async registerCustomProtocol(options) {
7684
+ if (typeof options !== 'object') {
7685
+ throw new Error('Must provide an object with a `protocolName` property having a string value.');
7686
+ }
7687
+ await this.wire.sendAction('register-custom-protocol', options);
7688
+ }
7689
+ /**
7690
+ * Removes the registry entry for a given custom protocol.
7691
+ *
7692
+ * Note: This method is restricted by default and must be enabled via
7693
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7694
+ *
7695
+ *
7696
+ * @remarks These protocols are reserved and cannot be unregistered:
7697
+ * - fin
7698
+ * - fins
7699
+ * - openfin
7700
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7701
+ *
7702
+ * @throws if a protocol entry failed to be removed in registry.
7703
+ *
7704
+ * @example
7705
+ * ```js
7706
+ * await fin.System.unregisterCustomProtocol('protocol1');
7707
+ * ```
7708
+ */
7709
+ async unregisterCustomProtocol(protocolName) {
7710
+ await this.wire.sendAction('unregister-custom-protocol', { protocolName });
7711
+ }
7659
7712
  /**
7660
7713
  * Removes the process entry for the passed UUID obtained from a prior call
7661
7714
  * of fin.System.launchExternalProcess().
@@ -16756,7 +16809,7 @@ var transport = {};
16756
16809
  var wire = {};
16757
16810
 
16758
16811
  Object.defineProperty(wire, "__esModule", { value: true });
16759
- wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16812
+ wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isConfigWithReceiver = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16760
16813
  function isExternalConfig(config) {
16761
16814
  if (typeof config.manifestUrl === 'string') {
16762
16815
  return true;
@@ -16772,6 +16825,10 @@ function isRemoteConfig(config) {
16772
16825
  return isExistingConnectConfig(config) && typeof config.token === 'string';
16773
16826
  }
16774
16827
  wire.isRemoteConfig = isRemoteConfig;
16828
+ function isConfigWithReceiver(config) {
16829
+ return typeof config.receiver === 'object' && isRemoteConfig({ ...config, address: '' });
16830
+ }
16831
+ wire.isConfigWithReceiver = isConfigWithReceiver;
16775
16832
  function hasUuid(config) {
16776
16833
  return typeof config.uuid === 'string';
16777
16834
  }
@@ -16921,13 +16978,13 @@ class Transport extends events_1$1.EventEmitter {
16921
16978
  }
16922
16979
  getFin() {
16923
16980
  if (!__classPrivateFieldGet(this, _Transport_fin, "f")) {
16924
- throw new Error("No Fin object registered for this transport");
16981
+ throw new Error('No Fin object registered for this transport');
16925
16982
  }
16926
16983
  return __classPrivateFieldGet(this, _Transport_fin, "f");
16927
16984
  }
16928
16985
  registerFin(_fin) {
16929
16986
  if (__classPrivateFieldGet(this, _Transport_fin, "f")) {
16930
- throw new Error("Fin object has already been registered for this transport");
16987
+ throw new Error('Fin object has already been registered for this transport');
16931
16988
  }
16932
16989
  __classPrivateFieldSet(this, _Transport_fin, _fin, "f");
16933
16990
  }
@@ -16936,6 +16993,10 @@ class Transport extends events_1$1.EventEmitter {
16936
16993
  return wire.shutdown();
16937
16994
  }
16938
16995
  async connect(config) {
16996
+ if ((0, wire_1.isConfigWithReceiver)(config)) {
16997
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.receiver);
16998
+ return this.authorize(config);
16999
+ }
16939
17000
  if ((0, wire_1.isRemoteConfig)(config)) {
16940
17001
  return this.connectRemote(config);
16941
17002
  }
@@ -16949,14 +17010,14 @@ class Transport extends events_1$1.EventEmitter {
16949
17010
  return undefined;
16950
17011
  }
16951
17012
  async connectRemote(config) {
16952
- await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.address, this.environment.getWsConstructor());
17013
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
16953
17014
  return this.authorize(config);
16954
17015
  }
16955
17016
  async connectByPort(config) {
16956
17017
  const { address, uuid } = config;
16957
17018
  const reqAuthPayload = { ...config, type: 'file-token' };
16958
17019
  const wire = __classPrivateFieldGet(this, _Transport_wire, "f");
16959
- await wire.connect(address, this.environment.getWsConstructor());
17020
+ await wire.connect(new (this.environment.getWsConstructor())(config.address));
16960
17021
  const requestExtAuthRet = await this.sendAction('request-external-authorization', {
16961
17022
  uuid,
16962
17023
  type: 'file-token'
@@ -16976,7 +17037,9 @@ class Transport extends events_1$1.EventEmitter {
16976
17037
  throw new transport_errors_1.RuntimeError(requestAuthRet.payload);
16977
17038
  }
16978
17039
  }
16979
- sendAction(action, payload = {}, uncorrelated = false) {
17040
+ sendAction(action, payload = {}, uncorrelated = false
17041
+ // specialResponse type is only used for 'requestAuthorization'
17042
+ ) {
16980
17043
  // eslint-disable-next-line @typescript-eslint/no-empty-function
16981
17044
  let cancel = () => { };
16982
17045
  // We want the callsite from the caller of this function, not from here.
@@ -17026,7 +17089,10 @@ class Transport extends events_1$1.EventEmitter {
17026
17089
  this.uncorrelatedListener = resolve;
17027
17090
  }
17028
17091
  else if (this.wireListeners.has(id)) {
17029
- handleNack({ reason: 'Duplicate handler id', error: (0, errors_1.errorToPOJO)(new transport_errors_1.DuplicateCorrelationError(String(id))) });
17092
+ handleNack({
17093
+ reason: 'Duplicate handler id',
17094
+ error: (0, errors_1.errorToPOJO)(new transport_errors_1.DuplicateCorrelationError(String(id)))
17095
+ });
17030
17096
  }
17031
17097
  else {
17032
17098
  this.wireListeners.set(id, { resolve, handleNack });
@@ -17153,7 +17219,7 @@ Object.defineProperty(mockWire, "__esModule", { value: true });
17153
17219
  mockWire.MockWire = void 0;
17154
17220
  const events_1 = require$$0;
17155
17221
  class MockWire extends events_1.EventEmitter {
17156
- connect(address) {
17222
+ connect() {
17157
17223
  throw new Error('You are not running in OpenFin.');
17158
17224
  }
17159
17225
  connectSync() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "34.78.6",
3
+ "version": "34.78.8",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.MD",
6
6
  "main": "out/mock.js",