@openfin/core 34.78.20 → 34.78.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/mock.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  /// <reference types="node" />
3
3
 
4
4
  import { EventEmitter } from 'events';
5
- import type * as GoldenLayout from '@openfin/golden-layout';
6
5
 
7
6
  /**
8
7
  * Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
@@ -1721,7 +1720,9 @@ declare type BaseConfig = {
1721
1720
  };
1722
1721
 
1723
1722
  /**
1724
- * A base event.
1723
+ * A base OpenFin event. All OpenFin event payloads extend this type.
1724
+ *
1725
+ * @interface
1725
1726
  */
1726
1727
  declare type BaseEvent = {
1727
1728
  topic: string;
@@ -1841,6 +1842,48 @@ declare type BoundsChangingEvent = BoundsChangeEvent & {
1841
1842
  type: 'bounds-changing';
1842
1843
  };
1843
1844
 
1845
+ declare interface BrowserWindow {
1846
+ /**
1847
+ * True if the window has been opened and its GoldenLayout instance initialised.
1848
+ */
1849
+ isInitialised: boolean;
1850
+
1851
+ /**
1852
+ * Creates a window configuration object from the Popout.
1853
+ */
1854
+ toConfig(): {
1855
+ dimensions: {
1856
+ width: number;
1857
+ height: number;
1858
+ left: number;
1859
+ top: number;
1860
+ };
1861
+ content: Config;
1862
+ parentId: string;
1863
+ indexInParent: number;
1864
+ };
1865
+
1866
+ /**
1867
+ * Returns the GoldenLayout instance from the child window
1868
+ */
1869
+ getGlInstance(): GoldenLayout_2;
1870
+
1871
+ /**
1872
+ * Returns the native Window object
1873
+ */
1874
+ getWindow(): Window;
1875
+
1876
+ /**
1877
+ * Closes the popout
1878
+ */
1879
+ close(): void;
1880
+
1881
+ /**
1882
+ * Returns the popout to its original position as specified in parentId and indexInParent
1883
+ */
1884
+ popIn(): void;
1885
+ }
1886
+
1844
1887
  /**
1845
1888
  * Configuration for page capture.
1846
1889
  *
@@ -3253,6 +3296,31 @@ declare class CombinedStrategy<A, B> implements ChannelStrategy<OnlyIfCompatible
3253
3296
  close(): Promise<void>;
3254
3297
  }
3255
3298
 
3299
+ declare interface ComponentConfig extends ItemConfig {
3300
+ /**
3301
+ * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.
3302
+ */
3303
+ componentName: string;
3304
+
3305
+ /**
3306
+ * A serialisable object. Will be passed to the component constructor function and will be the value returned by
3307
+ * container.getState().
3308
+ */
3309
+ componentState?: any;
3310
+ }
3311
+
3312
+ declare interface Config {
3313
+ settings?: Settings;
3314
+ dimensions?: Dimensions;
3315
+ labels?: Labels;
3316
+ content?: ItemConfigType[];
3317
+ /**
3318
+ * (Only on layout config object)
3319
+ * Id of the currently maximised content item
3320
+ */
3321
+ maximisedItemId?: string;
3322
+ }
3323
+
3256
3324
  declare type ConfigWithRuntime = BaseConfig & {
3257
3325
  runtime: RuntimeConfig;
3258
3326
  };
@@ -3543,6 +3611,103 @@ declare type ConstWindowOptions = {
3543
3611
  viewVisibility?: ViewVisibilityOptions;
3544
3612
  };
3545
3613
 
3614
+ declare interface Container extends EventEmitter_2 {
3615
+ /**
3616
+ * The current width of the container in pixel
3617
+ */
3618
+ width: number;
3619
+
3620
+ /**
3621
+ * The current height of the container in pixel
3622
+ */
3623
+ height: number;
3624
+
3625
+ /**
3626
+ * A reference to the component-item that controls this container
3627
+ */
3628
+ parent: ContentItem;
3629
+
3630
+ /**
3631
+ * A reference to the tab that controls this container. Will initially be null
3632
+ * (and populated once a tab event has been fired).
3633
+ */
3634
+ tab: Tab;
3635
+
3636
+ /**
3637
+ * The current title of the container
3638
+ */
3639
+ title: string;
3640
+
3641
+ /*
3642
+ * A reference to the GoldenLayout instance this container belongs to
3643
+ */
3644
+ layoutManager: GoldenLayout_2;
3645
+
3646
+ /**
3647
+ * True if the item is currently hidden
3648
+ */
3649
+ isHidden: boolean;
3650
+
3651
+ /**
3652
+ * Overwrites the components state with the provided value. To only change parts of the componentState see
3653
+ * extendState below. This is the main mechanism for saving the state of a component. This state will be the
3654
+ * value of componentState when layout.toConfig() is called and will be passed back to the component's
3655
+ * constructor function. It will also be used when the component is opened in a new window.
3656
+ * @param state A serialisable object
3657
+ */
3658
+ setState(state: any): void;
3659
+
3660
+ /**
3661
+ * The same as setState but does not emit 'stateChanged' event
3662
+ * @param {serialisable} state
3663
+ */
3664
+ setStateSkipEvent(state: any): void;
3665
+
3666
+ /**
3667
+ * This is similar to setState, but merges the provided state into the current one, rather than overwriting it.
3668
+ * @param state A serialisable object
3669
+ */
3670
+ extendState(state: any): void;
3671
+
3672
+ /**
3673
+ * Returns the current state.
3674
+ */
3675
+ getState(): any;
3676
+
3677
+ /**
3678
+ * Returns the container's inner element as a jQuery element
3679
+ */
3680
+ getElement(): JQuery;
3681
+
3682
+ /**
3683
+ * hides the container or returns false if hiding it is not possible
3684
+ */
3685
+ hide(): boolean;
3686
+
3687
+ /**
3688
+ * shows the container or returns false if showing it is not possible
3689
+ */
3690
+ show(): boolean;
3691
+
3692
+ /**
3693
+ * Sets the container to the specified size or returns false if that's not possible
3694
+ * @param width the new width in pixel
3695
+ * @param height the new height in pixel
3696
+ */
3697
+ setSize(width: number, height: number): boolean;
3698
+
3699
+ /**
3700
+ * Sets the item's title to the provided value. Triggers titleChanged and stateChanged events
3701
+ * @param title the new title
3702
+ */
3703
+ setTitle(title: string): void;
3704
+
3705
+ /**
3706
+ * Closes the container or returns false if that is not possible
3707
+ */
3708
+ close(): boolean;
3709
+ }
3710
+
3546
3711
  declare type ContentCreationBehaviorNames = 'window' | 'view' | 'block' | 'browser';
