@openfin/core 34.78.50 → 35.78.1

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_2.ClientIdentity | OpenFin_2.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
  /**
@@ -3440,12 +3486,23 @@ declare type ConstViewOptions = {
3440
3486
  /**
3441
3487
  * **Platforms Only.**
3442
3488
  * Determines what happens when a view is closed in a platform window.
3443
- * Supersedes `detachOnClose`, but has no default value.
3489
+ * Supersedes the deprecated `detachOnClose`.
3490
+ * If not set, detaults to `destroy` if `detachOnClose` is false (default), or `detach` if `detachOnClose` is true.
3491
+ * While this option is not updateable, it may change at runtime if `detachOnClose` is updated.
3444
3492
  * 'hide' hides the view on the platform window that closed it.
3445
- * 'detach' behaves like 'detachOnClose': true.
3446
- * 'destroy' is the default behavior as long as 'detachOnClose' is not set.
3493
+ * 'detach' behaves like 'detachOnClose': true. It attaches the closed view to the platform provider.
3494
+ * 'destroy' is the default behavior as long as 'detachOnClose' is not set. It destroys the view.
3447
3495
  */
3448
- closeBehavior?: 'hide' | 'detach' | 'destroy';
3496
+ closeBehavior: 'hide' | 'detach' | 'destroy';
3497
+ /**
3498
+ * Controls interaction of the view with its parent window's download shelf.
3499
+ */
3500
+ downloadShelf?: {
3501
+ /**
3502
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3503
+ */
3504
+ enabled: boolean;
3505
+ };
3449
3506
  };
3450
3507
 
3451
3508
  /**
@@ -3557,8 +3614,16 @@ declare type ConstWindowOptions = {
3557
3614
  * launches in favor of the cached value.
3558
3615
  */
3559
3616
  defaultWidth: number;
3617
+ downloadShelf: DownloadShelfOptions;
3560
3618
  height: number;
3561
3619
  layout: any;
3620
+ /**
3621
+ * @experimental
3622
+ *
3623
+ * The collection of layouts to load when the window is created. When launching multiple layouts, manage
3624
+ * the lifecycle via fin.Platform.Layout.create()/destroy() methods.
3625
+ */
3626
+ layoutSnapshot: LayoutSnapshot;
3562
3627
  /**
3563
3628
  * Parent identity of a modal window. It will create a modal child window when this option is set.
3564
3629
  */
