@openfin/node-adapter 34.78.49 → 34.78.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- /// <reference types="jquery" />
2
1
  /// <reference types="node" />
3
2
 
4
3
  import { EventEmitter } from 'events';
@@ -43,15 +42,6 @@ declare type Accelerator = {
43
42
  zoom: boolean;
44
43
  };
45
44
 
46
- /**
47
- * @interface
48
- */
49
- declare type AddLayoutInstanceOptions = {
50
- container: HTMLDivElement;
51
- layoutName: string;
52
- layout: LayoutOptions;
53
- };
54
-
55
45
  /**
56
46
  * @interface
57
47
  */
@@ -1726,6 +1716,23 @@ declare type BaseConfig = {
1726
1716
  timeout?: number;
1727
1717
  };
1728
1718
 
1719
+ /**
1720
+ * Properties shared by all content creation rules, regardless of context.
1721
+ *
1722
+ * @interface
1723
+ */
1724
+ declare type BaseContentCreationRule = {
1725
+ /**
1726
+ * List of [match patterns](https://developer.chrome.com/extensions/match_patterns) that indicate the specified
1727
+ * behavior should be used
1728
+ */
1729
+ match: MatchPattern[];
1730
+ /**
1731
+ * custom property
1732
+ */
1733
+ data?: unknown;
1734
+ };
1735
+
1729
1736
  /**
1730
1737
  * A base OpenFin event. All OpenFin event payloads extend this type.
1731
1738
  *
@@ -1826,6 +1833,18 @@ declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
1826
1833
  type: 'begin-user-bounds-changing';
1827
1834
  };
1828
1835
 
1836
+ /**
1837
+ * A rule prescribing content creation that should be blocked.
1838
+ *
1839
+ * @interface
1840
+ */
1841
+ declare type BlockedContentCreationRule = BaseContentCreationRule & {
1842
+ /**
1843
+ * Behavior to use when opening matched content.
1844
+ */
1845
+ behavior: 'block';
1846
+ };
1847
+
1829
1848
  /**
1830
1849
  * Generated when a WebContents loses focus.
1831
1850
  * @interface
@@ -1873,6 +1892,18 @@ declare type BoundsChangingEvent = BoundsChangeEvent & {
1873
1892
  type: 'bounds-changing';
1874
1893
  };
1875
1894
 
1895
+ /**
1896
+ * A rule prescribing content creation in the browser.
1897
+ *
1898
+ * @interface
1899
+ */
1900
+ declare type BrowserContentCreationRule = BaseContentCreationRule & {
1901
+ /**
1902
+ * Behavior to use when opening matched content.
1903
+ */
1904
+ behavior: 'browser';
1905
+ };
1906
+
1876
1907
  declare interface BrowserWindow {
1877
1908
  /**
1878
1909
  * True if the window has been opened and its GoldenLayout instance initialised.
@@ -2972,7 +3003,7 @@ declare class ClassicStrategy implements ChannelStrategy<EndpointPayload> {
2972
3003
  private messageReceiver;
2973
3004
  private endpointId;
2974
3005
  private providerIdentity;
2975
- constructor(wire: Transport, messageReceiver: MessageReceiver, endpointId: string, // Provider endpointId is channelId
3006
+ constructor(wire: Transport, messageReceiver: MessageReceiver_2, endpointId: string, // Provider endpointId is channelId
2976
3007
  providerIdentity: ProviderIdentity_4);
2977
3008
  onEndpointDisconnect(endpointId: string, listener: () => void): void;
2978
3009
  receive(listener: (action: string, payload: any, identity: OpenFin.ClientIdentity | OpenFin.ClientIdentityMultiRuntime | ProviderIdentity_4) => Promise<any>): void;
@@ -3251,6 +3282,16 @@ declare type ClosedMenuResult = {
3251
3282
  result: 'closed';
3252
3283
  };
3253
3284
 
3285
+ /**
3286
+ * @interface
3287
+ */
3288
+ declare type CloseViewOptions = {
3289
+ /**
3290
+ *View to be closed.
3291
+ */
3292
+ viewIdentity: Identity_5;
3293
+ };
3294
+
3254
3295
  /**
3255
3296
  * @interface
3256
3297
  */
@@ -3259,6 +3300,11 @@ declare type CloseViewPayload = {
3259
3300
  *View to be closed.
3260
3301
  */
3261
3302
  view: Identity_5;
3303
+ /**
3304
+ * The target layout identity where this view should be closed. If not provided, will resolve to the
3305
+ * visible layout.
3306
+ */
3307
+ target?: LayoutIdentity;
3262
3308
  };
3263
3309
 
3264
3310
  /**
@@ -3444,12 +3490,23 @@ declare type ConstViewOptions = {
3444
3490
  /**
3445
3491
  * **Platforms Only.**
3446
3492
  * Determines what happens when a view is closed in a platform window.
3447
- * Supersedes `detachOnClose`, but has no default value.
3493
+ * Supersedes the deprecated `detachOnClose`.
3494
+ * If not set, detaults to `destroy` if `detachOnClose` is false (default), or `detach` if `detachOnClose` is true.
3495
+ * While this option is not updateable, it may change at runtime if `detachOnClose` is updated.
3448
3496
  * 'hide' hides the view on the platform window that closed it.
3449
- * 'detach' behaves like 'detachOnClose': true.
3450
- * 'destroy' is the default behavior as long as 'detachOnClose' is not set.
3497
+ * 'detach' behaves like 'detachOnClose': true. It attaches the closed view to the platform provider.
3498
+ * 'destroy' is the default behavior as long as 'detachOnClose' is not set. It destroys the view.
3451
3499
  */
3452
- closeBehavior?: 'hide' | 'detach' | 'destroy';
3500
+ closeBehavior: 'hide' | 'detach' | 'destroy';
3501
+ /**
3502
+ * Controls interaction of the view with its parent window's download shelf.
3503
+ */
3504
+ downloadShelf?: {
3505
+ /**
3506
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3507
+ */
3508
+ enabled: boolean;
3509
+ };
3453
3510
  };
3454
3511
 
3455
3512
  /**
@@ -3561,8 +3618,16 @@ declare type ConstWindowOptions = {
3561
3618
  * launches in favor of the cached value.
3562
3619
  */
3563
3620
  defaultWidth: number;
3621
+ downloadShelf: DownloadShelfOptions;
3564
3622
  height: number;
3565
3623
  layout: any;
3624
+ /**
3625
+ * @experimental
3626
+ *
3627
+ * The collection of layouts to load when the window is created. When launching multiple layouts, manage
3628
+ * the lifecycle via fin.Platform.Layout.create()/destroy() methods.
3629
+ */
3630
+ layoutSnapshot: LayoutSnapshot;
3566
3631
  /**
3567
3632
  * Parent identity of a modal window. It will create a modal child window when this option is set.
3568
3633
  */