3547
3712
 
3548
3713
  /**
@@ -3613,6 +3778,218 @@ declare type ContentCreationRulesEvent = NamedEvent & {
3613
3778
  disposition: string;
3614
3779
  };
3615
3780
 
3781
+ declare interface ContentItem extends EventEmitter_2 {
3782
+ instance: any;
3783
+ header: any;
3784
+ _splitter: any;
3785
+ /**
3786
+ * This items configuration in its current state
3787
+ */
3788
+ config: ItemConfigType;
3789
+
3790
+ /**
3791
+ * The type of the item. Can be row, column, stack, component or root
3792
+ */
3793
+ type: ItemType;
3794
+
3795
+ /**
3796
+ * An array of items that are children of this item
3797
+ */
3798
+ contentItems: ContentItem[];
3799
+
3800
+ container: Container;
3801
+ /**
3802
+ * The item that is this item's parent (or null if the item is root)
3803
+ */
3804
+ parent: ContentItem;
3805
+
3806
+ /**
3807
+ * A String or array of identifiers if provided in the configuration
3808
+ */
3809
+ id: string;
3810
+
3811
+ /**
3812
+ * True if the item had been initialised
3813
+ */
3814
+ isInitialised: boolean;
3815
+
3816
+ /**
3817
+ * True if the item is maximised
3818
+ */
3819
+ isMaximised: boolean;
3820
+
3821
+ /**
3822
+ * True if the item is the layout's root item
3823
+ */
3824
+ isRoot: boolean;
3825
+
3826
+ /**
3827
+ * True if the item is a row
3828
+ */
3829
+ isRow: boolean;
3830
+
3831
+ /**
3832
+ * True if the item is a column
3833
+ */
3834
+ isColumn: boolean;
3835
+
3836
+ /**
3837
+ * True if the item is a stack
3838
+ */
3839
+ isStack: boolean;
3840
+
3841
+ /**
3842
+ * True if the item is a component
3843
+ */
3844
+ isComponent: boolean;
3845
+
3846
+ /**
3847
+ * A reference to the layoutManager that controls this item
3848
+ */
3849
+ layoutManager: any;
3850
+
3851
+ /**
3852
+ * The item's outer element
3853
+ */
3854
+ element: JQuery;
3855
+
3856
+ /**
3857
+ * The item's inner element. Can be the same as the outer element.
3858
+ */
3859
+ childElementContainer: Container;
3860
+
3861
+ /**
3862
+ * Adds an item as a child to this item. If the item is already a part of a layout it will be removed
3863
+ * from its original position before adding it to this item.
3864
+ * @param itemOrItemConfig A content item (or tree of content items) or an ItemConfiguration to create the item from
3865
+ * @param index last index An optional index that determines at which position the new item should be added. Default: last index.
3866
+ */
3867
+ addChild(itemOrItemConfig: ContentItem | ItemConfigType, index?: number): void;
3868
+
3869
+ /**
3870
+ * Destroys the item and all it's children
3871
+ * @param contentItem The contentItem that should be removed
3872
+ * @param keepChild If true the item won't be destroyed. (Use cautiosly, if the item isn't destroyed it's up to you to destroy it later). Default: false.
3873
+ */
3874
+ removeChild(contentItem: ContentItem, keepChild?: boolean): void;
3875
+
3876
+ /**
3877
+ * The contentItem that should be removed
3878
+ * @param oldChild ContentItem The contentItem that should be removed
3879
+ * @param newChild A content item (or tree of content items) or an ItemConfiguration to create the item from
3880
+ */
3881
+ replaceChild(oldChild: ContentItem, newChild: ContentItem | ItemConfigType): void;
3882
+
3883
+ /**
3884
+ * Updates the items size. To actually assign a new size from within a component, use container.setSize( width, height )
3885
+ */
3886
+ setSize(): void;
3887
+
3888
+ /**
3889
+ * Sets the item's title to the provided value. Triggers titleChanged and stateChanged events
3890
+ * @param title the new title
3891
+ */
3892
+ setTitle(title: string): void;
3893
+
3894
+ /**
3895
+ * A powerful, yet admittedly confusing method to recursively call methods on items in a tree. Usually you wouldn't need
3896
+ * to use it directly, but it's used internally to setSizes, destroy parts of the item tree etc.
3897
+ * @param functionName The name of the method to invoke
3898
+ * @param functionArguments An array of arguments to pass to every function
3899
+ * @param bottomUp If true, the method is invoked on the lowest parts of the tree first and then bubbles upwards. Default: false
3900
+ * @param skipSelf If true, the method will only be invoked on the item's children, but not on the item itself. Default: false
3901
+ */
3902
+ callDownwards(functionName: string, functionArguments?: any[], bottomUp?: boolean, skipSelf?: boolean): void;
3903
+
3904
+ /**
3905
+ * Emits an event that bubbles up the item tree until it reaches the root element (and after a delay the layout manager). Useful e.g. for indicating state changes.
3906
+ */
3907
+ emitBubblingEvent(name: string): void;
3908
+
3909
+ /**
3910
+ * Convenience method for item.parent.removeChild( item )
3911
+ */
3912
+ remove(): void;
3913
+
3914
+ /**
3915
+ * Removes the item from its current position in the layout and opens it in a window
3916
+ */
3917
+ popout(): BrowserWindow;
3918
+
3919
+ /**
3920
+ * Maximises the item or minimises it if it's already maximised
3921
+ */
3922
+ toggleMaximise(): void;
3923
+
3924
+ /**
3925
+ * Selects the item. Only relevant if settings.selectionEnabled is set to true
3926
+ */
3927
+ select(): void;
3928
+
3929
+ /**
3930
+ * Unselects the item. Only relevant if settings.selectionEnabled is set to true
3931
+ */
3932
+ deselect(): void;
3933
+
3934
+ /**
3935
+ * Returns true if the item has the specified id or false if not
3936
+ * @param id An id to check for
3937
+ */
3938
+ hasId(id: string): boolean;
3939
+
3940
+ /**
3941
+ * Only Stacks have this method! It's the programmatical equivalent of clicking a tab.
3942
+ * @param contentItem The new active content item
3943
+ * @param preventFocus [OpenFin Custom] Indicates to openfin that the view should not be focused when activated.
3944
+ */
3945
+ // (CORE-198)[../docs/golden-layout-changelog.md#CORE-198 stack.setActiveView]
3946
+ setActiveContentItem(contentItem: ContentItem, preventFocus?: boolean): void;
3947
+
3948
+ /**
3949
+ * Only Stacks have this method! Returns the currently selected contentItem.
3950
+ */
3951
+ getActiveContentItem(): ContentItem;
3952
+
3953
+ /**
3954
+ * Adds an id to an item or does nothing if the id is already present
3955
+ * @param id The id to be added
3956
+ */
3957
+ addId(id: string): void;
3958
+
3959
+ /**
3960
+ * Removes an id from an item or throws an error if the id couldn't be found
3961
+ * @param id The id to be removed
3962
+ */
3963
+ removeId(id: string): void;
3964
+
3965
+ /**
3966
+ * Calls filterFunction recursively for every item in the tree. If the function returns true the item is added to the resulting array
3967
+ * @param filterFunction A function that determines whether an item matches certain criteria
3968
+ */
3969
+ getItemsByFilter(filterFunction: (contentItem: ContentItem) => boolean): ContentItem[];
3970
+
3971
+ /**
3972
+ * Returns all items with the specified id.
3973
+ * @param id An id specified in the itemConfig
3974
+ */
3975
+ getItemsById(id: string | string[]): ContentItem[];
3976
+
3977
+ /**
3978
+ * Returns all items with the specified type
3979
+ * @param type 'row', 'column', 'stack', 'component' or 'root'
3980
+ */
3981
+ getItemsByType(type: string): ContentItem[];
3982
+
3983
+ /**
3984
+ * Returns all instances of the component with the specified componentName
3985
+ * @param componentName a componentName as specified in the itemConfig
3986
+ */
3987
+ getComponentsByName(componentName: string): any;
3988
+
3989
+ _contentAreaDimensions: any;
3990
+ _$getArea: () => any;
3991
+ }
3992
+
3616
3993
  /**
3617
3994
  * Restrict navigation to URLs that match an allowed pattern.
3618
3995
  * In the lack of an allowlist, navigation to URLs that match a denied pattern would be prohibited.
@@ -3996,6 +4373,46 @@ declare type DidFinishLoadEvent = NamedEvent & {
3996
4373
  type: 'did-finish-load';
3997
4374
  };
3998
4375
 
4376
+ declare interface Dimensions {
4377
+ /**
4378
+ * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider
4379
+ * than the visible one, making it safe to set this to small values without affecting usability.
4380
+ * Default: 5
4381
+ */
4382
+ borderWidth?: number;
4383
+
4384
+ /**
4385
+ * The minimum height an item can be resized to (in pixel).
4386
+ * Default: 10
4387
+ */
4388
+ minItemHeight?: number;
4389
+
4390
+ /**
4391
+ * The minimum width an item can be resized to (in pixel).
4392
+ * Default: 10
4393
+ */
4394
+ minItemWidth?: number;
4395
+
4396
+ /**
4397
+ * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be
4398
+ * adjusted accordingly.
4399
+ * Default: 20
4400
+ */
4401
+ headerHeight?: number;
4402
+
4403
+ /**
4404
+ * The width of the element that appears when an item is dragged (in pixel).
4405
+ * Default: 300
4406
+ */
4407
+ dragProxyWidth?: number;
4408
+
4409
+ /**
4410
+ * The height of the element that appears when an item is dragged (in pixel).
4411
+ * Default: 200
4412
+ */
4413
+ dragProxyHeight?: number;
4414
+ }
4415
+
3999
4416
  /**
4000
4417
  * @interface
4001
4418
  */