@@ -3774,28 +3839,15 @@ declare type ContentCreationOptions = {
3774
3839
  * A rule for creating content in OpenFin; maps a content type to the way in which
3775
3840
  * newly-opened content of that type will be handled.
3776
3841
  *
3842
+ * @remarks This is effectively just a union type discriminated by the `behavior` key. The generic
3843
+ * parameter is a legacy feature that is included for backwards-compatibility reasons.
3777
3844
  *
3778
- * @interface
3845
+ * @typeParam Behavior The way content governed by this rule will be created. If provided, this type will narrow to
3846
+ * the specified `behavior` key.
3779
3847
  */
3780
- declare type ContentCreationRule<T = ContentCreationBehaviorNames> = {
3781
- /**
3782
- * Behavior to use when opening matched content. The value could be 'view' | 'window' | 'browser' | 'block'.
3783
- */
3784
- behavior: T;
3785
- /**
3786
- * List of [match patterns](https://developer.chrome.com/extensions/match_patterns) that indicate the specified
3787
- * behavior should be used
3788
- */
3789
- match: MatchPattern[];
3790
- /**
3791
- * Options for newly-created view or window (if applicable).
3792
- */
3793
- options?: T extends 'window' ? Partial<WindowOptions> : T extends 'view' ? Partial<ViewOptions> : never;
3794
- /**
3795
- * custom property
3796
- */
3797
- data?: unknown;
3798
- };
3848
+ declare type ContentCreationRule<Behavior extends ContentCreationBehaviorNames = ContentCreationBehaviorNames> = Extract<WindowContentCreationRule | ViewContentCreationRule | BrowserContentCreationRule | BlockedContentCreationRule, {
3849
+ behavior: Behavior;
3850
+ }>;
3799
3851
 
3800
3852
  /**
3801
3853
  * @interface
@@ -4304,15 +4356,12 @@ declare type CreatedEvent = BaseViewEvent & {
4304
4356
  };
4305
4357
 
4306
4358
  /**
4307
- * @interface
4359
+ * @interface @experimental
4308
4360
  */
4309
4361
  declare type CreateLayoutOptions = {
4310
- /**
4311
- * @experimental
4312
- *
4313
- * @returns
4314
- */
4315
- layoutManagerOverride: () => any;
4362
+ container: HTMLElement;
4363
+ layoutName: string;
4364
+ layout: LayoutOptions;
4316
4365
  };
4317
4366
 
4318
4367
  /**
@@ -4333,7 +4382,7 @@ declare type CreateViewPayload = {
4333
4382
  /**
4334
4383
  * @interface
4335
4384
  */
4336
- declare type CreateViewTarget = Identity_5 & {
4385
+ declare type CreateViewTarget = LayoutIdentity & {
4337
4386
  /**
4338
4387
  * If specified, view creation will not attach to a window and caller must
4339
4388
  * insert the view into the layout explicitly
@@ -4344,6 +4393,44 @@ declare type CreateViewTarget = Identity_5 & {
4344
4393
  };
4345
4394
  };
4346
4395
 
4396
+ /**
4397
+ * The registry entry for a given protocol exists but can't be parsed.
4398
+ * @interface
4399
+ */
4400
+ declare type CustomProtocolMalformedState = {
4401
+ state: 'Malformed';
4402
+ };
4403
+
4404
+ /**
4405
+ * The registry entry is missing for a given custom protocol.
4406
+ * @interface
4407
+ */
4408
+ declare type CustomProtocolMissingState = {
4409
+ state: 'Missing';
4410
+ };
4411
+
4412
+ /**
4413
+ * Define possible options for Custom protocol.
4414
+ * @interface
4415
+ */
4416
+ declare type CustomProtocolOptions = {
4417
+ protocolName: string;
4418
+ };
4419
+
4420
+ /**
4421
+ * The registry rentry for a given protocol exists and can be parsed successfully.
4422
+ * @interface
4423
+ */
4424
+ declare type CustomProtocolRegisteredState = {
4425
+ state: 'Registered';
4426
+ handlerManifestUrl: string;
4427
+ };
4428
+
4429
+ /**
4430
+ * Define possible registration states for a given custom protocol.
4431
+ */
4432
+ declare type CustomProtocolState = CustomProtocolMissingState | CustomProtocolMalformedState | CustomProtocolRegisteredState;
4433
+
4347
4434
  /**
4348
4435
  * Custom headers for requests sent by the window.
4349
4436
  *
@@ -4361,6 +4448,8 @@ declare type CustomRequestHeaders = {
4361
4448
  headers: WebRequestHeader[];
4362
4449
  };
4363
4450
 
4451
+ declare type DataChannelReadyState = RTCDataChannel['readyState'];
4452
+
4364
4453
  /**
4365
4454
  * @interface
4366
4455
  */
@@ -4433,13 +4522,6 @@ declare type DestroyedEvent = BaseViewEvent & {
4433
4522
  type: 'destroyed';
4434
4523
  };
4435
4524
 
4436
- /**
4437
- * @interface
4438
- */
4439
- declare type DestroyLayoutOptions = {
4440
- layoutName: string;
4441
- };
4442
-
4443
4525
  /**
4444
4526
  * Generated when a page's theme color changes. This is usually due to encountering a meta tag.
4445
4527
  * @interface
@@ -4636,6 +4718,47 @@ declare type DownloadRule = {
4636
4718
  match: string[];
4637
4719
  };
4638
4720
 
4721
+ /**
4722
+ * @interface
4723
+ *
4724
+ * Controls the styling and behavior of the window download shelf.
4725
+ */
4726
+ declare type DownloadShelfOptions = {
4727
+ /**
4728
+ * Whether downloads in this window trigger opening the download shelf.
4729
+ */
4730
+ enabled: boolean;
4731
+ /**
4732
+ * Styling options for the download shelf border.
4733
+ */
4734
+ border?: {
4735
+ /**
4736
+ * Thickness of the border in pixels. Default 1 pixel. Used only for frameless windows.
4737
+ *
4738
+ * @remarks The top border is fixed to 1 pixel regardless of this setting.
4739
+ */
4740
+ size?: number;
4741
+ /**
4742
+ * Color of the border, either a string name or a hex code. Defaults to chromium theme
4743
+ * if absent.
4744
+ */
4745
+ color?: string;
4746
+ };
4747
+ };
4748
+
4749
+ /**
4750
+ * Generated when the visibility of the window's download shelf changes.
4751
+ *
4752
+ * @interface
4753
+ */
4754
+ declare type DownloadShelfVisibilityChangedEvent = BaseWindowEvent & {
4755
+ type: 'download-shelf-visibility-changed';
4756
+ /**
4757
+ * True if the download shelf was just opened; false if it was just closed.
4758
+ */
4759
+ visible: boolean;
4760
+ };
4761
+
4639
4762
  /**
4640
4763
  * DPI (dots per inch) configuration for printing.
4641
4764
  *
@@ -4835,9 +4958,11 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
4835
4958
  } : never;
4836
4959
 
4837
4960
  declare interface Environment {
4838
- initLayout(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, ...args: Parameters<OpenFin_2.Fin['Platform']['Layout']['init']>): ReturnType<OpenFin_2.Fin['Platform']['Layout']['init']>;
4961
+ initLayout(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
4962
+ createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
4963
+ destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
4839
4964
  initPlatform(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, ...args: Parameters<OpenFin_2.Fin['Platform']['init']>): ReturnType<OpenFin_2.Fin['Platform']['init']>;
4840
- observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): (() => void);
4965
+ observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): () => void;
4841
4966
  writeToken(path: string, token: string): Promise<string>;
4842
4967
  retrievePort(config: NewConnectConfig): Promise<number>;
4843
4968
  getNextMessageId(): any;
@@ -5097,7 +5222,7 @@ declare namespace ExternalApplicationEvents {
5097
5222
  }
5098
5223
 
5099
5224
  /**
5100
- * Union of possible `type` values for a {@link OpenFin.ApplicationEvents.ApplicationEvent}.
5225
+ * Union of possible `type` values for a {@link ApplicationEvent}.
5101
5226
  */
5102
5227
  declare type ExternalApplicationEventType = ExternalApplicationEvent['type'];
5103
5228
 
@@ -5423,6 +5548,8 @@ declare type FindIntentsByContextOptions<MetadataType = IntentMetadata_3> = {
5423
5548
  metadata?: MetadataType;
5424
5549
  };
5425
5550
 
5551
+ declare type FlexReadyState = WebSocketReadyState | DataChannelReadyState;
5552
+
5426
5553
  /**
5427
5554
  * Generated when a WebContents gains focus.
5428
5555
  * @interface
@@ -5737,6 +5864,8 @@ declare class GlobalHotkey extends EmitterBase<OpenFin_2.GlobalHotkeyEvent> {
5737
5864
  * Registers a global hotkey with the operating system.
5738
5865
  * @param hotkey a hotkey string
5739
5866
  * @param listener called when the registered hotkey is pressed by the user.
5867
+ * @throws If the `hotkey` is reserved, see list below.
5868
+ * @throws if the `hotkey` is already registered by another application.
5740
5869
  *
5741
5870
  * @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.
5742
5871
  * 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.
@@ -5809,7 +5938,7 @@ declare class GlobalHotkey extends EmitterBase<OpenFin_2.GlobalHotkeyEvent> {
5809
5938
  */
5810
5939
  unregisterAll(): Promise<void>;
5811
5940
  /**
5812
- * Checks if a given hotkey has been registered
5941
+ * Checks if a given hotkey has been registered by an application within the current runtime.
5813
5942
  * @param hotkey a hotkey string
5814
5943
  *
5815
5944
  * @example
@@ -5873,6 +6002,7 @@ declare namespace GoldenLayout {
5873
6002
  DragSource,
5874
6003
  BrowserWindow,
5875
6004
  Header,
6005
+ TabDragListener,
5876
6006
  Tab,
5877
6007
  EventEmitter_2 as EventEmitter
5878
6008
  }
@@ -5987,10 +6117,7 @@ declare class GoldenLayout_2 implements EventEmitter_2 {
5987
6117
  * @param itemConfiguration An item configuration (can be an entire tree of items)
5988
6118
  * @param parent A parent item
5989
6119
  */
5990
- createContentItem(
5991
- itemConfiguration?: ItemConfigType,
5992
- parent?: ContentItem
5993
- ): ContentItem;
6120
+ createContentItem(itemConfiguration?: ItemConfigType, parent?: ContentItem): ContentItem;
5994
6121
 
5995
6122
  /**
5996
6123
  * Creates a new popout window with configOrContentItem as contents at the position specified in dimensions
@@ -6023,10 +6150,7 @@ declare class GoldenLayout_2 implements EventEmitter_2 {
6023
6150
  * @return the dragSource that was created. This can be used to remove the
6024
6151
  * dragSource from the layout later.
6025
6152
  */
6026
- createDragSource(
6027
- element: HTMLElement | JQuery,
6028
- itemConfiguration: ItemConfigType
6029
- ): DragSource;
6153
+ createDragSource(element: HTMLElement | JQuery, itemConfiguration: ItemConfigType): DragSource;
6030
6154
 
6031
6155
  /**
6032
6156
  * Removes a dragSource from the layout.
@@ -6399,19 +6523,30 @@ declare type InitializedEvent = IdentityEvent & {
6399
6523
  type: 'initialized';
6400
6524
  };
6401
6525
 
6402
- declare type InitLayoutOptions = OpenFin_2.InitLayoutOptions;
6403
-
6404
- declare type InitLayoutOptions_2 = OpenFin_2.InitLayoutOptions;
6405
-
6406
6526
  /**
6407
6527
  * @interface
6408
6528
  */
6409
- declare type InitLayoutOptions_3 = {
6529
+ declare type InitLayoutOptions = {
6410
6530
  /**
6531
+ * @deprecated use container HTMLElement instead
6532
+ *
6411
6533
  * The id attribute of the container where the window's Layout should be initialized. If not provided
6412
6534
  * then an element with id `layout-container` is used. We recommend using a div element.
6413
6535
  */
6414
6536
  containerId?: string;
6537
+ /**
6538
+ * The HTMLElement where the window's Layout should be initialized. We recommend using a div element.
6539
+ */
6540
+ container?: HTMLElement;
6541
+ /**
6542
+ * An override callback used to instantiate a custom LayoutManager. When present, will enable
6543
+ * Multiple Layouts. The callback should return a class.
6544
+ *
6545
+ * @remarks
6546
+ * **NOTE**: Unlike the Platform Provider overrideCallback and interopOverride, this override should
6547
+ * return a class, not an instance
6548
+ */
6549
+ layoutManagerOverride?: LayoutManagerOverride<LayoutSnapshot>;
6415
6550
  };
6416
6551
 
6417
6552
  /**
@@ -8239,7 +8374,7 @@ declare type LaunchIntoPlatformPayload = {
8239
8374
  declare class Layout extends Base {
8240
8375
  #private;
8241
8376
  /* Excluded from this release type: init */
8242
- identity: Identity_4;
8377
+ identity: OpenFin_2.LayoutIdentity;
8243
8378
  private platform;
8244
8379
  wire: Transport;
8245
8380
  /* Excluded from this release type: __constructor */
@@ -8415,19 +8550,30 @@ declare type LayoutComponent = LayoutItemConfig & {
8415
8550
 
8416
8551
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
8417
8552
 
8418
- declare class LayoutContentCache {
8419
- private contentItemCache;
8420
- private contentItemCacheId;
8421
- private createCacheKey;
8422
- hasKey: (id: string) => boolean;
8423
- getItemOrUndefined: (id: string) => GoldenLayout.ContentItem | undefined;
8424
- getContentItemOrThrow: (id: string, expectedType?: string[]) => GoldenLayout.ContentItem;
8425
- getOrCreateEntityId: (contentItem: GoldenLayout.ContentItem) => string;
8426
- }
8427
-
8428
8553
  declare type LayoutEntitiesClient = ApiClient<LayoutEntitiesController>;
8429
8554
 
8430
- /* Excluded from this release type: LayoutEntitiesController */
8555
+ declare type LayoutEntitiesController = {
8556
+ getLayoutIdentityForViewOrThrow: (viewIdentity?: OpenFin_2.Identity) => Promise<OpenFin_2.LayoutIdentity>;
8557
+ getRoot: (layoutIdentity?: OpenFin_2.LayoutIdentity) => Promise<OpenFin_2.LayoutEntityDefinition>;
8558
+ getStackByView: (viewIdentity: OpenFin_2.Identity) => Promise<OpenFin_2.LayoutEntityDefinition | undefined>;
8559
+ getStackViews: (id: string) => OpenFin_2.Identity[];
8560
+ getContent: (id: string) => OpenFin_2.LayoutEntityDefinition[];
8561
+ getParent: (id: string) => OpenFin_2.LayoutEntityDefinition | undefined;
8562
+ isRoot: (id: string) => boolean;
8563
+ exists: (entityId: string) => boolean;
8564
+ addViewToStack: (stackEntityId: string, viewCreationOrReference: ViewCreationOrReference, viewInsertionOptions?: {
8565
+ index?: number;
8566
+ }) => Promise<OpenFin_2.Identity>;
8567
+ removeViewFromStack: (stackEntityId: string, view: OpenFin_2.Identity) => Promise<void>;
8568
+ createAdjacentStack: (targetId: string, views: ViewCreationOrReference[], stackCreationOptions?: {
8569
+ position?: OpenFin_2.LayoutPosition;
8570
+ }) => Promise<string>;
8571
+ getAdjacentStacks: (stackTarget: {
8572
+ targetId: string;
8573
+ edge: OpenFin_2.LayoutPosition;
8574
+ }) => Promise<Pick<OpenFin_2.LayoutEntityDefinition, 'entityId'>[]>;
8575
+ setStackActiveView: (stackEntityId: string, viewIdentity: OpenFin_2.Identity) => Promise<void>;
8576
+ };
8431
8577
 
8432
8578
  /**
8433
8579
  * @interface
@@ -8461,29 +8607,11 @@ declare type LayoutInitializedEvent = BaseWindowEvent & {
8461
8607
  })[];
8462
8608
  };
8463
8609
 
8464
- /**
8465
- * @interface @experimental
8466
- *
8467
- * Responsible for handling all layout management and renderering
8468
- */
8469
- declare type LayoutInstance = {
8470
- getFrameSnapshot: () => Promise<LayoutOptions>;
8471
- addView: (payload: AddViewOptions) => Promise<View_2>;
8472
- closeView: (viewIdentity: Identity_5) => Promise<void>;
8473
- removeView: (viewConfig: Identity_5 | ViewState) => Promise<View_2>;
8474
- replaceView: (payload: ReplaceViewOptions) => Promise<View_2>;
8475
- getViews: () => LayoutComponent[];
8476
- getCurrentViews: () => Identity_5[];
8477
- startReplaceLayout: (payload: ReplaceLayoutOptions) => Promise<void>;
8478
- applyPreset: (payload: PresetLayoutOptions_3) => void;
8479
- isVisible: () => boolean;
8480
- destroy: () => void;
8481
- };
8610
+ /* Excluded from this release type: LayoutInstance */
8482
8611
 
8483
8612
  /**
8484
8613
  * Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
8485
- * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
8486
- * {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
8614
+ * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}.
8487
8615
  *
8488
8616
  * @interface
8489
8617
  */
@@ -8505,25 +8633,43 @@ declare type LayoutItemConfig = {
8505
8633
 
8506
8634
  /**
8507
8635
  * @interface @experimental
8636
+ *
8637
+ * **NOTE**: Internal use only. This type is reserved for Workspace Browser implementation.
8638
+ *
8639
+ * Responsible for aggergating all layout snapshots and storing LayoutInstances
8508
8640
  */
8509
- declare interface LayoutManager<T extends LayoutSnapshot = LayoutSnapshot> {
8641
+ declare interface LayoutManager<T extends LayoutSnapshot> {
8510
8642
  /**
8511
8643
  * @experimental
8512
8644
  *
8513
- * Must be overridden when working with multiple layouts
8645
+ * To enable multiple layouts, override this method and do not call super.applyLayoutSnapshot()
8646
+ *
8647
+ * This hook is called by OpenFin during fin.Platform.Layout.init() call, to pass a snapshot to derived
8648
+ * classes which will be used launch a platform window. Use this hook to set your local UI state and
8649
+ * begin rendering the containers for your layouts UI.
8514
8650
  *
8515
- * Hook called during fin.Platform.Layout.init() call, to inform derived classes
8516
- * when a snapshot is being applied to launch a platform window. Use this hook to set the
8517
- * local state and ensure you call fin.Platform.Layout.create() on every layout in snapshot.layouts
8651
+ * Ensure you call fin.Platform.Layout.create() on every layout in snapshot.layouts when that layout is
8652
+ * ready to be created in your application.
8518
8653
  *
8519
- * When using custom data to the app manifest snapshot.windows.layoutSnapshot key, this data will
8520
- * be included in the snapshot type T and should align with your component state T.
8654
+ * If you add custom data to the app manifest snapshot.windows.layoutSnapshot key, this data will
8655
+ * be included in the snapshot type.
8656
+ *
8657
+ * The default implementation throws if it is called with a snapshot containing more than one layout.
8521
8658
  *
8522
- * TODO: detect if layoutManager override was set and this was not overridden somehow to warn?
8523
8659
  * @param snapshot
8524
- * @returns
8660
+ * @throws if Object.keys(snapshot).length > 1
8661
+ */
8662
+ applyLayoutSnapshot(snapshot: T): Promise<void>;
8663
+ /**
8664
+ * Called at the start of layout initialization. Adds a new LayoutInstance if the snapshot
8665
+ * contains a single layout.
8666
+ *
8667
+ * Throws if the snapshot contains more than 1 layout, it is expected that the user handles calling
8668
+ * fin.Platform.Layout.create() once for each layout to properly connect it to their UI state.
8669
+ *
8670
+ * @param snapshot
8671
+ * @throws if Object.keys(snapshot).length > 1
8525
8672
  */
8526
- applyLayoutSnapshot: (snapshot: T) => Promise<void>;
8527
8673
  /**
8528
8674
  * @experimental
8529
8675
  *
@@ -8534,35 +8680,63 @@ declare interface LayoutManager<T extends LayoutSnapshot = LayoutSnapshot> {
8534
8680
  * @param layoutIdentity
8535
8681
  * @returns
8536
8682
  */
8537
- showLayout: ({ layoutName }: LayoutIdentity) => Promise<void>;
8683
+ showLayout({ layoutName }: LayoutIdentity): Promise<void>;
8538
8684
  /**
8539
8685
  * @experimental
8540
8686
  *
8541
8687
  * @returns T
8542
8688
  */
8543
- getLayoutSnapshot: () => Promise<T>;
8689
+ getLayoutSnapshot(): Promise<T>;
8544
8690
  /**
8545
8691
  * @experimental
8546
8692
  *
8547
- * @param param0
8693
+ * @param layoutIdentity
8548
8694
  * @returns
8549
8695
  */
8550
- resolveLayout: ({ layoutName }: LayoutIdentity) => LayoutInstance;
8696
+ resolveLayout(layoutIdentity?: LayoutIdentity): Promise<LayoutInstance>;
8551
8697
  /**
8552
8698
  * @experimental
8553
8699
  *
8554
8700
  * Returns a LayoutInstance if one exists with the name layoutIdentity.layoutName.
8555
8701
  * Throws if it does not exist.
8556
- * @param layoutIdentity
8702
+ * @param layoutName
8557
8703
  * @returns
8558
8704
  */
8559
- getLayoutByName: (layoutName: string) => LayoutInstance;
8705
+ getLayoutByName(layoutName: string): LayoutInstance;
8560
8706
  /**
8561
8707
  * @experimental
8562
8708
  */
8563
8709
  getLayouts(): Record<string, LayoutInstance>;
8710
+ /**
8711
+ * @experimental
8712
+ */
8713
+ getLayoutIdentityForView(viewIdentity: Identity_5): LayoutIdentity;
8714
+ /**
8715
+ * @experimental
8716
+ */
8717
+ isLayoutVisible({ layoutName }: LayoutIdentity): boolean;
8564
8718
  }
8565
8719
 
8720
+ /**
8721
+ * @experimental
8722
+ *
8723
+ * Constructor type for LayoutManager to be used with multiple layouts
8724
+ */
8725
+ declare type LayoutManagerConstructor<T extends LayoutSnapshot> = {
8726
+ new (): LayoutManager<T>;
8727
+ };
8728
+
8729
+ /**
8730
+ * @experimental
8731
+ *
8732
+ * Override callback used to init and configure multiple layouts. Implement by passing
8733
+ * a lambda and returning a class that OpenFin will new up for you.
8734
+ * @remarks
8735
+ * **NOTE**: Unlike the Platform Provider overrideCallback and interopOverride, this override should
8736
+ * return a class, not an instance
8737
+ */
8738
+ declare type LayoutManagerOverride<T extends LayoutSnapshot> = (Base: LayoutManagerConstructor<LayoutSnapshot>) => LayoutManagerConstructor<T>;
8739
+
8566
8740
  /**
8567
8741
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
8568
8742
  */
@@ -8587,7 +8761,7 @@ declare class LayoutModule extends Base {
8587
8761
  * const layoutConfig = await layout.getConfig();
8588
8762
  * ```
8589
8763
  */
8590
- wrap(identity: OpenFin_2.Identity): Promise<OpenFin_2.Layout>;
8764
+ wrap(identity: OpenFin_2.LayoutIdentity): Promise<OpenFin_2.Layout>;
8591
8765
  /**
8592
8766
  * Synchronously returns a Layout object that represents a Window's layout.
8593
8767
  *
@@ -8607,7 +8781,7 @@ declare class LayoutModule extends Base {
8607
8781
  * const layoutConfig = await layout.getConfig();
8608
8782
  * ```
8609
8783
  */
8610
- wrapSync(identity: OpenFin_2.Identity): OpenFin_2.Layout;
8784
+ wrapSync(identity: OpenFin_2.LayoutIdentity): OpenFin_2.Layout;
8611
8785
  /**
8612
8786
  * Asynchronously returns a Layout object that represents a Window's layout.
8613
8787
  *
@@ -8671,7 +8845,14 @@ declare class LayoutModule extends Base {
8671
8845
  * const layout = await fin.Platform.Layout.init({ containerId });
8672
8846
  * ```
8673
8847
  */
8674
- init: (options?: InitLayoutOptions) => Promise<OpenFin_2.Layout>;
8848
+ init: (options?: OpenFin_2.InitLayoutOptions) => Promise<OpenFin_2.Layout>;
8849
+ /**
8850
+ * Returns the layout manager for the current window
8851
+ * @returns
8852
+ */
8853
+ getCurrentLayoutManagerSync: <UserSnapshotType extends OpenFin_2.LayoutSnapshot>() => OpenFin_2.LayoutManager<UserSnapshotType>;
8854
+ create: (options: OpenFin_2.CreateLayoutOptions) => Promise<void>;
8855
+ destroy: (layoutIdentity: OpenFin_2.LayoutIdentity) => Promise<void>;
8675
8856
  }
8676
8857
 
8677
8858
  declare type LayoutModule_2 = OpenFin_2.Fin['Platform']['Layout'];
@@ -8757,8 +8938,7 @@ declare type LayoutOptions = {
8757
8938
  };
8758
8939
  /**
8759
8940
  * Content of the layout. There can only be one top-level LayoutItem in the content array.
8760
- * We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
8761
- * {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
8941
+ * We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}.
8762
8942
  */
8763
8943
  content?: LayoutContent;
8764
8944
  dimensions?: {
@@ -9054,7 +9234,17 @@ declare interface Message<T> {
9054
9234
 
9055
9235
  declare type MessageHandler = (data: any) => boolean;
9056
9236
 
9057
- declare class MessageReceiver extends Base {
9237
+ declare interface MessageReceiver {
9238
+ addEventListener(e: 'open', listener: (ev: Event) => void): void;
9239
+ addEventListener(e: 'error', listener: (ev: Event) => void): void;
9240
+ addEventListener(e: 'message', listener: (ev: MessageEvent) => void): void;
9241
+ addEventListener(e: 'close', listener: (ev: Event) => void): void;
9242
+ send(data: unknown): void;
9243
+ close(): void;
9244
+ readyState: FlexReadyState;
9245
+ }
9246
+
9247
+ declare class MessageReceiver_2 extends Base {
9058
9248
  private endpointMap;
9059
9249
  private latestEndpointIdByChannelId;
9060
9250
  constructor(wire: Transport);
@@ -9208,7 +9398,7 @@ declare type MutableViewOptions = {
9208
9398
  contentRedirect: ContentRedirect;
9209
9399
  /**
9210
9400
  * @defaultValue false
9211
- *
9401
+ * @deprecated
9212
9402
  * **Platforms Only.** If true, will hide and detach the View from the window for later use instead of closing,
9213
9403
  * allowing the state of the View to be saved and the View to be immediately shown in a new Layout.
9214
9404
  */
@@ -9620,6 +9810,11 @@ declare namespace OpenFin_2 {
9620
9810
  Rectangle,
9621
9811
  ApplicationCreationOptions,
9622
9812
  ApplicationOptions,
9813
+ CustomProtocolMissingState,
9814
+ CustomProtocolMalformedState,
9815
+ CustomProtocolRegisteredState,
9816
+ CustomProtocolState,
9817
+ CustomProtocolOptions,
9623
9818
  InteropBrokerOptions,
9624
9819
  ContextGroupInfo,
9625
9820
  DisplayMetadata_3 as DisplayMetadata,
@@ -9683,6 +9878,7 @@ declare namespace OpenFin_2 {
9683
9878
  ReplaceViewPayload,
9684
9879
  ReplaceViewOptions,
9685
9880
  CloseViewPayload,
9881
+ CloseViewOptions,
9686
9882
  FetchManifestPayload,
9687
9883
  ReplaceLayoutOpts,
9688
9884
  ReplaceLayoutPayload,
@@ -9806,6 +10002,11 @@ declare namespace OpenFin_2 {
9806
10002
  IntentHandler_2 as IntentHandler,
9807
10003
  ContentCreationBehaviorNames,
9808
10004
  MatchPattern,
10005
+ BaseContentCreationRule,
10006
+ WindowContentCreationRule,
10007
+ ViewContentCreationRule,
10008
+ BrowserContentCreationRule,
10009
+ BlockedContentCreationRule,
9809
10010
  ContentCreationRule,
9810
10011
  ContentCreationOptions,
9811
10012
  SnapshotProvider,
@@ -9845,13 +10046,13 @@ declare namespace OpenFin_2 {
9845
10046
  LayoutPresetType,
9846
10047
  LayoutIdentity,
9847
10048
  LayoutSnapshot,
9848
- InitLayoutOptions_3 as InitLayoutOptions,
10049
+ InitLayoutOptions,
10050
+ LayoutManagerConstructor,
10051
+ LayoutManagerOverride,
9849
10052
  LayoutInstance,
9850
10053
  LayoutManager,
9851
- AddLayoutInstanceOptions,
9852
10054
  CreateLayoutOptions,
9853
- DestroyLayoutOptions,
9854
- PresetLayoutOptions_3 as PresetLayoutOptions,
10055
+ PresetLayoutOptions_2 as PresetLayoutOptions,
9855
10056
  ResultBehavior,
9856
10057
  PopupBaseBehavior,
9857
10058
  PopupResultBehavior,
@@ -9891,6 +10092,7 @@ declare namespace OpenFin_2 {
9891
10092
  ChannelClientDisconnectionListener,
9892
10093
  ChannelProviderDisconnectionListener,
9893
10094
  RoutingInfo,
10095
+ DownloadShelfOptions,
9894
10096
  ApplicationEvents,
9895
10097
  BaseEvents,
9896
10098
  ExternalApplicationEvents,
@@ -9905,101 +10107,6 @@ declare namespace OpenFin_2 {
9905
10107
  }
9906
10108
  export default OpenFin_2;
9907
10109
 
9908
- declare class OpenFinLayout implements OpenFin_2.LayoutInstance {
9909
- #private;
9910
- private readonly splitterController;
9911
- private readonly tabDragController;
9912
- private readonly layoutContentCache;
9913
- private get defaultFaviconUrl();
9914
- private get isDragging();
9915
- private get resizing();
9916
- private get showBackgroundImages();
9917
- private get showFavicons();
9918
- private get showViewsOnSplitterDrag();
9919
- private get showViewsOnTabDrag();
9920
- private get showViewsOnWindowResize();
9921
- private get container();
9922
- get layout(): GoldenLayout.GoldenLayout;
9923
- private get layoutConfigToRestore();
9924
- private client;
9925
- private containerResizeObserver;
9926
- private viewsResizeObserver;
9927
- readonly ofWindow: OpenFin_2.Window;
9928
- readonly platform: Platform_2;
9929
- private lastItemDestroyed?;
9930
- private viewsSubscribedTo;
9931
- constructor(splitterController: SplitterController, tabDragController: TabDragController, layoutContentCache: LayoutContentCache, container: HTMLElement);
9932
- getViews: () => OpenFin_2.LayoutComponent[];
9933
- startReplaceLayout: ({ layout }: {
9934
- layout: GoldenLayout.Config;
9935
- }) => Promise<void>;
9936
- applyPreset: (payload: PresetLayoutOptions_2) => void;
9937
- isVisible: () => boolean;
9938
- destroy: () => void;
9939
- /* Excluded from this release type: getClient */
9940
- initManager: () => Promise<void>;
9941
- createLayout: (layout: GoldenLayout.Config, container: HTMLElement) => Promise<void>;
9942
- private setContainer;
9943
- private setupDragDropRegions;
9944
- private replaceLayout;
9945
- private onViewDetached;
9946
- private setupLayoutListeners;
9947
- private onLayoutInit;
9948
- private registerViewComponent;
9949
- private setupWindowListeners;
9950
- private setupResizeObservers;
9951
- /**
9952
- * Shows/hides a view depending on use case (used by browser)
9953
- * @ignore
9954
- */
9955
- private updateViewVisibility;
9956
- private onStackCreated;
9957
- private onTabCreated;
9958
- private onTabMouseUp;
9959
- private replaceCloseTabButton;
9960
- onCloseTabButtonClick: (tab: GoldenLayout.Tab) => Promise<void>;
9961
- addFaviconToTab: (tab: GoldenLayout.Tab, eventIcons: string[]) => void;
9962
- onPopoutClick: (stack: GoldenLayout.ContentItem) => void;
9963
- onStackCloseClick: (stack: GoldenLayout.ContentItem) => void;
9964
- private updateButtonDisplay;
9965
- private onItemCreated;
9966
- private observeSplitters;
9967
- handleOutOfWindowDrop: (e: {
9968
- screenY: number;
9969
- screenX: number;
9970
- }, parentTab: GoldenLayout.Tab, dimensions: {
9971
- width: any;
9972
- height: any;
9973
- }) => Promise<void>;
9974
- private onTabDragStart;
9975
- private setBackgroundImage;
9976
- private setBackgroundImages;
9977
- getFrameSnapshot: () => Promise<GoldenLayout.Config>;
9978
- getCurrentViews: () => OpenFin_2.Identity[];
9979
- addView: ({ options: viewConfig, targetView, location }: OpenFin_2.AddViewOptions) => Promise<View_4>;
9980
- replaceView: ({ viewToReplace, newView }: OpenFin_2.ReplaceViewOptions) => Promise<View_4>;
9981
- removeView: (viewConfig: OpenFin_2.Identity | OpenFin_2.ViewState) => Promise<View_4>;
9982
- closeView: (viewIdentity: OpenFin_2.Identity) => Promise<void>;
9983
- private createChannelConnections;
9984
- getViewComponent: ({ name }: {
9985
- name: string;
9986
- }) => ViewComponent | undefined;
9987
- getViewComponents: () => ViewComponent[];
9988
- private hideHighlight;
9989
- getOfViewFromComponentState: ({ name }: {
9990
- name: string;
9991
- }) => View_4;
9992
- private hideAllViews;
9993
- private showViews;
9994
- private initializeLayoutViews;
9995
- private createResizableView;
9996
- private attachView;
9997
- private createAndAttachView;
9998
- private setupViewEvents;
9999
- private dispatchLayoutEvent;
10000
- private setComponentState;
10001
- }
10002
-
10003
10110
  declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
10004
10111
 
10005
10112
  declare type OverlapsOnlyIfMatching<T, U> = {
@@ -10736,8 +10843,6 @@ declare class Platform extends EmitterBase<OpenFin_2.PlatformEvent> {
10736
10843
  }): Promise<void>;
10737
10844
  }
10738
10845
 
10739
- declare type Platform_2 = OpenFin_2.Platform;
10740
-
10741
10846
  /**
10742
10847
  * Generated when a new Platform's API becomes responsive.
10743
10848
  * @interface
@@ -11029,6 +11134,8 @@ declare interface PlatformProvider {
11029
11134
  * ```
11030
11135
  */
11031
11136
  getSnapshot(payload: undefined, identity: OpenFin_2.Identity): Promise<OpenFin_2.Snapshot>;
11137
+ /* Excluded from this release type: getInitialLayoutSnapshot */
11138
+ /* Excluded from this release type: createViewsForLayout */
11032
11139
  /* Excluded from this release type: getViewSnapshot */
11033
11140
  /**
11034
11141
  * Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen.
@@ -11728,12 +11835,10 @@ declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent &
11728
11835
 
11729
11836
  declare type PresetLayoutOptions = OpenFin_2.PresetLayoutOptions;
11730
11837
 
11731
- declare type PresetLayoutOptions_2 = OpenFin_2.PresetLayoutOptions;
11732
-
11733
11838
  /**
11734
11839
  * @interface
11735
11840
  */
11736
- declare type PresetLayoutOptions_3 = {
11841
+ declare type PresetLayoutOptions_2 = {
11737
11842
  /**
11738
11843
  * Which preset layout arrangement to use.
11739
11844
  * The preset options are `columns`, `grid`, `rows`, and `tabs`.
@@ -11957,7 +12062,7 @@ declare type PropagatedEventType<Topic extends string, Type extends string> = `$
11957
12062
 
11958
12063
  /**
11959
12064
  * A view event that has propagated to a parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
11960
- * or {@link Openfin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
12065
+ * or {@link OpenFin.SystemEvents System}), adding a `viewIdentity` property (since the `Identity` property of the propagated event refers to the `Window`) and prefixing the
11961
12066
  * event type key with `'view-'`.
11962
12067
  */
11963
12068
  declare type PropagatedViewEvent<TargetTopic extends string> = PropagatedEvent<'view', TargetTopic, ViewEvent> & {
@@ -11971,7 +12076,7 @@ declare type PropagatedViewEventType = PropagatedViewEvent<string>['type'];
11971
12076
 
11972
12077
  /**
11973
12078
  * A Window event that has propagated to the parent {@link OpenFin.ApplicationEvents Application} and {@link OpenFin.SystemEvents System},
11974
- * prefixing the type string with `'window-'`. Only {@link NativeWindowEvent native window events} will propagate
12079
+ * prefixing the type string with `'window-'`. Only {@link WindowSourcedEvent window-sourced events} will propagate
11975
12080
  * this way; those that have {@link OpenFin.ViewEvents.PropagatedViewEvent propagated} from {@link OpenFin.ViewEvents}
11976
12081
  * will *not* re-propagate.
11977
12082
  *
@@ -12189,6 +12294,13 @@ declare interface ProtocolMap extends ProtocolMapBase {
12189
12294
  anchor: OpenFin_2.AnchorType;
12190
12295
  }>>;
12191
12296
  'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin_2.Bounds>>>;
12297
+ 'register-custom-protocol': ApiCall<OpenFin_2.CustomProtocolOptions, void>;
12298
+ 'unregister-custom-protocol': ApiCall<{
12299
+ protocolName: string;
12300
+ }, void>;
12301
+ 'get-custom-protocol-state': ApiCall<{
12302
+ protocolName: string;
12303
+ }, OpenFin_2.CustomProtocolState>;
12192
12304
  }
12193
12305
 
12194
12306
  declare interface ProtocolMapBase {
@@ -12320,6 +12432,10 @@ declare interface ReactComponentConfig extends ItemConfig {
12320
12432
  */
12321
12433
  declare type ReadImageClipboardRequest = BaseClipboardRequest & ImageFormatOptions;
12322
12434
 
12435
+ declare interface ReceiverConfig extends Omit<RemoteConfig, 'address'> {
12436
+ receiver: MessageReceiver;
12437
+ }
12438
+
12323
12439
  /**
12324
12440
  * A rectangular area on the screen.
12325
12441
  *
@@ -12401,19 +12517,19 @@ declare interface RemoteConfig extends ExistingConnectConfig {
12401
12517
  /**
12402
12518
  * @interface
12403
12519
  */
12404
- declare type ReplaceLayoutOptions = ReplaceLayoutOpts;
12520
+ declare type ReplaceLayoutOptions = {
12521
+ /**
12522
+ * Layout config to be applied.
12523
+ */
12524
+ layout: LayoutOptions;
12525
+ };
12405
12526
 
12406
12527
  /**
12407
12528
  * @interface
12408
12529
  *
12409
12530
  * @deprecated use ReplaceLayoutOptions instead
12410
12531
  */
12411
- declare type ReplaceLayoutOpts = {
12412
- /**
12413
- * Layout config to be applied.
12414
- */
12415
- layout: LayoutOptions;
12416
- };
12532
+ declare type ReplaceLayoutOpts = ReplaceLayoutOptions;
12417
12533
 
12418
12534
  /**
12419
12535
  * @interface
@@ -12424,9 +12540,9 @@ declare type ReplaceLayoutPayload = {
12424
12540
  */
12425
12541
  opts: ReplaceLayoutOptions;
12426
12542
  /**
12427
- * Identity of the window whose layout will be replace.
12543
+ * Identity of the window whose layout will be replaced.
12428
12544
  */
12429
- target: Identity_5;
12545
+ target: LayoutIdentity;
12430
12546
  };
12431
12547
 
12432
12548
  /**
@@ -12445,7 +12561,7 @@ declare type ReplaceViewPayload = {
12445
12561
  viewToReplace: Identity_5;
12446
12562
  newView: Partial<ViewOptions>;
12447
12563
  };
12448
- target: Identity_5;
12564
+ target: LayoutIdentity;
12449
12565
  };
12450
12566
 
12451
12567
  /**
@@ -12957,6 +13073,49 @@ declare type ShortcutOverride = Hotkey & {
12957
13073
  command: string;
12958
13074
  };
12959
13075
 
13076
+ /**
13077
+ * Generated when the Download Shelf 'Show All' button is clicked.
13078
+ *
13079
+ * @remarks By default, OpenFin does not handle the clicking of the `Show All` button on the download
13080
+ * shelf. Instead, it fires this event, which leaves rendering a download manager to the user. For a simple
13081
+ * implementation, the `chrome://downloads` page can be used (see the example below):
13082
+ *
13083
+ * @example
13084
+ *
13085
+ * ```typescript
13086
+ * const platform = await fin.Platform.getCurrentSync();
13087
+ * // Listen to the propagated event at the Platform level, so that we only need one listener for a click from any window
13088
+ * platform.on('window-show-all-downloads', () => {
13089
+ * // Render the `chrome://downloads` window when a user clicks on the download shelf `Show All` button
13090
+ * platform.createWindow({
13091
+ * name: 'show-download-window',
13092
+ * layout: {
13093
+ * content: [
13094
+ * {
13095
+ * type: 'stack',
13096
+ * content: [
13097
+ * {
13098
+ * type: 'component',
13099
+ * componentName: 'view',
13100
+ * componentState: {
13101
+ * name: 'show-download-view',
13102
+ * url: 'chrome://downloads'
13103
+ * }
13104
+ * }
13105
+ * ]
13106
+ * }
13107
+ * ]
13108
+ * }
13109
+ * });
13110
+ * })
13111
+ * ```
13112
+ *
13113
+ * @interface
13114
+ */
13115
+ declare type ShowAllDownloadsEvent = BaseWindowEvent & {
13116
+ type: 'show-all-downloads';
13117
+ };
13118
+
12960
13119
  /**
12961
13120
  * Generated when a View is shown. This event will fire during creation of a View.
12962
13121
  * @interface
@@ -13146,37 +13305,6 @@ declare class SnapshotSourceModule extends Base {
13146
13305
  wrap(identity: OpenFin_2.ApplicationIdentity): Promise<SnapshotSource>;
13147
13306
  }
13148
13307
 
13149
- /**
13150
- * Utility class for managing Golden Layout splitter drag interactions.
13151
- * @ignore
13152
- */
13153
- declare class SplitterController {
13154
- private readonly viewOverlay;
13155
- constructor(viewOverlay: ViewOverlay);
13156
- private teardown?;
13157
- private tryTeardown;
13158
- /**
13159
- * Disables the pointer events on the splitters, preventing them from being dragged.
13160
- */
13161
- preventSplitterResize: () => void;
13162
- /**
13163
- * Ends a splitter drag move, if one is in progress.
13164
- */
13165
- endMove: () => Promise<void>;
13166
- /**
13167
- * Initialises a splitter drag move, rendering a view on top of the splitter
13168
- * to allow it to render on top of the views within a layout (as they will always
13169
- * have a higher z-index to the platform window itself).
13170
- * @param splitterItem The Golden Layout splitter item that is currently being dragged.
13171
- */
13172
- startMove: (splitterItem: SplitterItem) => Promise<void>;
13173
- }
13174
-
13175
- declare type SplitterItem = GoldenLayout.ContentItem & {
13176
- viewEventsAdded: boolean;
13177
- isVertical: boolean;
13178
- };
13179
-
13180
13308
  /**
13181
13309
  * Generated when an application has started.
13182
13310
  * @interface
@@ -14022,6 +14150,70 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
14022
14150
  * ```
14023
14151
  */
14024
14152
  openUrlWithBrowser(url: string): Promise<void>;
14153
+ /**
14154
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
14155
+ * overwrites the existing registry entry if the given custom protocol name already exists.
14156
+ *
14157
+ * Note: This method is restricted by default and must be enabled via
14158
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14159
+ *
14160
+ *
14161
+ * @remarks These protocols are reserved and cannot be registered:
14162
+ * - fin
14163
+ * - fins
14164
+ * - openfin
14165
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14166
+ *
14167
+ * @throws if a given custom protocol failed to be registered.
14168
+ * @throws if a manifest URL contains the '%1' string.
14169
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
14170
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
14171
+ *
14172
+ * @example
14173
+ * ```js
14174
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
14175
+ * ```
14176
+ */
14177
+ registerCustomProtocol(options: OpenFin_2.CustomProtocolOptions): Promise<void>;
14178
+ /**
14179
+ * Removes the registry entry for a given custom protocol.
14180
+ *
14181
+ * Note: This method is restricted by default and must be enabled via
14182
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14183
+ *
14184
+ *
14185
+ * @remarks These protocols are reserved and cannot be unregistered:
14186
+ * - fin
14187
+ * - fins
14188
+ * - openfin
14189
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14190
+ *
14191
+ * @throws if a protocol entry failed to be removed in registry.
14192
+ *
14193
+ * @example
14194
+ * ```js
14195
+ * await fin.System.unregisterCustomProtocol('protocol1');
14196
+ * ```
14197
+ */
14198
+ unregisterCustomProtocol(protocolName: string): Promise<void>;
14199
+ /**
14200
+ * Retrieves the registration state for a given custom protocol.
14201
+ *
14202
+ * Note: This method is restricted by default and must be enabled via
14203
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
14204
+ *
14205
+ * @remarks These protocols are reserved and cannot get states for them:
14206
+ * - fin
14207
+ * - fins
14208
+ * - openfin
14209
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
14210
+ *
14211
+ *
14212
+ * @example
14213
+ * ```js
14214
+ * const protocolState = await fin.System.getCustomProtocolState('protocol1');
14215
+ */
14216
+ getCustomProtocolState(protocolName: string): Promise<OpenFin_2.CustomProtocolState>;
14025
14217
  /**
14026
14218
  * Removes the process entry for the passed UUID obtained from a prior call
14027
14219
  * of fin.System.launchExternalProcess().
@@ -14718,6 +14910,18 @@ declare type SystemPermissions = {
14718
14910
  enabled: boolean;
14719
14911
  protocols: string[];
14720
14912
  };
14913
+ registerCustomProtocol: boolean | {
14914
+ enabled: boolean;
14915
+ protocols: string[];
14916
+ };
14917
+ unregisterCustomProtocol: boolean | {
14918
+ enabled: boolean;
14919
+ protocols: string[];
14920
+ };
14921
+ getCustomProtocolState: boolean | {
14922
+ enabled: boolean;
14923
+ protocols: string[];
14924
+ };
14721
14925
  };
14722
14926
 
14723
14927
  /**
@@ -14736,7 +14940,7 @@ declare type SystemShutdownHandler = (shutdownEvent: {
14736
14940
  }) => void;
14737
14941
 
14738
14942
  declare interface Tab {
14739
- _dragListener: EventEmitter_2;
14943
+ _dragListener: TabDragListener;
14740
14944
 
14741
14945
  /**
14742
14946
  * True if this tab is the selected tab
@@ -14781,60 +14985,11 @@ declare interface Tab {
14781
14985
  setActive(isActive: boolean): void;
14782
14986
  }
14783
14987
 
14784
- /**
14785
- * Set of apis used to facilitate tab drag interactions without needing to hide views.
14786
- * @ignore
14787
- */
14788
- declare class TabDragController {
14789
- private readonly viewOverlay;
14790
- constructor(viewOverlay: ViewOverlay);
14791
- private dropZonePreview?;
14792
- /**
14793
- *
14794
- * When a tab is dragged out of a stack, it will need to be hidden from the stack.
14795
- *
14796
- * Additionally, if there is a new view to show in the stack, it will be shown at the position specified by
14797
- * containerBounds
14798
- *
14799
- * As drag interactions can under extreme circumstances complete before this chain of promises has completed,
14800
- * we need to pass in a isDragging() function which returns whether the drag is in progress.
14801
- * This allows us to cancel any layout affecting operations.
14802
- *
14803
- * @param draggingView The view which is currently being dragged
14804
- * @param isLastViewInWindow Whether the draggin view is the last view in a window or not. If false, the dragging view will not hide.
14805
- * @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
14806
- * modifying any views if the drag has completed (as the post drag procedure will have taken care of it.)
14807
- * @param containerBounds The bounds of the container of the view to be shown in the stack
14808
- * @param nextView The view which has become active after dragging the draggingView out.
14809
- */
14810
- handleTabStackActiveView: (draggingView: View_3, isLastViewInWindow: boolean, isDragging: () => boolean, containerBounds?: OpenFin_2.Bounds, nextView?: View_3) => Promise<void>;
14811
- /**
14812
- * Extracts the border and backgroundColor css values from the drop zone preview,
14813
- * and sets the viewOverlay to match them.
14814
- */
14815
- inheritStyles: () => Promise<void>;
14816
- /**
14817
- * Called when a tab drag interaction is started from the current window (not when it enters the window).
14818
- *
14819
- * Sets all views in the platform to ignore mouse events so that they can pass through to the golden-layout
14820
- * document whilst remaining visible.
14821
- */
14822
- startDrag: () => Promise<void>;
14823
- /**
14824
- * Called when a tab drag interaction which was started from the current window ends.
14825
- *
14826
- * Disables the click through setting on every view in the platform.
14827
- */
14828
- endDrag: () => Promise<void>;
14829
- private disposeObserve?;
14830
- disposeOverlayObserver: () => void;
14988
+ declare interface TabDragListener extends EventEmitter_2 {
14831
14989
  /**
14832
- * Observes a golden-layout drop zone preview in order to render a BrowserView
14833
- * overlay whenever a tab is dragged over a droppable region.
14834
- * @param dropZonePreview The drop zone preview element created by Golden Layout in order to highlight
14835
- * droppable regions of the UI.
14990
+ * A reference to the content item this tab relates to
14836
14991
  */
14837
- observeOverlay: (dropZonePreview: HTMLElement) => Promise<void>;
14992
+ contentItem: ContentItem;
14838
14993
  }
14839
14994
 
14840
14995
  /**
@@ -15115,7 +15270,7 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
15115
15270
  connectSync: () => void;
15116
15271
  getPort: () => string;
15117
15272
  shutdown(): Promise<void>;
15118
- connect(config: InternalConnectConfig | RemoteConfig): Promise<string | void>;
15273
+ connect(config: InternalConnectConfig | RemoteConfig | ReceiverConfig): Promise<string | void>;
15119
15274
  private connectRemote;
15120
15275
  connectByPort(config: ExistingConnectConfig): Promise<void>;
15121
15276
  private authorize;
@@ -15888,10 +16043,6 @@ declare class View_2 extends WebContents<OpenFin_2.ViewEvent> {
15888
16043
  /* Excluded from this release type: bindToElement */
15889
16044
  }
15890
16045
 
15891
- declare type View_3 = OpenFin_2.View;
15892
-
15893
- declare type View_4 = OpenFin_2.View;
15894
-
15895
16046
  /**
15896
16047
  * Generated when a View is attached to a window.
15897
16048
  * @interface
@@ -15902,9 +16053,21 @@ declare type ViewAttachedEvent = BaseWindowEvent & {
15902
16053
  viewIdentity: OpenFin_2.Identity;
15903
16054
  };
15904
16055
 
15905
- declare interface ViewComponent extends GoldenLayout.ContentItem {
15906
- componentState: OpenFin_2.ViewState;
15907
- }
16056
+ /**
16057
+ * A rule prescribing content creation in a {@link OpenFin.View}.
16058
+ *
16059
+ * @interface
16060
+ */
16061
+ declare type ViewContentCreationRule = BaseContentCreationRule & {
16062
+ /**
16063
+ * Behavior to use when opening matched content.
16064
+ */
16065
+ behavior: 'view';
16066
+ /**
16067
+ * Options for newly-created view.
16068
+ */
16069
+ options?: Partial<ViewOptions>;
16070
+ };
15908
16071
 
15909
16072
  /**
15910
16073
  * The options object required by {@link View.ViewModule.create View.create}.
@@ -16071,40 +16234,6 @@ declare class ViewModule extends Base {
16071
16234
  */
16072
16235
  declare type ViewOptions = ConstViewOptions & MutableViewOptions;
16073
16236
 
16074
- /**
16075
- * Api client allowing an empty electron BrowserView to be rendered
16076
- * in the current window with the specified bounds.
16077
- *
16078
- * Please note, only one view based overlay can be rendered at a time per runtime.
16079
- * @ignore
16080
- */
16081
- declare class ViewOverlay {
16082
- private wire;
16083
- constructor(wire: Transport);
16084
- /**
16085
- * Sets the style of the root <html> element of the view overlay webcontent.
16086
- * @param style A partial collection of Css style declarations to set.
16087
- */
16088
- setStyle: (style: Partial<CSSStyleDeclaration>) => Promise<void>;
16089
- /**
16090
- * Renders the overlay at the specified position relative to the calling window.
16091
- * @param options Bounds and background color to display in the overlay.
16092
- */
16093
- renderOverlay: (bounds: OpenFin_2.Bounds) => Promise<void>;
16094
- /**
16095
- * Removes the overlay from the current window.
16096
- */
16097
- detachOverlay: () => Promise<void>;
16098
- /**
16099
- * Allows setting all OpenFin views to ignore or consume mouse events.
16100
- *
16101
- * This can help with the rendering of view overlays that depend on OpenFin views not consuming mouse events.
16102
- *
16103
- * @param enabled If true, all mouse events are ignored by openfin views. If false, all OpenFin views will consume mouse events.
16104
- */
16105
- setIgnoreViewMouseEvents(enabled: boolean): Promise<void>;
16106
- }
16107
-
16108
16237
  /**
16109
16238
  * Represents the payload shape for Views that are trying to prevent an unload.
16110
16239
  * @interface
@@ -17208,6 +17337,8 @@ declare type WebRequestHeader = {
17208
17337
  [key: string]: string;
17209
17338
  };
17210
17339
 
17340
+ declare type WebSocketReadyState = WebSocket['readyState'];
17341
+
17211
17342
  /**
17212
17343
  * Generated when a window is being moved by the user.
17213
17344
  * @remarks For use with monitor scaling that is not 100%. Bounds are given in DIP (adjusted for monitor scale factor).
@@ -18094,7 +18225,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
18094
18225
  * ```
18095
18226
  * @experimental
18096
18227
  */
18097
- getLayout(): Promise<OpenFin_2.Layout>;
18228
+ getLayout(layoutIdentity?: OpenFin_2.LayoutIdentity): Promise<OpenFin_2.Layout>;
18098
18229
  /**
18099
18230
  * Gets the current settings of the window.
18100
18231
  *
@@ -18836,6 +18967,22 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
18836
18967
  type: 'closing';
18837
18968
  };
18838
18969
 
18970
+ /**
18971
+ * A rule prescribing content creation in a {@link OpenFin.Window}.
18972
+ *
18973
+ * @interface
18974
+ */
18975
+ declare type WindowContentCreationRule = BaseContentCreationRule & {
18976
+ /**
18977
+ * Behavior to use when opening matched content.
18978
+ */
18979
+ behavior: 'window';
18980
+ /**
18981
+ * Options for newly-created window.
18982
+ */
18983
+ options?: Partial<WindowOptions>;
18984
+ };
18985
+
18839
18986
  /**
18840
18987
  * Generated when a child window is created.
18841
18988
  * @interface
@@ -18960,6 +19107,8 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
18960
19107
  WillMoveEvent,
18961
19108
  WillResizeEvent,
18962
19109
  NonPropagatedWindowEvent,
19110
+ ShowAllDownloadsEvent,
19111
+ DownloadShelfVisibilityChangedEvent,
18963
19112
  WindowSourcedEvent,
18964
19113
  WillPropagateWindowEvent,
18965
19114
  WindowEvent,
@@ -19179,7 +19328,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
19179
19328
  * A union of all events that emit natively on the `Window` topic, i.e. excluding those that propagate
19180
19329
  * from {@link OpenFin.ViewEvents}.
19181
19330
  */
19182
- 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;
19331
+ 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;
19183
19332
 
19184
19333
  /**
19185
19334
  * Generated when a child window starts loading.
@@ -19211,7 +19360,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
19211
19360
  };
19212
19361
 
19213
19362
  declare type Wire = EventEmitter & {
19214
- connect(address: string, WsConstructor: typeof WebSocket): Promise<any>;
19363
+ connect(messageReciever: MessageReceiver): Promise<any>;
19215
19364
  connectSync(): any;
19216
19365
  send(data: any): Promise<any>;
19217
19366
  shutdown(): Promise<void>;