@@ -3778,28 +3843,15 @@ declare type ContentCreationOptions = {
3778
3843
  * A rule for creating content in OpenFin; maps a content type to the way in which
3779
3844
  * newly-opened content of that type will be handled.
3780
3845
  *
3846
+ * @remarks This is effectively just a union type discriminated by the `behavior` key. The generic
3847
+ * parameter is a legacy feature that is included for backwards-compatibility reasons.
3781
3848
  *
3782
- * @interface
3849
+ * @typeParam Behavior The way content governed by this rule will be created. If provided, this type will narrow to
3850
+ * the specified `behavior` key.
3783
3851
  */
3784
- declare type ContentCreationRule<T = ContentCreationBehaviorNames> = {
3785
- /**
3786
- * Behavior to use when opening matched content. The value could be 'view' | 'window' | 'browser' | 'block'.
3787
- */
3788
- behavior: T;
3789
- /**
3790
- * List of [match patterns](https://developer.chrome.com/extensions/match_patterns) that indicate the specified
3791
- * behavior should be used
3792
- */
3793
- match: MatchPattern[];
3794
- /**
3795
- * Options for newly-created view or window (if applicable).
3796
- */
3797
- options?: T extends 'window' ? Partial<WindowOptions> : T extends 'view' ? Partial<ViewOptions> : never;
3798
- /**
3799
- * custom property
3800
- */
3801
- data?: unknown;
3802
- };
3852
+ declare type ContentCreationRule<Behavior extends ContentCreationBehaviorNames = ContentCreationBehaviorNames> = Extract<WindowContentCreationRule | ViewContentCreationRule | BrowserContentCreationRule | BlockedContentCreationRule, {
3853
+ behavior: Behavior;
3854
+ }>;
3803
3855
 
3804
3856
  /**
3805
3857
  * @interface
@@ -4308,15 +4360,12 @@ declare type CreatedEvent = BaseViewEvent & {
4308
4360
  };
4309
4361
 
4310
4362
  /**
4311
- * @interface
4363
+ * @interface @experimental
4312
4364
  */
4313
4365
  declare type CreateLayoutOptions = {
4314
- /**
4315
- * @experimental
4316
- *
4317
- * @returns
4318
- */
4319
- layoutManagerOverride: () => any;
4366
+ container: HTMLElement;
4367
+ layoutName: string;
4368
+ layout: LayoutOptions;
4320
4369
  };
4321
4370
 
4322
4371
  /**
@@ -4337,7 +4386,7 @@ declare type CreateViewPayload = {
4337
4386
  /**
4338
4387
  * @interface
4339
4388
  */
4340
- declare type CreateViewTarget = Identity_5 & {
4389
+ declare type CreateViewTarget = LayoutIdentity & {
4341
4390
  /**
4342
4391
  * If specified, view creation will not attach to a window and caller must
4343
4392
  * insert the view into the layout explicitly
@@ -4348,6 +4397,44 @@ declare type CreateViewTarget = Identity_5 & {
4348
4397
  };
4349
4398
  };
4350
4399
 
4400
+ /**
4401
+ * The registry entry for a given protocol exists but can't be parsed.
4402
+ * @interface
4403
+ */
4404
+ declare type CustomProtocolMalformedState = {
4405
+ state: 'Malformed';
4406
+ };
4407
+
4408
+ /**
4409
+ * The registry entry is missing for a given custom protocol.
4410
+ * @interface
4411
+ */
4412
+ declare type CustomProtocolMissingState = {
4413
+ state: 'Missing';
4414
+ };
4415
+
4416
+ /**
4417
+ * Define possible options for Custom protocol.
4418
+ * @interface
4419
+ */
4420
+ declare type CustomProtocolOptions = {
4421
+ protocolName: string;
4422
+ };
4423
+
4424
+ /**
4425
+ * The registry rentry for a given protocol exists and can be parsed successfully.
4426
+ * @interface
4427
+ */
4428
+ declare type CustomProtocolRegisteredState = {
4429
+ state: 'Registered';
4430
+ handlerManifestUrl: string;
4431
+ };
4432
+
4433
+ /**
4434
+ * Define possible registration states for a given custom protocol.
4435
+ */
4436
+ declare type CustomProtocolState = CustomProtocolMissingState | CustomProtocolMalformedState | CustomProtocolRegisteredState;
4437
+
4351
4438
  /**
4352
4439
  * Custom headers for requests sent by the window.
4353
4440
  *
@@ -4365,6 +4452,8 @@ declare type CustomRequestHeaders = {
4365
4452
  headers: WebRequestHeader[];
4366
4453
  };
4367
4454
 
4455
+ declare type DataChannelReadyState = RTCDataChannel['readyState'];
4456
+
4368
4457
  /**
4369
4458
  * @interface
4370
4459
  */
@@ -4437,13 +4526,6 @@ declare type DestroyedEvent = BaseViewEvent & {
4437
4526
  type: 'destroyed';
4438
4527
  };
4439
4528
 
4440
- /**
4441
- * @interface
4442
- */
4443
- declare type DestroyLayoutOptions = {
4444
- layoutName: string;
4445
- };
4446
-
4447
4529
  /**
4448
4530
  * Generated when a page's theme color changes. This is usually due to encountering a meta tag.
4449
4531
  * @interface
@@ -4640,6 +4722,47 @@ declare type DownloadRule = {
4640
4722
  match: string[];
4641
4723
  };
4642
4724
 
4725
+ /**
4726
+ * @interface
4727
+ *
4728
+ * Controls the styling and behavior of the window download shelf.
4729
+ */
4730
+ declare type DownloadShelfOptions = {
4731
+ /**
4732
+ * Whether downloads in this window trigger opening the download shelf.
4733
+ */
4734
+ enabled: boolean;
4735
+ /**
4736
+ * Styling options for the download shelf border.
4737
+ */
4738
+ border?: {
4739
+ /**
4740
+ * Thickness of the border in pixels. Default 1 pixel. Used only for frameless windows.
4741
+ *
4742
+ * @remarks The top border is fixed to 1 pixel regardless of this setting.
4743
+ */
4744
+ size?: number;
4745
+ /**
4746
+ * Color of the border, either a string name or a hex code. Defaults to chromium theme
4747
+ * if absent.
4748
+ */
4749
+ color?: string;
4750
+ };
4751
+ };
4752
+
4753
+ /**
4754
+ * Generated when the visibility of the window's download shelf changes.
4755
+ *
4756
+ * @interface
4757
+ */
4758
+ declare type DownloadShelfVisibilityChangedEvent = BaseWindowEvent & {
4759
+ type: 'download-shelf-visibility-changed';
4760
+ /**
4761
+ * True if the download shelf was just opened; false if it was just closed.
4762
+ */
4763
+ visible: boolean;
4764
+ };
4765
+
4643
4766
  /**
4644
4767
  * DPI (dots per inch) configuration for printing.
4645
4768
  *
@@ -4839,9 +4962,11 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
4839
4962
  } : never;
4840
4963
 
4841
4964
  declare interface Environment {
4842
- initLayout(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, ...args: Parameters<OpenFin.Fin['Platform']['Layout']['init']>): ReturnType<OpenFin.Fin['Platform']['Layout']['init']>;
4965
+ initLayout(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
4966
+ createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
4967
+ destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
4843
4968
  initPlatform(fin: OpenFin.Fin<OpenFin.EntityType>, ...args: Parameters<OpenFin.Fin['Platform']['init']>): ReturnType<OpenFin.Fin['Platform']['init']>;
4844
- observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): (() => void);
4969
+ observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): () => void;
4845
4970
  writeToken(path: string, token: string): Promise<string>;
4846
4971
  retrievePort(config: NewConnectConfig): Promise<number>;
4847
4972
  getNextMessageId(): any;
@@ -5101,7 +5226,7 @@ declare namespace ExternalApplicationEvents {
5101
5226
  }
5102
5227
 
5103
5228
  /**
5104
- * Union of possible `type` values for a {@link OpenFin.ApplicationEvents.ApplicationEvent}.
5229
+ * Union of possible `type` values for a {@link ApplicationEvent}.
5105
5230
  */
5106
5231
  declare type ExternalApplicationEventType = ExternalApplicationEvent['type'];
5107
5232
 
@@ -5431,6 +5556,8 @@ declare type FindIntentsByContextOptions<MetadataType = IntentMetadata_3> = {
5431
5556
  metadata?: MetadataType;
5432
5557
  };
5433
5558
 
5559
+ declare type FlexReadyState = WebSocketReadyState | DataChannelReadyState;
5560
+
5434
5561
  /**
5435
5562
  * Generated when a WebContents gains focus.
5436
5563
  * @interface
@@ -5745,6 +5872,8 @@ declare class GlobalHotkey extends EmitterBase<OpenFin.GlobalHotkeyEvent> {
5745
5872
  * Registers a global hotkey with the operating system.
5746
5873
  * @param hotkey a hotkey string
5747
5874
  * @param listener called when the registered hotkey is pressed by the user.
5875
+ * @throws If the `hotkey` is reserved, see list below.
5876
+ * @throws if the `hotkey` is already registered by another application.
5748
5877
  *
5749
5878
  * @remarks The `hotkey` parameter expects an electron compatible [accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and the `listener` will be called if the `hotkey` is pressed by the user.
5750
5879
  * If successfull, the hotkey will be 'claimed' by the application, meaning that this register call can be called multiple times from within the same application but will fail if another application has registered the hotkey.
@@ -5817,7 +5946,7 @@ declare class GlobalHotkey extends EmitterBase<OpenFin.GlobalHotkeyEvent> {
5817
5946
  */
5818
5947
  unregisterAll(): Promise<void>;
5819
5948
  /**
5820
- * Checks if a given hotkey has been registered
5949
+ * Checks if a given hotkey has been registered by an application within the current runtime.
5821
5950
  * @param hotkey a hotkey string
5822
5951
  *
5823
5952
  * @example
@@ -5881,6 +6010,7 @@ declare namespace GoldenLayout {
5881
6010
  DragSource,
5882
6011
  BrowserWindow,
5883
6012
  Header,
6013
+ TabDragListener,
5884
6014
  Tab,
5885
6015
  EventEmitter_2 as EventEmitter
5886
6016
  }
@@ -5995,10 +6125,7 @@ declare class GoldenLayout_2 implements EventEmitter_2 {
5995
6125
  * @param itemConfiguration An item configuration (can be an entire tree of items)
5996
6126
  * @param parent A parent item
5997
6127
  */
5998
- createContentItem(
5999
- itemConfiguration?: ItemConfigType,
6000
- parent?: ContentItem
6001
- ): ContentItem;
6128
+ createContentItem(itemConfiguration?: ItemConfigType, parent?: ContentItem): ContentItem;
6002
6129
 
6003
6130
  /**
6004
6131
  * Creates a new popout window with configOrContentItem as contents at the position specified in dimensions
@@ -6031,10 +6158,7 @@ declare class GoldenLayout_2 implements EventEmitter_2 {
6031
6158
  * @return the dragSource that was created. This can be used to remove the
6032
6159
  * dragSource from the layout later.
6033
6160
  */
6034
- createDragSource(
6035
- element: HTMLElement | JQuery,
6036
- itemConfiguration: ItemConfigType
6037
- ): DragSource;
6161
+ createDragSource(element: HTMLElement | JQuery, itemConfiguration: ItemConfigType): DragSource;
6038
6162
 
6039
6163
  /**
6040
6164
  * Removes a dragSource from the layout.
@@ -6407,19 +6531,30 @@ declare type InitializedEvent = IdentityEvent & {
6407
6531
  type: 'initialized';
6408
6532
  };
6409
6533
 
6410
- declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
6411
-
6412
- declare type InitLayoutOptions_2 = OpenFin.InitLayoutOptions;
6413
-
6414
6534
  /**
6415
6535
  * @interface
6416
6536
  */
6417
- declare type InitLayoutOptions_3 = {
6537
+ declare type InitLayoutOptions = {
6418
6538
  /**
6539
+ * @deprecated use container HTMLElement instead
6540
+ *
6419
6541
  * The id attribute of the container where the window's Layout should be initialized. If not provided
6420
6542
  * then an element with id `layout-container` is used. We recommend using a div element.
6421
6543
  */
6422
6544
  containerId?: string;
6545
+ /**
6546
+ * The HTMLElement where the window's Layout should be initialized. We recommend using a div element.
6547
+ */
6548
+ container?: HTMLElement;
6549
+ /**
6550
+ * An override callback used to instantiate a custom LayoutManager. When present, will enable
6551
+ * Multiple Layouts. The callback should return a class.
6552
+ *
6553
+ * @remarks
6554
+ * **NOTE**: Unlike the Platform Provider overrideCallback and interopOverride, this override should
6555
+ * return a class, not an instance
6556
+ */
6557
+ layoutManagerOverride?: LayoutManagerOverride<LayoutSnapshot>;
6423
6558
  };
6424
6559
 
6425
6560
  /**
@@ -8249,7 +8384,7 @@ declare type LaunchIntoPlatformPayload = {
8249
8384
  declare class Layout extends Base {
8250
8385
  #private;
8251
8386
  /* Excluded from this release type: init */
8252
- identity: Identity_4;
8387
+ identity: OpenFin.LayoutIdentity;
8253
8388
  private platform;
8254
8389
  wire: Transport;
8255
8390
  /* Excluded from this release type: __constructor */
@@ -8425,19 +8560,30 @@ declare type LayoutComponent = LayoutItemConfig & {
8425
8560
 
8426
8561
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
8427
8562
 
8428
- declare class LayoutContentCache {
8429
- private contentItemCache;
8430
- private contentItemCacheId;
8431
- private createCacheKey;
8432
- hasKey: (id: string) => boolean;
8433
- getItemOrUndefined: (id: string) => GoldenLayout.ContentItem | undefined;
8434
- getContentItemOrThrow: (id: string, expectedType?: string[]) => GoldenLayout.ContentItem;
8435
- getOrCreateEntityId: (contentItem: GoldenLayout.ContentItem) => string;
8436
- }
8437
-
8438
8563
  declare type LayoutEntitiesClient = ApiClient<LayoutEntitiesController>;
8439
8564
 
8440
- /* Excluded from this release type: LayoutEntitiesController */
8565
+ declare type LayoutEntitiesController = {
8566
+ getLayoutIdentityForViewOrThrow: (viewIdentity?: OpenFin.Identity) => Promise<OpenFin.LayoutIdentity>;
8567
+ getRoot: (layoutIdentity?: OpenFin.LayoutIdentity) => Promise<OpenFin.LayoutEntityDefinition>;
8568
+ getStackByView: (viewIdentity: OpenFin.Identity) => Promise<OpenFin.LayoutEntityDefinition | undefined>;
8569
+ getStackViews: (id: string) => OpenFin.Identity[];
8570
+ getContent: (id: string) => OpenFin.LayoutEntityDefinition[];
8571
+ getParent: (id: string) => OpenFin.LayoutEntityDefinition | undefined;
8572
+ isRoot: (id: string) => boolean;
8573
+ exists: (entityId: string) => boolean;
8574
+ addViewToStack: (stackEntityId: string, viewCreationOrReference: ViewCreationOrReference, viewInsertionOptions?: {
8575
+ index?: number;
8576
+ }) => Promise<OpenFin.Identity>;
8577
+ removeViewFromStack: (stackEntityId: string, view: OpenFin.Identity) => Promise<void>;
8578
+ createAdjacentStack: (targetId: string, views: ViewCreationOrReference[], stackCreationOptions?: {
8579
+ position?: OpenFin.LayoutPosition;
8580
+ }) => Promise<string>;
8581
+ getAdjacentStacks: (stackTarget: {
8582
+ targetId: string;
8583
+ edge: OpenFin.LayoutPosition;
8584
+ }) => Promise<Pick<OpenFin.LayoutEntityDefinition, 'entityId'>[]>;
8585
+ setStackActiveView: (stackEntityId: string, viewIdentity: OpenFin.Identity) => Promise<void>;
8586
+ };
8441
8587
 
8442
8588
  /**
8443
8589
  * @interface
@@ -8471,29 +8617,11 @@ declare type LayoutInitializedEvent = BaseWindowEvent & {
8471
8617
  })[];
8472
8618
  };
8473
8619
 
8474
- /**
8475
- * @interface @experimental
8476
- *
8477
- * Responsible for handling all layout management and renderering
8478
- */
8479
- declare type LayoutInstance = {
8480
- getFrameSnapshot: () => Promise<LayoutOptions>;
8481
- addView: (payload: AddViewOptions) => Promise<View_2>;
8482
- closeView: (viewIdentity: Identity_5) => Promise<void>;
8483
- removeView: (viewConfig: Identity_5 | ViewState) => Promise<View_2>;
8484
- replaceView: (payload: ReplaceViewOptions) => Promise<View_2>;
8485
- getViews: () => LayoutComponent[];
8486
- getCurrentViews: () => Identity_5[];
8487
- startReplaceLayout: (payload: ReplaceLayoutOptions) => Promise<void>;
8488
- applyPreset: (payload: PresetLayoutOptions_3) => void;
8489
- isVisible: () => boolean;
8490
- destroy: () => void;
8491
- };
8620
+ /* Excluded from this release type: LayoutInstance */
8492
8621
 
8493
8622
  /**
8494
8623
  * Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
8495
- * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
8496
- * {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
8624
+ * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}.
8497
8625
  *
8498
8626
  * @interface
8499
8627
  */
@@ -8515,25 +8643,43 @@ declare type LayoutItemConfig = {
8515
8643
 
8516
8644
  /**
8517
8645
  * @interface @experimental
8646
+ *
8647
+ * **NOTE**: Internal use only. This type is reserved for Workspace Browser implementation.
8648
+ *
8649
+ * Responsible for aggergating all layout snapshots and storing LayoutInstances
8518
8650
  */
8519
- declare interface LayoutManager<T extends LayoutSnapshot = LayoutSnapshot> {
8651
+ declare interface LayoutManager<T extends LayoutSnapshot> {
8520
8652
  /**
8521
8653
  * @experimental
8522
8654
  *
8523
- * Must be overridden when working with multiple layouts
8655
+ * To enable multiple layouts, override this method and do not call super.applyLayoutSnapshot()
8656
+ *
8657
+ * This hook is called by OpenFin during fin.Platform.Layout.init() call, to pass a snapshot to derived
8658
+ * classes which will be used launch a platform window. Use this hook to set your local UI state and
8659
+ * begin rendering the containers for your layouts UI.
8524
8660
  *
8525
- * Hook called during fin.Platform.Layout.init() call, to inform derived classes
8526
- * when a snapshot is being applied to launch a platform window. Use this hook to set the
8527
- * local state and ensure you call fin.Platform.Layout.create() on every layout in snapshot.layouts
8661
+ * Ensure you call fin.Platform.Layout.create() on every layout in snapshot.layouts when that layout is
8662
+ * ready to be created in your application.
8528
8663
  *
8529
- * When using custom data to the app manifest snapshot.windows.layoutSnapshot key, this data will
8530
- * be included in the snapshot type T and should align with your component state T.
8664
+ * If you add custom data to the app manifest snapshot.windows.layoutSnapshot key, this data will
8665
+ * be included in the snapshot type.
8666
+ *
8667
+ * The default implementation throws if it is called with a snapshot containing more than one layout.
8531
8668
  *
8532
- * TODO: detect if layoutManager override was set and this was not overridden somehow to warn?
8533
8669
  * @param snapshot
8534
- * @returns
8670
+ * @throws if Object.keys(snapshot).length > 1
8671
+ */
8672
+ applyLayoutSnapshot(snapshot: T): Promise<void>;
8673
+ /**
8674
+ * Called at the start of layout initialization. Adds a new LayoutInstance if the snapshot
8675
+ * contains a single layout.
8676
+ *
8677
+ * Throws if the snapshot contains more than 1 layout, it is expected that the user handles calling
8678
+ * fin.Platform.Layout.create() once for each layout to properly connect it to their UI state.
8679
+ *
8680
+ * @param snapshot
8681
+ * @throws if Object.keys(snapshot).length > 1
8535
8682
  */
8536
- applyLayoutSnapshot: (snapshot: T) => Promise<void>;
8537
8683
  /**
8538
8684
  * @experimental
8539
8685
  *
@@ -8544,35 +8690,63 @@ declare interface LayoutManager<T extends LayoutSnapshot = LayoutSnapshot> {
8544
8690
  * @param layoutIdentity
8545
8691
  * @returns
8546
8692
  */
8547
- showLayout: ({ layoutName }: LayoutIdentity) => Promise<void>;
8693
+ showLayout({ layoutName }: LayoutIdentity): Promise<void>;
8548
8694
  /**
8549
8695
  * @experimental
8550
8696
  *
8551
8697
  * @returns T
8552
8698
  */
8553
- getLayoutSnapshot: () => Promise<T>;
8699
+ getLayoutSnapshot(): Promise<T>;
8554
8700
  /**
8555
8701
  * @experimental
8556
8702
  *
8557
- * @param param0
8703
+ * @param layoutIdentity
8558
8704
  * @returns
8559
8705
  */
8560
- resolveLayout: ({ layoutName }: LayoutIdentity) => LayoutInstance;
8706
+ resolveLayout(layoutIdentity?: LayoutIdentity): Promise<LayoutInstance>;
8561
8707
  /**
8562
8708
  * @experimental
8563
8709
  *
8564
8710
  * Returns a LayoutInstance if one exists with the name layoutIdentity.layoutName.
8565
8711
  * Throws if it does not exist.
8566
- * @param layoutIdentity
8712
+ * @param layoutName
8567
8713
  * @returns
8568
8714
  */
8569
- getLayoutByName: (layoutName: string) => LayoutInstance;
8715
+ getLayoutByName(layoutName: string): LayoutInstance;
8570
8716
  /**
8571
8717
  * @experimental
8572
8718
  */
8573
8719
  getLayouts(): Record<string, LayoutInstance>;
8720
+ /**
8721
+ * @experimental
8722
+ */
8723
+ getLayoutIdentityForView(viewIdentity: Identity_5): LayoutIdentity;
8724
+ /**
8725
+ * @experimental
8726
+ */
8727
+ isLayoutVisible({ layoutName }: LayoutIdentity): boolean;
8574
8728
  }
8575
8729
 
8730
+ /**
8731
+ * @experimental
8732
+ *
8733
+ * Constructor type for LayoutManager to be used with multiple layouts
8734
+ */
8735
+ declare type LayoutManagerConstructor<T extends LayoutSnapshot> = {
8736
+ new (): LayoutManager<T>;
8737
+ };
8738
+
8739
+ /**
8740
+ * @experimental
8741
+ *
8742
+ * Override callback used to init and configure multiple layouts. Implement by passing
8743
+ * a lambda and returning a class that OpenFin will new up for you.
8744
+ * @remarks
8745
+ * **NOTE**: Unlike the Platform Provider overrideCallback and interopOverride, this override should
8746
+ * return a class, not an instance
8747
+ */
8748
+ declare type LayoutManagerOverride<T extends LayoutSnapshot> = (Base: LayoutManagerConstructor<LayoutSnapshot>) => LayoutManagerConstructor<T>;
8749
+
8576
8750
  /**
8577
8751
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
8578
8752
  */
@@ -8597,7 +8771,7 @@ declare class LayoutModule extends Base {
8597
8771
  * const layoutConfig = await layout.getConfig();
8598
8772
  * ```
8599
8773
  */
8600
- wrap(identity: OpenFin.Identity): Promise<OpenFin.Layout>;
8774
+ wrap(identity: OpenFin.LayoutIdentity): Promise<OpenFin.Layout>;
8601
8775
  /**
8602
8776
  * Synchronously returns a Layout object that represents a Window's layout.
8603
8777
  *
@@ -8617,7 +8791,7 @@ declare class LayoutModule extends Base {
8617
8791
  * const layoutConfig = await layout.getConfig();
8618
8792
  * ```
8619
8793
  */
8620
- wrapSync(identity: OpenFin.Identity): OpenFin.Layout;
8794
+ wrapSync(identity: OpenFin.LayoutIdentity): OpenFin.Layout;
8621
8795
  /**
8622
8796
  * Asynchronously returns a Layout object that represents a Window's layout.
8623
8797
  *
@@ -8681,7 +8855,14 @@ declare class LayoutModule extends Base {
8681
8855
  * const layout = await fin.Platform.Layout.init({ containerId });
8682
8856
  * ```
8683
8857
  */
8684
- init: (options?: InitLayoutOptions) => Promise<OpenFin.Layout>;
8858
+ init: (options?: OpenFin.InitLayoutOptions) => Promise<OpenFin.Layout>;
8859
+ /**
8860
+ * Returns the layout manager for the current window
8861
+ * @returns
8862
+ */
8863
+ getCurrentLayoutManagerSync: <UserSnapshotType extends OpenFin.LayoutSnapshot>() => OpenFin.LayoutManager<UserSnapshotType>;
8864
+ create: (options: OpenFin.CreateLayoutOptions) => Promise<void>;
8865
+ destroy: (layoutIdentity: OpenFin.LayoutIdentity) => Promise<void>;
8685
8866
  }
8686
8867
 
8687
8868
  declare type LayoutModule_2 = OpenFin.Fin['Platform']['Layout'];
@@ -8767,8 +8948,7 @@ declare type LayoutOptions = {
8767
8948
  };
8768
8949
  /**
8769
8950
  * Content of the layout. There can only be one top-level LayoutItem in the content array.
8770
- * We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
8771
- * {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
8951
+ * We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}.
8772
8952
  */
8773
8953
  content?: LayoutContent;
8774
8954
  dimensions?: {
@@ -9064,7 +9244,17 @@ declare interface Message<T> {
9064
9244
 
9065
9245
  declare type MessageHandler = (data: any) => boolean;
9066
9246
 
9067
- declare class MessageReceiver extends Base {
9247
+ declare interface MessageReceiver {
9248
+ addEventListener(e: 'open', listener: (ev: Event) => void): void;
9249
+ addEventListener(e: 'error', listener: (ev: Event) => void): void;
9250
+ addEventListener(e: 'message', listener: (ev: MessageEvent) => void): void;
9251
+ addEventListener(e: 'close', listener: (ev: Event) => void): void;
9252
+ send(data: unknown): void;
9253
+ close(): void;
9254
+ readyState: FlexReadyState;
9255
+ }
9256
+
9257
+ declare class MessageReceiver_2 extends Base {
9068
9258
  private endpointMap;
9069
9259
  private latestEndpointIdByChannelId;
9070
9260
  constructor(wire: Transport);
@@ -9218,7 +9408,7 @@ declare type MutableViewOptions = {
9218
9408
  contentRedirect: ContentRedirect;
9219
9409
  /**
9220
9410
  * @defaultValue false
9221
- *
9411
+ * @deprecated
9222
9412
  * **Platforms Only.** If true, will hide and detach the View from the window for later use instead of closing,
9223
9413
  * allowing the state of the View to be saved and the View to be immediately shown in a new Layout.
9224
9414
  */
@@ -9630,6 +9820,11 @@ declare namespace OpenFin {
9630
9820
  Rectangle,
9631
9821
  ApplicationCreationOptions,
9632
9822
  ApplicationOptions,
9823
+ CustomProtocolMissingState,
9824
+ CustomProtocolMalformedState,
9825
+ CustomProtocolRegisteredState,
9826
+ CustomProtocolState,
9827
+ CustomProtocolOptions,
9633
9828
  InteropBrokerOptions,
9634
9829
  ContextGroupInfo,
9635
9830
  DisplayMetadata_3 as DisplayMetadata,
@@ -9693,6 +9888,7 @@ declare namespace OpenFin {
9693
9888
  ReplaceViewPayload,
9694
9889
  ReplaceViewOptions,
9695
9890
  CloseViewPayload,
9891
+ CloseViewOptions,
9696
9892
  FetchManifestPayload,
9697
9893
  ReplaceLayoutOpts,
9698
9894
  ReplaceLayoutPayload,
@@ -9816,6 +10012,11 @@ declare namespace OpenFin {
9816
10012
  IntentHandler_2 as IntentHandler,
9817
10013
  ContentCreationBehaviorNames,
9818
10014
  MatchPattern,
10015
+ BaseContentCreationRule,
10016
+ WindowContentCreationRule,
10017
+ ViewContentCreationRule,
10018
+ BrowserContentCreationRule,
10019
+ BlockedContentCreationRule,
9819
10020
  ContentCreationRule,
9820
10021
  ContentCreationOptions,
9821
10022
  SnapshotProvider,
@@ -9855,13 +10056,13 @@ declare namespace OpenFin {
9855
10056
  LayoutPresetType,
9856
10057
  LayoutIdentity,
9857
10058
  LayoutSnapshot,
9858
- InitLayoutOptions_3 as InitLayoutOptions,
10059
+ InitLayoutOptions,
10060
+ LayoutManagerConstructor,
10061
+ LayoutManagerOverride,
9859
10062
  LayoutInstance,
9860
10063
  LayoutManager,
9861
- AddLayoutInstanceOptions,
9862
10064
  CreateLayoutOptions,
9863
- DestroyLayoutOptions,
9864
- PresetLayoutOptions_3 as PresetLayoutOptions,
10065
+ PresetLayoutOptions_2 as PresetLayoutOptions,
9865
10066
  ResultBehavior,
9866
10067
  PopupBaseBehavior,
9867
10068
  PopupResultBehavior,
@@ -9901,6 +10102,7 @@ declare namespace OpenFin {
9901
10102
  ChannelClientDisconnectionListener,
9902
10103
  ChannelProviderDisconnectionListener,
9903
10104
  RoutingInfo,
10105
+ DownloadShelfOptions,
9904
10106
  ApplicationEvents,
9905
10107
  BaseEvents,
9906
10108
  ExternalApplicationEvents,
@@ -9915,101 +10117,6 @@ declare namespace OpenFin {
9915
10117
  }
9916
10118
  export default OpenFin;
9917
10119
 
9918
- declare class OpenFinLayout implements OpenFin.LayoutInstance {
9919
- #private;
9920
- private readonly splitterController;
9921
- private readonly tabDragController;
9922
- private readonly layoutContentCache;
9923
- private get defaultFaviconUrl();
9924
- private get isDragging();
9925
- private get resizing();
9926
- private get showBackgroundImages();
9927
- private get showFavicons();
9928
- private get showViewsOnSplitterDrag();
9929
- private get showViewsOnTabDrag();
9930
- private get showViewsOnWindowResize();
9931
- private get container();
9932
- get layout(): GoldenLayout.GoldenLayout;
9933
- private get layoutConfigToRestore();
9934
- private client;
9935
- private containerResizeObserver;
9936
- private viewsResizeObserver;
9937
- readonly ofWindow: OpenFin.Window;
9938
- readonly platform: Platform_2;
9939
- private lastItemDestroyed?;
9940
- private viewsSubscribedTo;
9941
- constructor(splitterController: SplitterController, tabDragController: TabDragController, layoutContentCache: LayoutContentCache, container: HTMLElement);
9942
- getViews: () => OpenFin.LayoutComponent[];
9943
- startReplaceLayout: ({ layout }: {
9944
- layout: GoldenLayout.Config;
9945
- }) => Promise<void>;
9946
- applyPreset: (payload: PresetLayoutOptions_2) => void;
9947
- isVisible: () => boolean;
9948
- destroy: () => void;
9949
- /* Excluded from this release type: getClient */
9950
- initManager: () => Promise<void>;
9951
- createLayout: (layout: GoldenLayout.Config, container: HTMLElement) => Promise<void>;
9952
- private setContainer;
9953
- private setupDragDropRegions;
9954
- private replaceLayout;
9955
- private onViewDetached;
9956
- private setupLayoutListeners;
9957
- private onLayoutInit;
9958
- private registerViewComponent;
9959
- private setupWindowListeners;
9960
- private setupResizeObservers;
9961
- /**
9962
- * Shows/hides a view depending on use case (used by browser)
9963
- * @ignore
9964
- */
9965
- private updateViewVisibility;
9966
- private onStackCreated;
9967
- private onTabCreated;
9968
- private onTabMouseUp;
9969
- private replaceCloseTabButton;
9970
- onCloseTabButtonClick: (tab: GoldenLayout.Tab) => Promise<void>;
9971
- addFaviconToTab: (tab: GoldenLayout.Tab, eventIcons: string[]) => void;
9972
- onPopoutClick: (stack: GoldenLayout.ContentItem) => void;
9973
- onStackCloseClick: (stack: GoldenLayout.ContentItem) => void;
9974
- private updateButtonDisplay;
9975
- private onItemCreated;
9976
- private observeSplitters;
9977
- handleOutOfWindowDrop: (e: {
9978
- screenY: number;
9979
- screenX: number;
9980
- }, parentTab: GoldenLayout.Tab, dimensions: {
9981
- width: any;
9982
- height: any;
9983
- }) => Promise<void>;
9984
- private onTabDragStart;
9985
- private setBackgroundImage;
9986
- private setBackgroundImages;
9987
- getFrameSnapshot: () => Promise<GoldenLayout.Config>;
9988
- getCurrentViews: () => OpenFin.Identity[];
9989
- addView: ({ options: viewConfig, targetView, location }: OpenFin.AddViewOptions) => Promise<View_4>;
9990
- replaceView: ({ viewToReplace, newView }: OpenFin.ReplaceViewOptions) => Promise<View_4>;
9991
- removeView: (viewConfig: OpenFin.Identity | OpenFin.ViewState) => Promise<View_4>;
9992
- closeView: (viewIdentity: OpenFin.Identity) => Promise<void>;
9993
- private createChannelConnections;
9994
- getViewComponent: ({ name }: {
9995
- name: string;
9996
- }) => ViewComponent | undefined;
9997
- getViewComponents: () => ViewComponent[];
9998
- private hideHighlight;
9999
- getOfViewFromComponentState: ({ name }: {
10000
- name: string;
10001
- }) => View_4;
10002
- private hideAllViews;
10003
- private showViews;
10004
- private initializeLayoutViews;
10005
- private createResizableView;
10006
- private attachView;
10007
- private createAndAttachView;
10008
- private setupViewEvents;
10009
- private dispatchLayoutEvent;
10010
- private setComponentState;
10011
- }
10012
-
10013
10120
  declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
10014
10121
 
10015
10122
  declare type OverlapsOnlyIfMatching<T, U> = {
@@ -10746,8 +10853,6 @@ declare class Platform extends EmitterBase<OpenFin.PlatformEvent> {
10746
10853
  }): Promise<void>;
10747
10854
  }
10748
10855
 
10749
- declare type Platform_2 = OpenFin.Platform;
10750
-
10751
10856
  /**
10752
10857
  * Generated when a new Platform's API becomes responsive.
10753
10858
  * @interface
@@ -11039,6 +11144,8 @@ declare interface PlatformProvider {
11039
11144
  * ```
11040
11145
  */
11041
11146
  getSnapshot(payload: undefined, identity: OpenFin.Identity): Promise<OpenFin.Snapshot>;
11147
+ /* Excluded from this release type: getInitialLayoutSnapshot */
11148
+ /* Excluded from this release type: createViewsForLayout */
11042
11149
  /* Excluded from this release type: getViewSnapshot */
11043
11150
  /**
11044
11151
  * Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen.
@@ -11738,12 +11845,10 @@ declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent &
11738
11845
 
11739
11846
  declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
11740
11847
 
11741
- declare type PresetLayoutOptions_2 = OpenFin.PresetLayoutOptions;
11742
-
11743
11848
  /**
11744
11849
  * @interface
11745
11850
  */
11746
- declare type PresetLayoutOptions_3 = {
11851
+ declare type PresetLayoutOptions_2 = {
11747
11852
  /**
11748
11853
  * Which preset layout arrangement to use.
11749
11854
  * The preset options are `columns`, `grid`, `rows`, and `tabs`.
@@ -11967,7 +12072,7 @@ declare type PropagatedEventType<Topic extends string, Type extends string> = `$
11967
12072
 
11968
12073
  /**
11969
12074
  * A view event that has propagated to a parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
11970
- * or {@link Openfin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
12075
+ * or {@link OpenFin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11971
12076
  * event type key with `'view-'`.
11972
12077
  */
11973
12078
  declare type PropagatedViewEvent<TargetTopic extends string> = PropagatedEvent<'view', TargetTopic, ViewEvent> & {
@@ -11981,7 +12086,7 @@ declare type PropagatedViewEventType = PropagatedViewEvent<string>['type'];
11981
12086
 
11982
12087
  /**
11983
12088
  * A Window event that has propagated to the parent {@link OpenFin.ApplicationEvents Application} and {@link OpenFin.SystemEvents System},
11984
- * prefixing the type string with `'window-'`. Only {@link NativeWindowEvent native window events} will propagate
12089
+ * prefixing the type string with `'window-'`. Only {@link WindowSourcedEvent window-sourced events} will propagate
11985
12090
  * this way; those that have {@link OpenFin.ViewEvents.PropagatedViewEvent propagated} from {@link OpenFin.ViewEvents}
11986
12091
  * will *not* re-propagate.
11987
12092
  *
@@ -12199,6 +12304,13 @@ declare interface ProtocolMap extends ProtocolMapBase {
12199
12304
  anchor: OpenFin.AnchorType;
12200
12305
  }>>;
12201
12306
  'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin.Bounds>>>;
12307
+ 'register-custom-protocol': ApiCall<OpenFin.CustomProtocolOptions, void>;
12308
+ 'unregister-custom-protocol': ApiCall<{
12309
+ protocolName: string;
12310
+ }, void>;
12311
+ 'get-custom-protocol-state': ApiCall<{
12312
+ protocolName: string;
12313
+ }, OpenFin.CustomProtocolState>;
12202
12314
  }
12203
12315
 
12204
12316
  declare interface ProtocolMapBase {
@@ -12330,6 +12442,10 @@ declare interface ReactComponentConfig extends ItemConfig {
12330
12442
  */
12331
12443
  declare type ReadImageClipboardRequest = BaseClipboardRequest & ImageFormatOptions;
12332
12444
 
12445
+ declare interface ReceiverConfig extends Omit<RemoteConfig, 'address'> {
12446
+ receiver: MessageReceiver;
12447
+ }
12448
+
12333
12449
  /**
12334
12450
  * A rectangular area on the screen.
12335
12451
  *
@@ -12411,19 +12527,19 @@ declare interface RemoteConfig extends ExistingConnectConfig {
12411
12527
  /**
12412
12528
  * @interface
12413
12529
  */
12414
- declare type ReplaceLayoutOptions = ReplaceLayoutOpts;
12530
+ declare type ReplaceLayoutOptions = {
12531
+ /**
12532
+ * Layout config to be applied.
12533
+ */
12534
+ layout: LayoutOptions;
12535
+ };
12415
12536
 
12416
12537
  /**
12417
12538
  * @interface
12418
12539
  *
12419
12540
  * @deprecated use ReplaceLayoutOptions instead
12420
12541
  */
12421
- declare type ReplaceLayoutOpts = {
12422
- /**
12423
- * Layout config to be applied.
12424
- */
12425
- layout: LayoutOptions;
12426
- };
12542
+ declare type ReplaceLayoutOpts = ReplaceLayoutOptions;
12427
12543
 
12428
12544
  /**
12429
12545
  * @interface
@@ -12434,9 +12550,9 @@ declare type ReplaceLayoutPayload = {
12434
12550
  */
12435
12551
  opts: ReplaceLayoutOptions;
12436
12552
  /**
12437
- * Identity of the window whose layout will be replace.
12553
+ * Identity of the window whose layout will be replaced.
12438
12554
  */
12439
- target: Identity_5;
12555
+ target: LayoutIdentity;
12440
12556
  };
12441
12557
 
12442
12558
  /**
@@ -12455,7 +12571,7 @@ declare type ReplaceViewPayload = {
12455
12571
  viewToReplace: Identity_5;
12456
12572
  newView: Partial<ViewOptions>;
12457
12573
  };
12458
- target: Identity_5;
12574
+ target: LayoutIdentity;
12459
12575
  };
12460
12576
 
12461
12577
  /**
@@ -12967,6 +13083,49 @@ declare type ShortcutOverride = Hotkey & {
12967
13083
  command: string;
12968
13084
  };
12969
13085
 
13086
+ /**
13087
+ * Generated when the Download Shelf 'Show All' button is clicked.
13088
+ *
13089
+ * @remarks By default, OpenFin does not handle the clicking of the `Show All` button on the download
13090
+ * shelf. Instead, it fires this event, which leaves rendering a download manager to the user. For a simple
13091
+ * implementation, the `chrome://downloads` page can be used (see the example below):
13092
+ *
13093
+ * @example
13094
+ *
13095
+ * ```typescript
13096
+ * const platform = await fin.Platform.getCurrentSync();
13097
+ * // Listen to the propagated event at the Platform level, so that we only need one listener for a click from any window
13098
+ * platform.on('window-show-all-downloads', () => {
13099
+ * // Render the `chrome://downloads` window when a user clicks on the download shelf `Show All` button
13100
+ * platform.createWindow({
13101
+ * name: 'show-download-window',
13102
+ * layout: {
13103
+ * content: [
13104
+ * {
13105
+ * type: 'stack',
13106
+ * content: [
13107
+ * {
13108
+ * type: 'component',
13109
+ * componentName: 'view',
13110
+ * componentState: {
13111
+ * name: 'show-download-view',
13112
+ * url: 'chrome://downloads'
13113
+ * }
13114
+ * }
13115
+ * ]
13116
+ * }
13117
+ * ]
13118
+ * }
13119
+ * });
13120
+ * })
13121
+ * ```
13122
+ *
13123
+ * @interface
13124
+ */
13125
+ declare type ShowAllDownloadsEvent = BaseWindowEvent & {
13126
+ type: 'show-all-downloads';
13127
+ };
13128
+
12970
13129
  /**
12971
13130
  * Generated when a View is shown. This event will fire during creation of a View.
12972
13131
  * @interface
@@ -13156,37 +13315,6 @@ declare class SnapshotSourceModule extends Base {
13156
13315
  wrap(identity: OpenFin.ApplicationIdentity): Promise<SnapshotSource>;
13157
13316
  }
13158
13317
 
13159
- /**
13160
- * Utility class for managing Golden Layout splitter drag interactions.
13161
- * @ignore
13162
- */
13163
- declare class SplitterController {
13164
- private readonly viewOverlay;
13165
- constructor(viewOverlay: ViewOverlay);
13166
- private teardown?;
13167
- private tryTeardown;
13168
- /**
13169
- * Disables the pointer events on the splitters, preventing them from being dragged.
13170
- */
13171
- preventSplitterResize: () => void;
13172
- /**
13173
- * Ends a splitter drag move, if one is in progress.
13174
- */
13175
- endMove: () => Promise<void>;
13176
- /**
13177
- * Initialises a splitter drag move, rendering a view on top of the splitter
13178
- * to allow it to render on top of the views within a layout (as they will always
13179
- * have a higher z-index to the platform window itself).
13180
- * @param splitterItem The Golden Layout splitter item that is currently being dragged.
13181
- */
13182
- startMove: (splitterItem: SplitterItem) => Promise<void>;
13183
- }
13184
-
13185
- declare type SplitterItem = GoldenLayout.ContentItem & {
13186
- viewEventsAdded: boolean;
13187
- isVertical: boolean;
13188
- };
13189
-
13190
13318
  /**
13191
13319
  * Generated when an application has started.
13192
13320
  * @interface
@@ -14032,6 +14160,70 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
14032
14160
  * ```
14033
14161
  */
14034
14162
  openUrlWithBrowser(url: string): Promise<void>;
14163
+ /**
14164
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
14165
+ * overwrites the existing registry entry if the given custom protocol name already exists.
14166
+ *
14167
+ * Note: This method is restricted by default and must be enabled via
14168
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14169
+ *
14170
+ *
14171
+ * @remarks These protocols are reserved and cannot be registered:
14172
+ * - fin
14173
+ * - fins
14174
+ * - openfin
14175
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14176
+ *
14177
+ * @throws if a given custom protocol failed to be registered.
14178
+ * @throws if a manifest URL contains the '%1' string.
14179
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
14180
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
14181
+ *
14182
+ * @example
14183
+ * ```js
14184
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
14185
+ * ```
14186
+ */
14187
+ registerCustomProtocol(options: OpenFin.CustomProtocolOptions): Promise<void>;
14188
+ /**
14189
+ * Removes the registry entry for a given custom protocol.
14190
+ *
14191
+ * Note: This method is restricted by default and must be enabled via
14192
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14193
+ *
14194
+ *
14195
+ * @remarks These protocols are reserved and cannot be unregistered:
14196
+ * - fin
14197
+ * - fins
14198
+ * - openfin
14199
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14200
+ *
14201
+ * @throws if a protocol entry failed to be removed in registry.
14202
+ *
14203
+ * @example
14204
+ * ```js
14205
+ * await fin.System.unregisterCustomProtocol('protocol1');
14206
+ * ```
14207
+ */
14208
+ unregisterCustomProtocol(protocolName: string): Promise<void>;
14209
+ /**
14210
+ * Retrieves the registration state for a given custom protocol.
14211
+ *
14212
+ * Note: This method is restricted by default and must be enabled via
14213
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14214
+ *
14215
+ * @remarks These protocols are reserved and cannot get states for them:
14216
+ * - fin
14217
+ * - fins
14218
+ * - openfin
14219
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14220
+ *
14221
+ *
14222
+ * @example
14223
+ * ```js
14224
+ * const protocolState = await fin.System.getCustomProtocolState('protocol1');
14225
+ */
14226
+ getCustomProtocolState(protocolName: string): Promise<OpenFin.CustomProtocolState>;
14035
14227
  /**
14036
14228
  * Removes the process entry for the passed UUID obtained from a prior call
14037
14229
  * of fin.System.launchExternalProcess().
@@ -14728,6 +14920,18 @@ declare type SystemPermissions = {
14728
14920
  enabled: boolean;
14729
14921
  protocols: string[];
14730
14922
  };
14923
+ registerCustomProtocol: boolean | {
14924
+ enabled: boolean;
14925
+ protocols: string[];
14926
+ };
14927
+ unregisterCustomProtocol: boolean | {
14928
+ enabled: boolean;
14929
+ protocols: string[];
14930
+ };
14931
+ getCustomProtocolState: boolean | {
14932
+ enabled: boolean;
14933
+ protocols: string[];
14934
+ };
14731
14935
  };
14732
14936
 
14733
14937
  /**
@@ -14746,7 +14950,7 @@ declare type SystemShutdownHandler = (shutdownEvent: {
14746
14950
  }) => void;
14747
14951
 
14748
14952
  declare interface Tab {
14749
- _dragListener: EventEmitter_2;
14953
+ _dragListener: TabDragListener;
14750
14954
 
14751
14955
  /**
14752
14956
  * True if this tab is the selected tab
@@ -14791,60 +14995,11 @@ declare interface Tab {
14791
14995
  setActive(isActive: boolean): void;
14792
14996
  }
14793
14997
 
14794
- /**
14795
- * Set of apis used to facilitate tab drag interactions without needing to hide views.
14796
- * @ignore
14797
- */
14798
- declare class TabDragController {
14799
- private readonly viewOverlay;
14800
- constructor(viewOverlay: ViewOverlay);
14801
- private dropZonePreview?;
14802
- /**
14803
- *
14804
- * When a tab is dragged out of a stack, it will need to be hidden from the stack.
14805
- *
14806
- * Additionally, if there is a new view to show in the stack, it will be shown at the position specified by
14807
- * containerBounds
14808
- *
14809
- * As drag interactions can under extreme circumstances complete before this chain of promises has completed,
14810
- * we need to pass in a isDragging() function which returns whether the drag is in progress.
14811
- * This allows us to cancel any layout affecting operations.
14812
- *
14813
- * @param draggingView The view which is currently being dragged
14814
- * @param isLastViewInWindow Whether the draggin view is the last view in a window or not. If false, the dragging view will not hide.
14815
- * @param isDragging A function which returns true if the drag is still in progress. As we chain some async calls here, we want to avoid
14816
- * modifying any views if the drag has completed (as the post drag procedure will have taken care of it.)
14817
- * @param containerBounds The bounds of the container of the view to be shown in the stack
14818
- * @param nextView The view which has become active after dragging the draggingView out.
14819
- */
14820
- handleTabStackActiveView: (draggingView: View_3, isLastViewInWindow: boolean, isDragging: () => boolean, containerBounds?: OpenFin.Bounds, nextView?: View_3) => Promise<void>;
14821
- /**
14822
- * Extracts the border and backgroundColor css values from the drop zone preview,
14823
- * and sets the viewOverlay to match them.
14824
- */
14825
- inheritStyles: () => Promise<void>;
14826
- /**
14827
- * Called when a tab drag interaction is started from the current window (not when it enters the window).
14828
- *
14829
- * Sets all views in the platform to ignore mouse events so that they can pass through to the golden-layout
14830
- * document whilst remaining visible.
14831
- */
14832
- startDrag: () => Promise<void>;
14833
- /**
14834
- * Called when a tab drag interaction which was started from the current window ends.
14835
- *
14836
- * Disables the click through setting on every view in the platform.
14837
- */
14838
- endDrag: () => Promise<void>;
14839
- private disposeObserve?;
14840
- disposeOverlayObserver: () => void;
14998
+ declare interface TabDragListener extends EventEmitter_2 {
14841
14999
  /**
14842
- * Observes a golden-layout drop zone preview in order to render a BrowserView
14843
- * overlay whenever a tab is dragged over a droppable region.
14844
- * @param dropZonePreview The drop zone preview element created by Golden Layout in order to highlight
14845
- * droppable regions of the UI.
15000
+ * A reference to the content item this tab relates to
14846
15001
  */
14847
- observeOverlay: (dropZonePreview: HTMLElement) => Promise<void>;
15002
+ contentItem: ContentItem;
14848
15003
  }
14849
15004
 
14850
15005
  /**
@@ -15125,7 +15280,7 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
15125
15280
  connectSync: () => void;
15126
15281
  getPort: () => string;
15127
15282
  shutdown(): Promise<void>;
15128
- connect(config: InternalConnectConfig | RemoteConfig): Promise<string | void>;
15283
+ connect(config: InternalConnectConfig | RemoteConfig | ReceiverConfig): Promise<string | void>;
15129
15284
  private connectRemote;
15130
15285
  connectByPort(config: ExistingConnectConfig): Promise<void>;
15131
15286
  private authorize;
@@ -15898,10 +16053,6 @@ declare class View_2 extends WebContents<OpenFin.ViewEvent> {
15898
16053
  /* Excluded from this release type: bindToElement */
15899
16054
  }
15900
16055
 
15901
- declare type View_3 = OpenFin.View;
15902
-
15903
- declare type View_4 = OpenFin.View;
15904
-
15905
16056
  /**
15906
16057
  * Generated when a View is attached to a window.
15907
16058
  * @interface
@@ -15912,9 +16063,21 @@ declare type ViewAttachedEvent = BaseWindowEvent & {
15912
16063
  viewIdentity: OpenFin.Identity;
15913
16064
  };
15914
16065
 
15915
- declare interface ViewComponent extends GoldenLayout.ContentItem {
15916
- componentState: OpenFin.ViewState;
15917
- }
16066
+ /**
16067
+ * A rule prescribing content creation in a {@link OpenFin.View}.
16068
+ *
16069
+ * @interface
16070
+ */
16071
+ declare type ViewContentCreationRule = BaseContentCreationRule & {
16072
+ /**
16073
+ * Behavior to use when opening matched content.
16074
+ */
16075
+ behavior: 'view';
16076
+ /**
16077
+ * Options for newly-created view.
16078
+ */
16079
+ options?: Partial<ViewOptions>;
16080
+ };
15918
16081
 
15919
16082
  /**
15920
16083
  * The options object required by {@link View.ViewModule.create View.create}.
@@ -16081,40 +16244,6 @@ declare class ViewModule extends Base {
16081
16244
  */
16082
16245
  declare type ViewOptions = ConstViewOptions & MutableViewOptions;
16083
16246
 
16084
- /**
16085
- * Api client allowing an empty electron BrowserView to be rendered
16086
- * in the current window with the specified bounds.
16087
- *
16088
- * Please note, only one view based overlay can be rendered at a time per runtime.
16089
- * @ignore
16090
- */
16091
- declare class ViewOverlay {
16092
- private wire;
16093
- constructor(wire: Transport);
16094
- /**
16095
- * Sets the style of the root <html> element of the view overlay webcontent.
16096
- * @param style A partial collection of Css style declarations to set.
16097
- */
16098
- setStyle: (style: Partial<CSSStyleDeclaration>) => Promise<void>;
16099
- /**
16100
- * Renders the overlay at the specified position relative to the calling window.
16101
- * @param options Bounds and background color to display in the overlay.
16102
- */
16103
- renderOverlay: (bounds: OpenFin.Bounds) => Promise<void>;
16104
- /**
16105
- * Removes the overlay from the current window.
16106
- */
16107
- detachOverlay: () => Promise<void>;
16108
- /**
16109
- * Allows setting all OpenFin views to ignore or consume mouse events.
16110
- *
16111
- * This can help with the rendering of view overlays that depend on OpenFin views not consuming mouse events.
16112
- *
16113
- * @param enabled If true, all mouse events are ignored by openfin views. If false, all OpenFin views will consume mouse events.
16114
- */
16115
- setIgnoreViewMouseEvents(enabled: boolean): Promise<void>;
16116
- }
16117
-
16118
16247
  /**
16119
16248
  * Represents the payload shape for Views that are trying to prevent an unload.
16120
16249
  * @interface
@@ -17218,6 +17347,8 @@ declare type WebRequestHeader = {
17218
17347
  [key: string]: string;
17219
17348
  };
17220
17349
 
17350
+ declare type WebSocketReadyState = WebSocket['readyState'];
17351
+
17221
17352
  /**
17222
17353
  * Generated when a window is being moved by the user.
17223
17354
  * @remarks For use with monitor scaling that is not 100%. Bounds are given in DIP (adjusted for monitor scale factor).
@@ -18104,7 +18235,7 @@ declare class _Window extends WebContents<OpenFin.WindowEvent> {
18104
18235
  * ```
18105
18236
  * @experimental
18106
18237
  */
18107
- getLayout(): Promise<OpenFin.Layout>;
18238
+ getLayout(layoutIdentity?: OpenFin.LayoutIdentity): Promise<OpenFin.Layout>;
18108
18239
  /**
18109
18240
  * Gets the current settings of the window.
18110
18241
  *
@@ -18846,6 +18977,22 @@ declare class _Window extends WebContents<OpenFin.WindowEvent> {
18846
18977
  type: 'closing';
18847
18978
  };
18848
18979
 
18980
+ /**
18981
+ * A rule prescribing content creation in a {@link OpenFin.Window}.
18982
+ *
18983
+ * @interface
18984
+ */
18985
+ declare type WindowContentCreationRule = BaseContentCreationRule & {
18986
+ /**
18987
+ * Behavior to use when opening matched content.
18988
+ */
18989
+ behavior: 'window';
18990
+ /**
18991
+ * Options for newly-created window.
18992
+ */
18993
+ options?: Partial<WindowOptions>;
18994
+ };
18995
+
18849
18996
  /**
18850
18997
  * Generated when a child window is created.
18851
18998
  * @interface
@@ -18970,6 +19117,8 @@ declare class _Window extends WebContents<OpenFin.WindowEvent> {
18970
19117
  WillMoveEvent,
18971
19118
  WillResizeEvent,
18972
19119
  NonPropagatedWindowEvent,
19120
+ ShowAllDownloadsEvent,
19121
+ DownloadShelfVisibilityChangedEvent,
18973
19122
  WindowSourcedEvent,
18974
19123
  WillPropagateWindowEvent,
18975
19124
  WindowEvent,
@@ -19189,7 +19338,7 @@ declare class _Window extends WebContents<OpenFin.WindowEvent> {
19189
19338
  * A union of all events that emit natively on the `Window` topic, i.e. excluding those that propagate
19190
19339
  * from {@link OpenFin.ViewEvents}.
19191
19340
  */
19192
- declare type WindowSourcedEvent = WebContentsEvent<'window'> | WindowViewEvent | AuthRequestedEvent | BeginUserBoundsChangingEvent | BoundsChangedEvent | BoundsChangingEvent | ContextChangedEvent | WindowCloseRequestedEvent | WindowClosedEvent | WindowClosingEvent | DisabledMovementBoundsChangedEvent | DisabledMovementBoundsChangingEvent | EmbeddedEvent | EndUserBoundsChangingEvent | ExternalProcessExitedEvent | ExternalProcessStartedEvent | WindowHiddenEvent | WindowHotkeyEvent | WindowInitializedEvent | LayoutInitializedEvent | LayoutReadyEvent | MaximizedEvent | MinimizedEvent | WindowOptionsChangedEvent_2 | PerformanceReportEvent | PreloadScriptsStateChangedEvent | PreloadScriptsStateChangingEvent | ReloadedEvent | WindowRestoredEvent | WindowShowRequestedEvent | WindowShownEvent | UserMovementDisabledEvent | UserMovementEnabledEvent | WillMoveEvent | WillRedirectEvent | WillResizeEvent;
19341
+ declare type WindowSourcedEvent = WebContentsEvent<'window'> | WindowViewEvent | AuthRequestedEvent | BeginUserBoundsChangingEvent | BoundsChangedEvent | BoundsChangingEvent | ContextChangedEvent | WindowCloseRequestedEvent | WindowClosedEvent | WindowClosingEvent | DisabledMovementBoundsChangedEvent | DisabledMovementBoundsChangingEvent | EmbeddedEvent | EndUserBoundsChangingEvent | ExternalProcessExitedEvent | ExternalProcessStartedEvent | WindowHiddenEvent | WindowHotkeyEvent | WindowInitializedEvent | LayoutInitializedEvent | LayoutReadyEvent | MaximizedEvent | MinimizedEvent | WindowOptionsChangedEvent_2 | PerformanceReportEvent | PreloadScriptsStateChangedEvent | PreloadScriptsStateChangingEvent | ReloadedEvent | WindowRestoredEvent | WindowShowRequestedEvent | WindowShownEvent | UserMovementDisabledEvent | UserMovementEnabledEvent | WillMoveEvent | WillRedirectEvent | WillResizeEvent | ShowAllDownloadsEvent | DownloadShelfVisibilityChangedEvent;
19193
19342
 
19194
19343
  /**
19195
19344
  * Generated when a child window starts loading.
@@ -19221,7 +19370,7 @@ declare class _Window extends WebContents<OpenFin.WindowEvent> {
19221
19370
  };
19222
19371
 
19223
19372
  declare type Wire = EventEmitter & {
19224
- connect(address: string, WsConstructor: typeof WebSocket): Promise<any>;
19373
+ connect(messageReciever: MessageReceiver): Promise<any>;
19225
19374
  connectSync(): any;
19226
19375
  send(data: any): Promise<any>;
19227
19376
  shutdown(): Promise<void>;