@@ -4144,6 +4561,8 @@ declare type Dpi = {
4144
4561
  vertical?: number;
4145
4562
  };
4146
4563
 
4564
+ declare interface DragSource {}
4565
+
4147
4566
  /**
4148
4567
  * Generated when a window has been embedded.
4149
4568
  * @interface
@@ -4371,6 +4790,43 @@ declare class EventAggregator extends EmitterMap {
4371
4790
  dispatchEvent: (message: Message<any>) => boolean;
4372
4791
  }
4373
4792
 
4793
+ declare interface EventEmitter_2 {
4794
+ [x: string]: any;
4795
+ /**
4796
+ * Subscribe to an event
4797
+ * @param eventName The name of the event to describe to
4798
+ * @param callback The function that should be invoked when the event occurs
4799
+ * @param context The value of the this pointer in the callback function
4800
+ */
4801
+ on(eventName: string, callback: Function, context?: any): void;
4802
+
4803
+ /**
4804
+ * Notify listeners of an event and pass arguments along
4805
+ * @param eventName The name of the event to emit
4806
+ */
4807
+ emit(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
4808
+
4809
+ /**
4810
+ * Alias for emit
4811
+ */
4812
+ trigger(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
4813
+
4814
+ /**
4815
+ * Unsubscribes either all listeners if just an eventName is provided, just a specific callback if invoked with
4816
+ * eventName and callback or just a specific callback with a specific context if invoked with all three
4817
+ * arguments.
4818
+ * @param eventName The name of the event to unsubscribe from
4819
+ * @param callback The function that should be invoked when the event occurs
4820
+ * @param context The value of the this pointer in the callback function
4821
+ */
4822
+ unbind(eventName: string, callback?: Function, context?: any): void;
4823
+
4824
+ /**
4825
+ * Alias for unbind
4826
+ */
4827
+ off(eventName: string, callback?: Function, context?: any): void;
4828
+ }
4829
+
4374
4830
  /**
4375
4831
  * Handler for an event on an EventEmitter.
4376
4832
  * @remarks Selects the correct type for the event
@@ -5322,6 +5778,244 @@ declare namespace GlobalHotkeyEvents {
5322
5778
  }
5323
5779
  }
5324
5780
 
5781
+ declare namespace GoldenLayout {
5782
+ export {
5783
+ GoldenLayout_2 as GoldenLayout,
5784
+ ItemConfigType,
5785
+ Settings,
5786
+ Dimensions,
5787
+ Labels,
5788
+ ItemType,
5789
+ ItemConfig,
5790
+ ComponentConfig,
5791
+ ReactComponentConfig,
5792
+ Config,
5793
+ ContentItem,
5794
+ Container,
5795
+ DragSource,
5796
+ BrowserWindow,
5797
+ Header,
5798
+ Tab,
5799
+ EventEmitter_2 as EventEmitter
5800
+ }
5801
+ }
5802
+
5803
+ declare class GoldenLayout_2 implements EventEmitter_2 {
5804
+ /**
5805
+ * The topmost item in the layout item tree. In browser terms: Think of the GoldenLayout instance as window
5806
+ * object and of goldenLayout.root as the document.
5807
+ */
5808
+ root: ContentItem;
5809
+
5810
+ /**
5811
+ * A reference to the (jQuery) DOM element containing the layout
5812
+ */
5813
+ container: JQuery;
5814
+
5815
+ /**
5816
+ * True once the layout item tree has been created and the initialised event has been fired
5817
+ */
5818
+ isInitialised: boolean;
5819
+
5820
+ /**
5821
+ * A reference to the current, extended top level config.
5822
+ *
5823
+ * Don't rely on this object for state saving / serialisation. Use layout.toConfig() instead.
5824
+ */
5825
+ config: Config;
5826
+
5827
+ /**
5828
+ * The currently selected item or null if no item is selected. Only relevant if settings.selectionEnabled is set
5829
+ * to true.
5830
+ */
5831
+ selectedItem: ContentItem;
5832
+
5833
+ /**
5834
+ * The current outer width of the layout in pixels.
5835
+ */
5836
+ width: number;
5837
+
5838
+ /**
5839
+ * The current outer height of the layout in pixels.
5840
+ */
5841
+ height: number;
5842
+
5843
+ /**
5844
+ * An array of BrowserWindow instances
5845
+ */
5846
+ openPopouts: BrowserWindow[];
5847
+
5848
+ /**
5849
+ * True if the layout has been opened as a popout by another layout.
5850
+ */
5851
+ isSubWindow: boolean;
5852
+
5853
+ /**
5854
+ * A singleton instance of EventEmitter that works across windows
5855
+ */
5856
+ eventHub: EventEmitter_2;
5857
+
5858
+ _dragProxy: any;
5859
+
5860
+ dropTargetIndicator: any;
5861
+
5862
+ /**
5863
+ * @param config A GoldenLayout configuration object
5864
+ * @param container The DOM element the layout will be initialised in. Default: document.body
5865
+ */
5866
+ constructor(configuration: Config, container?: Element | HTMLElement | JQuery);
5867
+
5868
+ /*
5869
+ * @param name The name of the component, as referred to by componentName in the component configuration.
5870
+ * @param component A constructor or factory function. Will be invoked with new and two arguments, a
5871
+ * containerobject and a component state
5872
+ */
5873
+ registerComponent(name: String, component: any): void;
5874
+
5875
+ /**
5876
+ * Renders the layout into the container. If init() is called before the document is ready it attaches itself as
5877
+ * a listener to the document and executes once it becomes ready.
5878
+ */
5879
+ init(): void;
5880
+
5881
+ /**
5882
+ * Returns the current state of the layout and its components as a serialisable object.
5883
+ */
5884
+ toConfig(): Config;
5885
+
5886
+ /**
5887
+ * Returns a component that was previously registered with layout.registerComponent().
5888
+ * @param name The name of a previously registered component
5889
+ */
5890
+ getComponent(name: string): any;
5891
+
5892
+ /**
5893
+ * Resizes the layout. If no arguments are provided GoldenLayout measures its container and resizes accordingly.
5894
+ * @param width The outer width the layout should be resized to. Default: The container elements width
5895
+ * @param height The outer height the layout should be resized to. Default: The container elements height
5896
+ */
5897
+ updateSize(width?: number, height?: number): void;
5898
+
5899
+ /**
5900
+ * Destroys the layout. Recursively calls destroy on all components and content items, removes all event
5901
+ * listeners and finally removes itself from the DOM.
5902
+ */
5903
+ destroy(): void;
5904
+
5905
+ /**
5906
+ * Creates a new content item or tree of content items from configuration. Usually you wouldn't call this
5907
+ * directly, but instead use methods like layout.createDragSource(), item.addChild() or item.replaceChild() that
5908
+ * all call this method implicitly.
5909
+ * @param itemConfiguration An item configuration (can be an entire tree of items)
5910
+ * @param parent A parent item
5911
+ */
5912
+ createContentItem(
5913
+ itemConfiguration?: ItemConfigType,
5914
+ parent?: ContentItem
5915
+ ): ContentItem;
5916
+
5917
+ /**
5918
+ * Creates a new popout window with configOrContentItem as contents at the position specified in dimensions
5919
+ * @param configOrContentItem The content item or config that will be created in the new window. If a item is
5920
+ * provided its config will be read, if config is provided, only the content key
5921
+ * will be used
5922
+ * @param dimensions A map containing the keys left, top, width and height. Left and top can be negative to
5923
+ * place the window in another screen.
5924
+ * @param parentId The id of the item within the current layout the child window's content will be appended to
5925
+ * when popIn is clicked
5926
+ * @param indexInParent The index at which the child window's contents will be appended to. Default: null
5927
+ */
5928
+ createPopout(
5929
+ configOrContentItem: ItemConfigType | ContentItem,
5930
+ dimensions: {
5931
+ width: number;
5932
+ height: number;
5933
+ left: number;
5934
+ top: number;
5935
+ },
5936
+ parentId?: string,
5937
+ indexInParent?: number
5938
+ ): void;
5939
+
5940
+ /**
5941
+ * Turns a DOM element into a dragSource, meaning that the user can drag the element directly onto the layout
5942
+ * where it turns into a contentItem.
5943
+ * @param element The DOM element that will be turned into a dragSource
5944
+ * @param itemConfiguration An item configuration (can be an entire tree of items)
5945
+ * @return the dragSource that was created. This can be used to remove the
5946
+ * dragSource from the layout later.
5947
+ */
5948
+ createDragSource(
5949
+ element: HTMLElement | JQuery,
5950
+ itemConfiguration: ItemConfigType
5951
+ ): DragSource;
5952
+
5953
+ /**
5954
+ * Removes a dragSource from the layout.
5955
+ *
5956
+ * @param dragSource The dragSource to remove
5957
+ */
5958
+ removeDragSource(dragSource: DragSource): void;
5959
+
5960
+ /**
5961
+ * If settings.selectionEnabled is set to true, this allows to select items programmatically.
5962
+ * @param contentItem A ContentItem instance
5963
+ */
5964
+ selectItem(contentItem: ContentItem): void;
5965
+
5966
+ /**
5967
+ * Static method on the GoldenLayout constructor! This method will iterate through a GoldenLayout config object
5968
+ * and replace frequent keys and values with single letter substitutes.
5969
+ * @param config A GoldenLayout configuration object
5970
+ */
5971
+ static minifyConfig(config: any): any;
5972
+
5973
+ /**
5974
+ * Static method on the GoldenLayout constructor! This method will reverse the minifications of minifyConfig.
5975
+ * @param minifiedConfig A minified GoldenLayout configuration object
5976
+ */
5977
+ static unminifyConfig(minifiedConfig: any): any;
5978
+
5979
+ /**
5980
+ * Subscribe to an event
5981
+ * @param eventName The name of the event to describe to
5982
+ * @param callback The function that should be invoked when the event occurs
5983
+ * @param context The value of the this pointer in the callback function
5984
+ */
5985
+ on(eventName: string, callback: Function, context?: any): void;
5986
+
5987
+ /**
5988
+ * Notify listeners of an event and pass arguments along
5989
+ * @param eventName The name of the event to emit
5990
+ */
5991
+ emit(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
5992
+
5993
+ /**
5994
+ * Alias for emit
5995
+ */
5996
+ trigger(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
5997
+
5998
+ /**
5999
+ * Unsubscribes either all listeners if just an eventName is provided, just a specific callback if invoked with
6000
+ * eventName and callback or just a specific callback with a specific context if invoked with all three
6001
+ * arguments.
6002
+ * @param eventName The name of the event to unsubscribe from
6003
+ * @param callback The function that should be invoked when the event occurs
6004
+ * @param context The value of the this pointer in the callback function
6005
+ */
6006
+ unbind(eventName: string, callback?: Function, context?: any): void;
6007
+
6008
+ /**
6009
+ * Alias for unbind
6010
+ */
6011
+ off(eventName: string, callback?: Function, context?: any): void;
6012
+
6013
+ /**
6014
+ * Internal method that create drop areas on the far edges of window, e.g. far-right of window
6015
+ */
6016
+ _$createRootItemAreas(): void;
6017
+ }
6018
+
5325
6019
  /**
5326
6020
  * @interface
5327
6021
  */
@@ -5329,6 +6023,62 @@ declare type GpuInfo = {
5329
6023
  name: string;
5330
6024
  };
5331
6025
 
6026
+ declare interface Header {
6027
+ /**
6028
+ * A reference to the LayoutManager instance
6029
+ */
6030
+ layoutManager: GoldenLayout_2;
6031
+
6032
+ /**
6033
+ * A reference to the Stack this Header belongs to
6034
+ */
6035
+ parent: ContentItem;
6036
+
6037
+ /**
6038
+ * An array of the Tabs within this header
6039
+ */
6040
+ tabs: Tab[];
6041
+
6042
+ /**
6043
+ * The currently selected activeContentItem
6044
+ */
6045
+ activeContentItem: ContentItem;
6046
+
6047
+ /**
6048
+ * The outer (jQuery) DOM element of this Header
6049
+ */
6050
+ element: JQuery;
6051
+
6052
+ /**
6053
+ * The (jQuery) DOM element containing the tabs
6054
+ */
6055
+ tabsContainer: JQuery;
6056
+
6057
+ /**
6058
+ * The (jQuery) DOM element containing the close, maximise and popout button
6059
+ */
6060
+ controlsContainer: JQuery;
6061
+
6062
+ /**
6063
+ * Hides the currently selected contentItem, shows the specified one and highlights its tab.
6064
+ * @param contentItem The content item that will be selected
6065
+ */
6066
+ setActiveContentItem(contentItem: ContentItem): void;
6067
+
6068
+ /**
6069
+ * Creates a new tab and associates it with a content item
6070
+ * @param contentItem The content item the tab will be associated with
6071
+ * @param index A zero based index, specifying the position of the new tab
6072
+ */
6073
+ createTab(contentItem: ContentItem, index?: number): void;
6074
+
6075
+ /**
6076
+ * Finds a tab by its contentItem and removes it
6077
+ * @param contentItem The content item the tab is associated with
6078
+ */
6079
+ removeTab(contentItem: ContentItem): void;
6080
+ }
6081
+
5332
6082
  /**
5333
6083
  * Generated when a View is hidden.
5334
6084
  * @interface
@@ -5453,7 +6203,8 @@ declare type Identity_5 = {
5453
6203
  declare type IdentityCall<AdditionalPayload = {}, Response = void> = ApiCall<AdditionalPayload & OpenFin_2.Identity, Response>;
5454
6204
 
5455
6205
  /**
5456
- * An Identity event.
6206
+ * An event that contains the `uuid` property of an {@link OpenFin.Identity}.
6207
+ *
5457
6208
  * @interface
5458
6209
  */
5459
6210
  declare type IdentityEvent = BaseEvent & {
@@ -7077,6 +7828,50 @@ declare class InteropModule extends Base {
7077
7828
  connectSync(name: string, interopConfig?: OpenFin_2.InteropConfig): InteropClient;
7078
7829
  }
7079
7830
 
7831
+ declare interface ItemConfig {
7832
+ /**
7833
+ * The type of the item. Possible values are 'row', 'column', 'stack', 'component' and 'react-component'.
7834
+ */
7835
+ type: ItemType;
7836
+
7837
+ /**
7838
+ * An array of configurations for items that will be created as children of this item.
7839
+ */
7840
+ content?: ItemConfigType[];
7841
+
7842
+ /**
7843
+ * The width of this item, relative to the other children of its parent in percent
7844
+ */
7845
+ width?: number;
7846
+
7847
+ /**
7848
+ * The height of this item, relative to the other children of its parent in percent
7849
+ */
7850
+ height?: number;
7851
+
7852
+ /**
7853
+ * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()
7854
+ */
7855
+ id?: string | string[];
7856
+
7857
+ /**
7858
+ * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()
7859
+ * will return false
7860
+ * Default: true
7861
+ */
7862
+ isClosable?: boolean;
7863
+
7864
+ /**
7865
+ * The title of the item as displayed on its tab and on popout windows
7866
+ * Default: componentName or ''
7867
+ */
7868
+ title?: string;
7869
+ }
7870
+
7871
+ declare type ItemConfigType = ItemConfig | ComponentConfig | ReactComponentConfig;
7872
+
7873
+ declare type ItemType = 'row' | 'column' | 'stack' | 'root' | 'component';
7874
+
7080
7875
  /**
7081
7876
  * @interface
7082
7877
  */
@@ -7134,6 +7929,32 @@ declare type JumpListTask = {
7134
7929
  iconIndex?: number;
7135
7930
  };
7136
7931
 
7932
+ declare interface Labels {
7933
+ /**
7934
+ * The tooltip text that appears when hovering over the close icon.
7935
+ * Default: 'close'
7936
+ */
7937
+ close?: string;
7938
+
7939
+ /**
7940
+ * The tooltip text that appears when hovering over the maximise icon.
7941
+ * Default: 'maximise'
7942
+ */
7943
+ maximise?: string;
7944
+
7945
+ /**
7946
+ * The tooltip text that appears when hovering over the minimise icon.
7947
+ * Default: 'minimise'
7948
+ */
7949
+ minimise?: string;
7950
+
7951
+ /**
7952
+ * The tooltip text that appears when hovering over the popout icon.
7953
+ * Default: 'open in new window'
7954
+ */
7955
+ popout?: string;
7956
+ }
7957
+
7137
7958
  /**
7138
7959
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
7139
7960
  *
@@ -7373,6 +8194,16 @@ declare class Layout extends Base {
7373
8194
  * ```
7374
8195
  */
7375
8196
  getConfig(): Promise<any>;
8197
+ /**
8198
+ * Retrieves the attached views in current window layout.
8199
+ *
8200
+ * @example
8201
+ * ```js
8202
+ * const layout = fin.Platform.Layout.getCurrentSync();
8203
+ * const views = await layout.getCurrentViews();
8204
+ * ```
8205
+ */
8206
+ getCurrentViews(): Promise<OpenFin_2.View[]>;
7376
8207
  /**
7377
8208
  * Replaces a Platform window's layout with a new layout.
7378
8209
  *
@@ -7761,6 +8592,7 @@ declare class LayoutManager {
7761
8592
  private setBackgroundImage;
7762
8593
  private setBackgroundImages;
7763
8594
  private getFrameSnapshot;
8595
+ private getCurrentViews;
7764
8596
  private addView;
7765
8597
  private replaceView;
7766
8598
  private removeView;
@@ -8857,7 +9689,7 @@ declare type MutableWindowOptions = {
8857
9689
  declare type NackHandler = (payloadOrMessage: RuntimeErrorPayload | string) => void;
8858
9690
 
8859
9691
  /**
8860
- * A Name event.
9692
+ * An event that contains an entire {@link OpenFin.Identity}.
8861
9693
  * @interface
8862
9694
  */
8863
9695
  declare type NamedEvent = IdentityEvent & {
@@ -8944,6 +9776,10 @@ declare type Opacity = TransitionBase & {
8944
9776
  opacity: number;
8945
9777
  };
8946
9778
 
9779
+ declare type OpenExternalPermission = VerboseWebPermission & {
9780
+ protocols: string[];
9781
+ };
9782
+
8947
9783
  declare namespace OpenFin_2 {
8948
9784
  export {
8949
9785
  FinApi,
@@ -9063,6 +9899,8 @@ declare namespace OpenFin_2 {
9063
9899
  LaunchExternalProcessRule,
9064
9900
  SystemPermissions,
9065
9901
  WebPermission,
9902
+ VerboseWebPermission,
9903
+ OpenExternalPermission,
9066
9904
  Permissions_2 as Permissions,
9067
9905
  PlatformWindowCreationOptions,
9068
9906
  PlatformWindowOptions,
@@ -11546,6 +12384,18 @@ declare type QueryPermissionResult = {
11546
12384
  rawValue?: unknown;
11547
12385
  };
11548
12386
 
12387
+ declare interface ReactComponentConfig extends ItemConfig {
12388
+ /**
12389
+ * The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'
12390
+ */
12391
+ component: string;
12392
+
12393
+ /**
12394
+ * Properties that will be passed to the component and accessible using this.props.
12395
+ */
12396
+ props?: any;
12397
+ }
12398
+
11549
12399
  /**
11550
12400
  * @interface
11551
12401
  */
@@ -12023,6 +12873,97 @@ declare type SessionContextGroup = {
12023
12873
  }>;
12024
12874
  };
12025
12875
 
12876
+ declare interface Settings {
12877
+ preventSplitterResize?: boolean;
12878
+
12879
+ newTabButton?: {
12880
+ url?: string;
12881
+ };
12882
+
12883
+ /**
12884
+ * If true, tabs can't be dragged into the window.
12885
+ * Default: false
12886
+ */
12887
+ preventDragIn?: boolean;
12888
+
12889
+ /**
12890
+ * If true, tabs can't be dragged out of the window.
12891
+ * Default: false
12892
+ */
12893
+ preventDragOut?: boolean;
12894
+
12895
+ /**
12896
+ * If true, stack headers are the only areas where tabs can be dropped.
12897
+ * Default: false
12898
+ */
12899
+ constrainDragToHeaders?: boolean;
12900
+ /**
12901
+ * Turns headers on or off. If false, the layout will be displayed with splitters only.
12902
+ * Default: true
12903
+ */
12904
+ hasHeaders?: boolean;
12905
+
12906
+ /**
12907
+ * (Unused in Openfin Platform) Constrains the area in which items can be dragged to the layout's container. Will be set to false
12908
+ * automatically when layout.createDragSource() is called.
12909
+ * Default: true
12910
+ */
12911
+ constrainDragToContainer?: boolean;
12912
+
12913
+ /**
12914
+ * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.
12915
+ * Default: true
12916
+ */
12917
+ reorderEnabled?: boolean;
12918
+
12919
+ /**
12920
+ * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to
12921
+ * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.
12922
+ * Default: false
12923
+ */
12924
+ selectionEnabled?: boolean;
12925
+
12926
+ /**
12927
+ * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will
12928
+ * be transferred to the new window, if false only the active component will be opened.
12929
+ * Default: false
12930
+ */
12931
+ popoutWholeStack?: boolean;
12932
+
12933
+ /**
12934
+ * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).
12935
+ * If false, the popout call will fail silently.
12936
+ * Default: true
12937
+ */
12938
+ blockedPopoutsThrowError?: boolean;
12939
+
12940
+ /**
12941
+ * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a
12942
+ * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In
12943
+ * addition, any changes made to popouts won't be stored after the parent is closed.
12944
+ * Default: true
12945
+ */
12946
+ closePopoutsOnUnload?: boolean;
12947
+
12948
+ /**
12949
+ * Specifies if the popout icon should be displayed in the header-bar.
12950
+ * Default: true
12951
+ */
12952
+ showPopoutIcon?: boolean;
12953
+
12954
+ /**
12955
+ * Specifies if the maximise icon should be displayed in the header-bar.
12956
+ * Default: true
12957
+ */
12958
+ showMaximiseIcon?: boolean;
12959
+
12960
+ /**
12961
+ * Specifies if the close icon should be displayed in the header-bar.
12962
+ * Default: true
12963
+ */
12964
+ showCloseIcon?: boolean;
12965
+ }
12966
+
12026
12967
  /**
12027
12968
  * @interface
12028
12969
  */
@@ -13868,6 +14809,52 @@ declare type SystemShutdownHandler = (shutdownEvent: {
13868
14809
  proceed: () => void;
13869
14810
  }) => void;
13870
14811
 
14812
+ declare interface Tab {
14813
+ _dragListener: EventEmitter_2;
14814
+
14815
+ /**
14816
+ * True if this tab is the selected tab
14817
+ */
14818
+ isActive: boolean;
14819
+
14820
+ /**
14821
+ * A reference to the header this tab is a child of
14822
+ */
14823
+ header: Header;
14824
+
14825
+ /**
14826
+ * A reference to the content item this tab relates to
14827
+ */
14828
+ contentItem: ContentItem;
14829
+
14830
+ /**
14831
+ * The tabs outer (jQuery) DOM element
14832
+ */
14833
+ element: JQuery;
14834
+
14835
+ /**
14836
+ * The (jQuery) DOM element containing the title
14837
+ */
14838
+ titleElement: JQuery;
14839
+
14840
+ /**
14841
+ * The (jQuery) DOM element that closes the tab
14842
+ */
14843
+ closeElement: JQuery;
14844
+
14845
+ /**
14846
+ * Sets the tab's title. Does not affect the contentItem's title!
14847
+ * @param title The new title
14848
+ */
14849
+ setTitle(title: string): void;
14850
+
14851
+ /**
14852
+ * Sets this tab's active state. To programmatically switch tabs, use header.setActiveContentItem( item ) instead.
14853
+ * @param isActive Whether the tab is active
14854
+ */
14855
+ setActive(isActive: boolean): void;
14856
+ }
14857
+
13871
14858
  /**
13872
14859
  * Set of apis used to facilitate tab drag interactions without needing to hide views.
13873
14860
  * @ignore
@@ -14425,6 +15412,11 @@ declare namespace v2 {
14425
15412
  }
14426
15413
  }
14427
15414
 
15415
+ declare type VerboseWebPermission = {
15416
+ api: string;
15417
+ enabled: boolean;
15418
+ };
15419
+
14428
15420
  declare type View = OpenFin_2.View;
14429
15421
 
14430
15422
  /**
@@ -16308,7 +17300,7 @@ declare namespace WebContentsEvents {
16308
17300
  * `clipboard-read`: Request access to read from the clipboard.<br>
16309
17301
  * `clipboard-sanitized-write`: Request access to write to the clipboard.
16310
17302
  */
16311
- declare type WebPermission = 'audio' | 'video' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'clipboard-read' | 'clipboard-sanitized-write';
17303
+ declare type WebPermission = 'audio' | 'video' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'clipboard-read' | 'clipboard-sanitized-write' | OpenExternalPermission;
16312
17304
 
16313
17305
  /**
16314
17306
  * Object representing headers and their values, where the