@openfin/core 34.78.20 → 34.78.21

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.
@@ -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.
@@ -1821,6 +1820,48 @@ declare type BoundsChangingEvent = BoundsChangeEvent & {
1821
1820
  type: 'bounds-changing';
1822
1821
  };
1823
1822
 
1823
+ declare interface BrowserWindow {
1824
+ /**
1825
+ * True if the window has been opened and its GoldenLayout instance initialised.
1826
+ */
1827
+ isInitialised: boolean;
1828
+
1829
+ /**
1830
+ * Creates a window configuration object from the Popout.
1831
+ */
1832
+ toConfig(): {
1833
+ dimensions: {
1834
+ width: number;
1835
+ height: number;
1836
+ left: number;
1837
+ top: number;
1838
+ };
1839
+ content: Config;
1840
+ parentId: string;
1841
+ indexInParent: number;
1842
+ };
1843
+
1844
+ /**
1845
+ * Returns the GoldenLayout instance from the child window
1846
+ */
1847
+ getGlInstance(): GoldenLayout_2;
1848
+
1849
+ /**
1850
+ * Returns the native Window object
1851
+ */
1852
+ getWindow(): Window;
1853
+
1854
+ /**
1855
+ * Closes the popout
1856
+ */
1857
+ close(): void;
1858
+
1859
+ /**
1860
+ * Returns the popout to its original position as specified in parentId and indexInParent
1861
+ */
1862
+ popIn(): void;
1863
+ }
1864
+
1824
1865
  /**
1825
1866
  * Configuration for page capture.
1826
1867
  *
@@ -3159,6 +3200,31 @@ declare class CombinedStrategy<A, B> implements ChannelStrategy<OnlyIfCompatible
3159
3200
  close(): Promise<void>;
3160
3201
  }
3161
3202
 
3203
+ declare interface ComponentConfig extends ItemConfig {
3204
+ /**
3205
+ * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.
3206
+ */
3207
+ componentName: string;
3208
+
3209
+ /**
3210
+ * A serialisable object. Will be passed to the component constructor function and will be the value returned by
3211
+ * container.getState().
3212
+ */
3213
+ componentState?: any;
3214
+ }
3215
+
3216
+ declare interface Config {
3217
+ settings?: Settings;
3218
+ dimensions?: Dimensions;
3219
+ labels?: Labels;
3220
+ content?: ItemConfigType[];
3221
+ /**
3222
+ * (Only on layout config object)
3223
+ * Id of the currently maximised content item
3224
+ */
3225
+ maximisedItemId?: string;
3226
+ }
3227
+
3162
3228
  declare type ConfigWithRuntime = BaseConfig & {
3163
3229
  runtime: RuntimeConfig;
3164
3230
  };
@@ -3449,6 +3515,103 @@ declare type ConstWindowOptions = {
3449
3515
  viewVisibility?: ViewVisibilityOptions;
3450
3516
  };
3451
3517
 
3518
+ declare interface Container extends EventEmitter_2 {
3519
+ /**
3520
+ * The current width of the container in pixel
3521
+ */
3522
+ width: number;
3523
+
3524
+ /**
3525
+ * The current height of the container in pixel
3526
+ */
3527
+ height: number;
3528
+
3529
+ /**
3530
+ * A reference to the component-item that controls this container
3531
+ */
3532
+ parent: ContentItem;
3533
+
3534
+ /**
3535
+ * A reference to the tab that controls this container. Will initially be null
3536
+ * (and populated once a tab event has been fired).
3537
+ */
3538
+ tab: Tab;
3539
+
3540
+ /**
3541
+ * The current title of the container
3542
+ */
3543
+ title: string;
3544
+
3545
+ /*
3546
+ * A reference to the GoldenLayout instance this container belongs to
3547
+ */
3548
+ layoutManager: GoldenLayout_2;
3549
+
3550
+ /**
3551
+ * True if the item is currently hidden
3552
+ */
3553
+ isHidden: boolean;
3554
+
3555
+ /**
3556
+ * Overwrites the components state with the provided value. To only change parts of the componentState see
3557
+ * extendState below. This is the main mechanism for saving the state of a component. This state will be the
3558
+ * value of componentState when layout.toConfig() is called and will be passed back to the component's
3559
+ * constructor function. It will also be used when the component is opened in a new window.
3560
+ * @param state A serialisable object
3561
+ */
3562
+ setState(state: any): void;
3563
+
3564
+ /**
3565
+ * The same as setState but does not emit 'stateChanged' event
3566
+ * @param {serialisable} state
3567
+ */
3568
+ setStateSkipEvent(state: any): void;
3569
+
3570
+ /**
3571
+ * This is similar to setState, but merges the provided state into the current one, rather than overwriting it.
3572
+ * @param state A serialisable object
3573
+ */
3574
+ extendState(state: any): void;
3575
+
3576
+ /**
3577
+ * Returns the current state.
3578
+ */
3579
+ getState(): any;
3580
+
3581
+ /**
3582
+ * Returns the container's inner element as a jQuery element
3583
+ */
3584
+ getElement(): JQuery;
3585
+
3586
+ /**
3587
+ * hides the container or returns false if hiding it is not possible
3588
+ */
3589
+ hide(): boolean;
3590
+
3591
+ /**
3592
+ * shows the container or returns false if showing it is not possible
3593
+ */
3594
+ show(): boolean;
3595
+
3596
+ /**
3597
+ * Sets the container to the specified size or returns false if that's not possible
3598
+ * @param width the new width in pixel
3599
+ * @param height the new height in pixel
3600
+ */
3601
+ setSize(width: number, height: number): boolean;
3602
+
3603
+ /**
3604
+ * Sets the item's title to the provided value. Triggers titleChanged and stateChanged events
3605
+ * @param title the new title
3606
+ */
3607
+ setTitle(title: string): void;
3608
+
3609
+ /**
3610
+ * Closes the container or returns false if that is not possible
3611
+ */
3612
+ close(): boolean;
3613
+ }
3614
+
3452
3615
  declare type ContentCreationBehaviorNames = 'window' | 'view' | 'block' | 'browser';
3453
3616
 
3454
3617
  /**
@@ -3519,6 +3682,218 @@ declare type ContentCreationRulesEvent = NamedEvent & {
3519
3682
  disposition: string;
3520
3683
  };
3521
3684
 
3685
+ declare interface ContentItem extends EventEmitter_2 {
3686
+ instance: any;
3687
+ header: any;
3688
+ _splitter: any;
3689
+ /**
3690
+ * This items configuration in its current state
3691
+ */
3692
+ config: ItemConfigType;
3693
+
3694
+ /**
3695
+ * The type of the item. Can be row, column, stack, component or root
3696
+ */
3697
+ type: ItemType;
3698
+
3699
+ /**
3700
+ * An array of items that are children of this item
3701
+ */
3702
+ contentItems: ContentItem[];
3703
+
3704
+ container: Container;
3705
+ /**
3706
+ * The item that is this item's parent (or null if the item is root)
3707
+ */
3708
+ parent: ContentItem;
3709
+
3710
+ /**
3711
+ * A String or array of identifiers if provided in the configuration
3712
+ */
3713
+ id: string;
3714
+
3715
+ /**
3716
+ * True if the item had been initialised
3717
+ */
3718
+ isInitialised: boolean;
3719
+
3720
+ /**
3721
+ * True if the item is maximised
3722
+ */
3723
+ isMaximised: boolean;
3724
+
3725
+ /**
3726
+ * True if the item is the layout's root item
3727
+ */
3728
+ isRoot: boolean;
3729
+
3730
+ /**
3731
+ * True if the item is a row
3732
+ */
3733
+ isRow: boolean;
3734
+
3735
+ /**
3736
+ * True if the item is a column
3737
+ */
3738
+ isColumn: boolean;
3739
+
3740
+ /**
3741
+ * True if the item is a stack
3742
+ */
3743
+ isStack: boolean;
3744
+
3745
+ /**
3746
+ * True if the item is a component
3747
+ */
3748
+ isComponent: boolean;
3749
+
3750
+ /**
3751
+ * A reference to the layoutManager that controls this item
3752
+ */
3753
+ layoutManager: any;
3754
+
3755
+ /**
3756
+ * The item's outer element
3757
+ */
3758
+ element: JQuery;
3759
+
3760
+ /**
3761
+ * The item's inner element. Can be the same as the outer element.
3762
+ */
3763
+ childElementContainer: Container;
3764
+
3765
+ /**
3766
+ * Adds an item as a child to this item. If the item is already a part of a layout it will be removed
3767
+ * from its original position before adding it to this item.
3768
+ * @param itemOrItemConfig A content item (or tree of content items) or an ItemConfiguration to create the item from
3769
+ * @param index last index An optional index that determines at which position the new item should be added. Default: last index.
3770
+ */
3771
+ addChild(itemOrItemConfig: ContentItem | ItemConfigType, index?: number): void;
3772
+
3773
+ /**
3774
+ * Destroys the item and all it's children
3775
+ * @param contentItem The contentItem that should be removed
3776
+ * @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.
3777
+ */
3778
+ removeChild(contentItem: ContentItem, keepChild?: boolean): void;
3779
+
3780
+ /**
3781
+ * The contentItem that should be removed
3782
+ * @param oldChild ContentItem The contentItem that should be removed
3783
+ * @param newChild A content item (or tree of content items) or an ItemConfiguration to create the item from
3784
+ */
3785
+ replaceChild(oldChild: ContentItem, newChild: ContentItem | ItemConfigType): void;
3786
+
3787
+ /**
3788
+ * Updates the items size. To actually assign a new size from within a component, use container.setSize( width, height )
3789
+ */
3790
+ setSize(): void;
3791
+
3792
+ /**
3793
+ * Sets the item's title to the provided value. Triggers titleChanged and stateChanged events
3794
+ * @param title the new title
3795
+ */
3796
+ setTitle(title: string): void;
3797
+
3798
+ /**
3799
+ * A powerful, yet admittedly confusing method to recursively call methods on items in a tree. Usually you wouldn't need
3800
+ * to use it directly, but it's used internally to setSizes, destroy parts of the item tree etc.
3801
+ * @param functionName The name of the method to invoke
3802
+ * @param functionArguments An array of arguments to pass to every function
3803
+ * @param bottomUp If true, the method is invoked on the lowest parts of the tree first and then bubbles upwards. Default: false
3804
+ * @param skipSelf If true, the method will only be invoked on the item's children, but not on the item itself. Default: false
3805
+ */
3806
+ callDownwards(functionName: string, functionArguments?: any[], bottomUp?: boolean, skipSelf?: boolean): void;
3807
+
3808
+ /**
3809
+ * 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.
3810
+ */
3811
+ emitBubblingEvent(name: string): void;
3812
+
3813
+ /**
3814
+ * Convenience method for item.parent.removeChild( item )
3815
+ */
3816
+ remove(): void;
3817
+
3818
+ /**
3819
+ * Removes the item from its current position in the layout and opens it in a window
3820
+ */
3821
+ popout(): BrowserWindow;
3822
+
3823
+ /**
3824
+ * Maximises the item or minimises it if it's already maximised
3825
+ */
3826
+ toggleMaximise(): void;
3827
+
3828
+ /**
3829
+ * Selects the item. Only relevant if settings.selectionEnabled is set to true
3830
+ */
3831
+ select(): void;
3832
+
3833
+ /**
3834
+ * Unselects the item. Only relevant if settings.selectionEnabled is set to true
3835
+ */
3836
+ deselect(): void;
3837
+
3838
+ /**
3839
+ * Returns true if the item has the specified id or false if not
3840
+ * @param id An id to check for
3841
+ */
3842
+ hasId(id: string): boolean;
3843
+
3844
+ /**
3845
+ * Only Stacks have this method! It's the programmatical equivalent of clicking a tab.
3846
+ * @param contentItem The new active content item
3847
+ * @param preventFocus [OpenFin Custom] Indicates to openfin that the view should not be focused when activated.
3848
+ */
3849
+ // (CORE-198)[../docs/golden-layout-changelog.md#CORE-198 stack.setActiveView]
3850
+ setActiveContentItem(contentItem: ContentItem, preventFocus?: boolean): void;
3851
+
3852
+ /**
3853
+ * Only Stacks have this method! Returns the currently selected contentItem.
3854
+ */
3855
+ getActiveContentItem(): ContentItem;
3856
+
3857
+ /**
3858
+ * Adds an id to an item or does nothing if the id is already present
3859
+ * @param id The id to be added
3860
+ */
3861
+ addId(id: string): void;
3862
+
3863
+ /**
3864
+ * Removes an id from an item or throws an error if the id couldn't be found
3865
+ * @param id The id to be removed
3866
+ */
3867
+ removeId(id: string): void;
3868
+
3869
+ /**
3870
+ * Calls filterFunction recursively for every item in the tree. If the function returns true the item is added to the resulting array
3871
+ * @param filterFunction A function that determines whether an item matches certain criteria
3872
+ */
3873
+ getItemsByFilter(filterFunction: (contentItem: ContentItem) => boolean): ContentItem[];
3874
+
3875
+ /**
3876
+ * Returns all items with the specified id.
3877
+ * @param id An id specified in the itemConfig
3878
+ */
3879
+ getItemsById(id: string | string[]): ContentItem[];
3880
+
3881
+ /**
3882
+ * Returns all items with the specified type
3883
+ * @param type 'row', 'column', 'stack', 'component' or 'root'
3884
+ */
3885
+ getItemsByType(type: string): ContentItem[];
3886
+
3887
+ /**
3888
+ * Returns all instances of the component with the specified componentName
3889
+ * @param componentName a componentName as specified in the itemConfig
3890
+ */
3891
+ getComponentsByName(componentName: string): any;
3892
+
3893
+ _contentAreaDimensions: any;
3894
+ _$getArea: () => any;
3895
+ }
3896
+
3522
3897
  /**
3523
3898
  * Restrict navigation to URLs that match an allowed pattern.
3524
3899
  * In the lack of an allowlist, navigation to URLs that match a denied pattern would be prohibited.
@@ -3902,6 +4277,46 @@ declare type DidFinishLoadEvent = NamedEvent & {
3902
4277
  type: 'did-finish-load';
3903
4278
  };
3904
4279
 
4280
+ declare interface Dimensions {
4281
+ /**
4282
+ * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider
4283
+ * than the visible one, making it safe to set this to small values without affecting usability.
4284
+ * Default: 5
4285
+ */
4286
+ borderWidth?: number;
4287
+
4288
+ /**
4289
+ * The minimum height an item can be resized to (in pixel).
4290
+ * Default: 10
4291
+ */
4292
+ minItemHeight?: number;
4293
+
4294
+ /**
4295
+ * The minimum width an item can be resized to (in pixel).
4296
+ * Default: 10
4297
+ */
4298
+ minItemWidth?: number;
4299
+
4300
+ /**
4301
+ * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be
4302
+ * adjusted accordingly.
4303
+ * Default: 20
4304
+ */
4305
+ headerHeight?: number;
4306
+
4307
+ /**
4308
+ * The width of the element that appears when an item is dragged (in pixel).
4309
+ * Default: 300
4310
+ */
4311
+ dragProxyWidth?: number;
4312
+
4313
+ /**
4314
+ * The height of the element that appears when an item is dragged (in pixel).
4315
+ * Default: 200
4316
+ */
4317
+ dragProxyHeight?: number;
4318
+ }
4319
+
3905
4320
  /**
3906
4321
  * @interface
3907
4322
  */
@@ -4050,6 +4465,8 @@ declare type Dpi = {
4050
4465
  vertical?: number;
4051
4466
  };
4052
4467
 
4468
+ declare interface DragSource {}
4469
+
4053
4470
  /**
4054
4471
  * Generated when a window has been embedded.
4055
4472
  * @interface
@@ -4272,6 +4689,43 @@ declare class EventAggregator extends EmitterMap {
4272
4689
  dispatchEvent: (message: Message<any>) => boolean;
4273
4690
  }
4274
4691
 
4692
+ declare interface EventEmitter_2 {
4693
+ [x: string]: any;
4694
+ /**
4695
+ * Subscribe to an event
4696
+ * @param eventName The name of the event to describe to
4697
+ * @param callback The function that should be invoked when the event occurs
4698
+ * @param context The value of the this pointer in the callback function
4699
+ */
4700
+ on(eventName: string, callback: Function, context?: any): void;
4701
+
4702
+ /**
4703
+ * Notify listeners of an event and pass arguments along
4704
+ * @param eventName The name of the event to emit
4705
+ */
4706
+ emit(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
4707
+
4708
+ /**
4709
+ * Alias for emit
4710
+ */
4711
+ trigger(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
4712
+
4713
+ /**
4714
+ * Unsubscribes either all listeners if just an eventName is provided, just a specific callback if invoked with
4715
+ * eventName and callback or just a specific callback with a specific context if invoked with all three
4716
+ * arguments.
4717
+ * @param eventName The name of the event to unsubscribe from
4718
+ * @param callback The function that should be invoked when the event occurs
4719
+ * @param context The value of the this pointer in the callback function
4720
+ */
4721
+ unbind(eventName: string, callback?: Function, context?: any): void;
4722
+
4723
+ /**
4724
+ * Alias for unbind
4725
+ */
4726
+ off(eventName: string, callback?: Function, context?: any): void;
4727
+ }
4728
+
4275
4729
  /**
4276
4730
  * Handler for an event on an EventEmitter.
4277
4731
  * @remarks Selects the correct type for the event
@@ -5198,6 +5652,244 @@ declare namespace GlobalHotkeyEvents {
5198
5652
  }
5199
5653
  }
5200
5654
 
5655
+ declare namespace GoldenLayout {
5656
+ export {
5657
+ GoldenLayout_2 as GoldenLayout,
5658
+ ItemConfigType,
5659
+ Settings,
5660
+ Dimensions,
5661
+ Labels,
5662
+ ItemType,
5663
+ ItemConfig,
5664
+ ComponentConfig,
5665
+ ReactComponentConfig,
5666
+ Config,
5667
+ ContentItem,
5668
+ Container,
5669
+ DragSource,
5670
+ BrowserWindow,
5671
+ Header,
5672
+ Tab,
5673
+ EventEmitter_2 as EventEmitter
5674
+ }
5675
+ }
5676
+
5677
+ declare class GoldenLayout_2 implements EventEmitter_2 {
5678
+ /**
5679
+ * The topmost item in the layout item tree. In browser terms: Think of the GoldenLayout instance as window
5680
+ * object and of goldenLayout.root as the document.
5681
+ */
5682
+ root: ContentItem;
5683
+
5684
+ /**
5685
+ * A reference to the (jQuery) DOM element containing the layout
5686
+ */
5687
+ container: JQuery;
5688
+
5689
+ /**
5690
+ * True once the layout item tree has been created and the initialised event has been fired
5691
+ */
5692
+ isInitialised: boolean;
5693
+
5694
+ /**
5695
+ * A reference to the current, extended top level config.
5696
+ *
5697
+ * Don't rely on this object for state saving / serialisation. Use layout.toConfig() instead.
5698
+ */
5699
+ config: Config;
5700
+
5701
+ /**
5702
+ * The currently selected item or null if no item is selected. Only relevant if settings.selectionEnabled is set
5703
+ * to true.
5704
+ */
5705
+ selectedItem: ContentItem;
5706
+
5707
+ /**
5708
+ * The current outer width of the layout in pixels.
5709
+ */
5710
+ width: number;
5711
+
5712
+ /**
5713
+ * The current outer height of the layout in pixels.
5714
+ */
5715
+ height: number;
5716
+
5717
+ /**
5718
+ * An array of BrowserWindow instances
5719
+ */
5720
+ openPopouts: BrowserWindow[];
5721
+
5722
+ /**
5723
+ * True if the layout has been opened as a popout by another layout.
5724
+ */
5725
+ isSubWindow: boolean;
5726
+
5727
+ /**
5728
+ * A singleton instance of EventEmitter that works across windows
5729
+ */
5730
+ eventHub: EventEmitter_2;
5731
+
5732
+ _dragProxy: any;
5733
+
5734
+ dropTargetIndicator: any;
5735
+
5736
+ /**
5737
+ * @param config A GoldenLayout configuration object
5738
+ * @param container The DOM element the layout will be initialised in. Default: document.body
5739
+ */
5740
+ constructor(configuration: Config, container?: Element | HTMLElement | JQuery);
5741
+
5742
+ /*
5743
+ * @param name The name of the component, as referred to by componentName in the component configuration.
5744
+ * @param component A constructor or factory function. Will be invoked with new and two arguments, a
5745
+ * containerobject and a component state
5746
+ */
5747
+ registerComponent(name: String, component: any): void;
5748
+
5749
+ /**
5750
+ * Renders the layout into the container. If init() is called before the document is ready it attaches itself as
5751
+ * a listener to the document and executes once it becomes ready.
5752
+ */
5753
+ init(): void;
5754
+
5755
+ /**
5756
+ * Returns the current state of the layout and its components as a serialisable object.
5757
+ */
5758
+ toConfig(): Config;
5759
+
5760
+ /**
5761
+ * Returns a component that was previously registered with layout.registerComponent().
5762
+ * @param name The name of a previously registered component
5763
+ */
5764
+ getComponent(name: string): any;
5765
+
5766
+ /**
5767
+ * Resizes the layout. If no arguments are provided GoldenLayout measures its container and resizes accordingly.
5768
+ * @param width The outer width the layout should be resized to. Default: The container elements width
5769
+ * @param height The outer height the layout should be resized to. Default: The container elements height
5770
+ */
5771
+ updateSize(width?: number, height?: number): void;
5772
+
5773
+ /**
5774
+ * Destroys the layout. Recursively calls destroy on all components and content items, removes all event
5775
+ * listeners and finally removes itself from the DOM.
5776
+ */
5777
+ destroy(): void;
5778
+
5779
+ /**
5780
+ * Creates a new content item or tree of content items from configuration. Usually you wouldn't call this
5781
+ * directly, but instead use methods like layout.createDragSource(), item.addChild() or item.replaceChild() that
5782
+ * all call this method implicitly.
5783
+ * @param itemConfiguration An item configuration (can be an entire tree of items)
5784
+ * @param parent A parent item
5785
+ */
5786
+ createContentItem(
5787
+ itemConfiguration?: ItemConfigType,
5788
+ parent?: ContentItem
5789
+ ): ContentItem;
5790
+
5791
+ /**
5792
+ * Creates a new popout window with configOrContentItem as contents at the position specified in dimensions
5793
+ * @param configOrContentItem The content item or config that will be created in the new window. If a item is
5794
+ * provided its config will be read, if config is provided, only the content key
5795
+ * will be used
5796
+ * @param dimensions A map containing the keys left, top, width and height. Left and top can be negative to
5797
+ * place the window in another screen.
5798
+ * @param parentId The id of the item within the current layout the child window's content will be appended to
5799
+ * when popIn is clicked
5800
+ * @param indexInParent The index at which the child window's contents will be appended to. Default: null
5801
+ */
5802
+ createPopout(
5803
+ configOrContentItem: ItemConfigType | ContentItem,
5804
+ dimensions: {
5805
+ width: number;
5806
+ height: number;
5807
+ left: number;
5808
+ top: number;
5809
+ },
5810
+ parentId?: string,
5811
+ indexInParent?: number
5812
+ ): void;
5813
+
5814
+ /**
5815
+ * Turns a DOM element into a dragSource, meaning that the user can drag the element directly onto the layout
5816
+ * where it turns into a contentItem.
5817
+ * @param element The DOM element that will be turned into a dragSource
5818
+ * @param itemConfiguration An item configuration (can be an entire tree of items)
5819
+ * @return the dragSource that was created. This can be used to remove the
5820
+ * dragSource from the layout later.
5821
+ */
5822
+ createDragSource(
5823
+ element: HTMLElement | JQuery,
5824
+ itemConfiguration: ItemConfigType
5825
+ ): DragSource;
5826
+
5827
+ /**
5828
+ * Removes a dragSource from the layout.
5829
+ *
5830
+ * @param dragSource The dragSource to remove
5831
+ */
5832
+ removeDragSource(dragSource: DragSource): void;
5833
+
5834
+ /**
5835
+ * If settings.selectionEnabled is set to true, this allows to select items programmatically.
5836
+ * @param contentItem A ContentItem instance
5837
+ */
5838
+ selectItem(contentItem: ContentItem): void;
5839
+
5840
+ /**
5841
+ * Static method on the GoldenLayout constructor! This method will iterate through a GoldenLayout config object
5842
+ * and replace frequent keys and values with single letter substitutes.
5843
+ * @param config A GoldenLayout configuration object
5844
+ */
5845
+ static minifyConfig(config: any): any;
5846
+
5847
+ /**
5848
+ * Static method on the GoldenLayout constructor! This method will reverse the minifications of minifyConfig.
5849
+ * @param minifiedConfig A minified GoldenLayout configuration object
5850
+ */
5851
+ static unminifyConfig(minifiedConfig: any): any;
5852
+
5853
+ /**
5854
+ * Subscribe to an event
5855
+ * @param eventName The name of the event to describe to
5856
+ * @param callback The function that should be invoked when the event occurs
5857
+ * @param context The value of the this pointer in the callback function
5858
+ */
5859
+ on(eventName: string, callback: Function, context?: any): void;
5860
+
5861
+ /**
5862
+ * Notify listeners of an event and pass arguments along
5863
+ * @param eventName The name of the event to emit
5864
+ */
5865
+ emit(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
5866
+
5867
+ /**
5868
+ * Alias for emit
5869
+ */
5870
+ trigger(eventName: string, arg1?: any, arg2?: any, ...argN: any[]): void;
5871
+
5872
+ /**
5873
+ * Unsubscribes either all listeners if just an eventName is provided, just a specific callback if invoked with
5874
+ * eventName and callback or just a specific callback with a specific context if invoked with all three
5875
+ * arguments.
5876
+ * @param eventName The name of the event to unsubscribe from
5877
+ * @param callback The function that should be invoked when the event occurs
5878
+ * @param context The value of the this pointer in the callback function
5879
+ */
5880
+ unbind(eventName: string, callback?: Function, context?: any): void;
5881
+
5882
+ /**
5883
+ * Alias for unbind
5884
+ */
5885
+ off(eventName: string, callback?: Function, context?: any): void;
5886
+
5887
+ /**
5888
+ * Internal method that create drop areas on the far edges of window, e.g. far-right of window
5889
+ */
5890
+ _$createRootItemAreas(): void;
5891
+ }
5892
+
5201
5893
  /**
5202
5894
  * @interface
5203
5895
  */
@@ -5205,6 +5897,62 @@ declare type GpuInfo = {
5205
5897
  name: string;
5206
5898
  };
5207
5899
 
5900
+ declare interface Header {
5901
+ /**
5902
+ * A reference to the LayoutManager instance
5903
+ */
5904
+ layoutManager: GoldenLayout_2;
5905
+
5906
+ /**
5907
+ * A reference to the Stack this Header belongs to
5908
+ */
5909
+ parent: ContentItem;
5910
+
5911
+ /**
5912
+ * An array of the Tabs within this header
5913
+ */
5914
+ tabs: Tab[];
5915
+
5916
+ /**
5917
+ * The currently selected activeContentItem
5918
+ */
5919
+ activeContentItem: ContentItem;
5920
+
5921
+ /**
5922
+ * The outer (jQuery) DOM element of this Header
5923
+ */
5924
+ element: JQuery;
5925
+
5926
+ /**
5927
+ * The (jQuery) DOM element containing the tabs
5928
+ */
5929
+ tabsContainer: JQuery;
5930
+
5931
+ /**
5932
+ * The (jQuery) DOM element containing the close, maximise and popout button
5933
+ */
5934
+ controlsContainer: JQuery;
5935
+
5936
+ /**
5937
+ * Hides the currently selected contentItem, shows the specified one and highlights its tab.
5938
+ * @param contentItem The content item that will be selected
5939
+ */
5940
+ setActiveContentItem(contentItem: ContentItem): void;
5941
+
5942
+ /**
5943
+ * Creates a new tab and associates it with a content item
5944
+ * @param contentItem The content item the tab will be associated with
5945
+ * @param index A zero based index, specifying the position of the new tab
5946
+ */
5947
+ createTab(contentItem: ContentItem, index?: number): void;
5948
+
5949
+ /**
5950
+ * Finds a tab by its contentItem and removes it
5951
+ * @param contentItem The content item the tab is associated with
5952
+ */
5953
+ removeTab(contentItem: ContentItem): void;
5954
+ }
5955
+
5208
5956
  /**
5209
5957
  * Generated when a View is hidden.
5210
5958
  * @interface
@@ -6932,6 +7680,50 @@ declare class InteropModule extends Base {
6932
7680
  connectSync(name: string, interopConfig?: OpenFin_2.InteropConfig): InteropClient;
6933
7681
  }
6934
7682
 
7683
+ declare interface ItemConfig {
7684
+ /**
7685
+ * The type of the item. Possible values are 'row', 'column', 'stack', 'component' and 'react-component'.
7686
+ */
7687
+ type: ItemType;
7688
+
7689
+ /**
7690
+ * An array of configurations for items that will be created as children of this item.
7691
+ */
7692
+ content?: ItemConfigType[];
7693
+
7694
+ /**
7695
+ * The width of this item, relative to the other children of its parent in percent
7696
+ */
7697
+ width?: number;
7698
+
7699
+ /**
7700
+ * The height of this item, relative to the other children of its parent in percent
7701
+ */
7702
+ height?: number;
7703
+
7704
+ /**
7705
+ * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()
7706
+ */
7707
+ id?: string | string[];
7708
+
7709
+ /**
7710
+ * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()
7711
+ * will return false
7712
+ * Default: true
7713
+ */
7714
+ isClosable?: boolean;
7715
+
7716
+ /**
7717
+ * The title of the item as displayed on its tab and on popout windows
7718
+ * Default: componentName or ''
7719
+ */
7720
+ title?: string;
7721
+ }
7722
+
7723
+ declare type ItemConfigType = ItemConfig | ComponentConfig | ReactComponentConfig;
7724
+
7725
+ declare type ItemType = 'row' | 'column' | 'stack' | 'root' | 'component';
7726
+
6935
7727
  /**
6936
7728
  * @interface
6937
7729
  */
@@ -6989,6 +7781,32 @@ declare type JumpListTask = {
6989
7781
  iconIndex?: number;
6990
7782
  };
6991
7783
 
7784
+ declare interface Labels {
7785
+ /**
7786
+ * The tooltip text that appears when hovering over the close icon.
7787
+ * Default: 'close'
7788
+ */
7789
+ close?: string;
7790
+
7791
+ /**
7792
+ * The tooltip text that appears when hovering over the maximise icon.
7793
+ * Default: 'maximise'
7794
+ */
7795
+ maximise?: string;
7796
+
7797
+ /**
7798
+ * The tooltip text that appears when hovering over the minimise icon.
7799
+ * Default: 'minimise'
7800
+ */
7801
+ minimise?: string;
7802
+
7803
+ /**
7804
+ * The tooltip text that appears when hovering over the popout icon.
7805
+ * Default: 'open in new window'
7806
+ */
7807
+ popout?: string;
7808
+ }
7809
+
6992
7810
  /**
6993
7811
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
6994
7812
  *
@@ -7222,6 +8040,16 @@ declare class Layout extends Base {
7222
8040
  * ```
7223
8041
  */
7224
8042
  getConfig(): Promise<any>;
8043
+ /**
8044
+ * Retrieves the attached views in current window layout.
8045
+ *
8046
+ * @example
8047
+ * ```js
8048
+ * const layout = fin.Platform.Layout.getCurrentSync();
8049
+ * const views = await layout.getCurrentViews();
8050
+ * ```
8051
+ */
8052
+ getCurrentViews(): Promise<OpenFin_2.View[]>;
7225
8053
  /**
7226
8054
  * Replaces a Platform window's layout with a new layout.
7227
8055
  *
@@ -7492,6 +8320,7 @@ declare class LayoutManager {
7492
8320
  private setBackgroundImage;
7493
8321
  private setBackgroundImages;
7494
8322
  private getFrameSnapshot;
8323
+ private getCurrentViews;
7495
8324
  private addView;
7496
8325
  private replaceView;
7497
8326
  private removeView;
@@ -8507,6 +9336,10 @@ declare type Opacity = TransitionBase & {
8507
9336
  opacity: number;
8508
9337
  };
8509
9338
 
9339
+ declare type OpenExternalPermission = VerboseWebPermission & {
9340
+ protocols: string[];
9341
+ };
9342
+
8510
9343
  declare namespace OpenFin_2 {
8511
9344
  export {
8512
9345
  FinApi,
@@ -8626,6 +9459,8 @@ declare namespace OpenFin_2 {
8626
9459
  LaunchExternalProcessRule,
8627
9460
  SystemPermissions,
8628
9461
  WebPermission,
9462
+ VerboseWebPermission,
9463
+ OpenExternalPermission,
8629
9464
  Permissions_2 as Permissions,
8630
9465
  PlatformWindowCreationOptions,
8631
9466
  PlatformWindowOptions,
@@ -11040,6 +11875,18 @@ declare type QueryPermissionResult = {
11040
11875
  rawValue?: unknown;
11041
11876
  };
11042
11877
 
11878
+ declare interface ReactComponentConfig extends ItemConfig {
11879
+ /**
11880
+ * The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'
11881
+ */
11882
+ component: string;
11883
+
11884
+ /**
11885
+ * Properties that will be passed to the component and accessible using this.props.
11886
+ */
11887
+ props?: any;
11888
+ }
11889
+
11043
11890
  /**
11044
11891
  * @interface
11045
11892
  */
@@ -11517,6 +12364,97 @@ declare type SessionContextGroup = {
11517
12364
  }>;
11518
12365
  };
11519
12366
 
12367
+ declare interface Settings {
12368
+ preventSplitterResize?: boolean;
12369
+
12370
+ newTabButton?: {
12371
+ url?: string;
12372
+ };
12373
+
12374
+ /**
12375
+ * If true, tabs can't be dragged into the window.
12376
+ * Default: false
12377
+ */
12378
+ preventDragIn?: boolean;
12379
+
12380
+ /**
12381
+ * If true, tabs can't be dragged out of the window.
12382
+ * Default: false
12383
+ */
12384
+ preventDragOut?: boolean;
12385
+
12386
+ /**
12387
+ * If true, stack headers are the only areas where tabs can be dropped.
12388
+ * Default: false
12389
+ */
12390
+ constrainDragToHeaders?: boolean;
12391
+ /**
12392
+ * Turns headers on or off. If false, the layout will be displayed with splitters only.
12393
+ * Default: true
12394
+ */
12395
+ hasHeaders?: boolean;
12396
+
12397
+ /**
12398
+ * (Unused in Openfin Platform) Constrains the area in which items can be dragged to the layout's container. Will be set to false
12399
+ * automatically when layout.createDragSource() is called.
12400
+ * Default: true
12401
+ */
12402
+ constrainDragToContainer?: boolean;
12403
+
12404
+ /**
12405
+ * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.
12406
+ * Default: true
12407
+ */
12408
+ reorderEnabled?: boolean;
12409
+
12410
+ /**
12411
+ * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to
12412
+ * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.
12413
+ * Default: false
12414
+ */
12415
+ selectionEnabled?: boolean;
12416
+
12417
+ /**
12418
+ * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will
12419
+ * be transferred to the new window, if false only the active component will be opened.
12420
+ * Default: false
12421
+ */
12422
+ popoutWholeStack?: boolean;
12423
+
12424
+ /**
12425
+ * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).
12426
+ * If false, the popout call will fail silently.
12427
+ * Default: true
12428
+ */
12429
+ blockedPopoutsThrowError?: boolean;
12430
+
12431
+ /**
12432
+ * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a
12433
+ * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In
12434
+ * addition, any changes made to popouts won't be stored after the parent is closed.
12435
+ * Default: true
12436
+ */
12437
+ closePopoutsOnUnload?: boolean;
12438
+
12439
+ /**
12440
+ * Specifies if the popout icon should be displayed in the header-bar.
12441
+ * Default: true
12442
+ */
12443
+ showPopoutIcon?: boolean;
12444
+
12445
+ /**
12446
+ * Specifies if the maximise icon should be displayed in the header-bar.
12447
+ * Default: true
12448
+ */
12449
+ showMaximiseIcon?: boolean;
12450
+
12451
+ /**
12452
+ * Specifies if the close icon should be displayed in the header-bar.
12453
+ * Default: true
12454
+ */
12455
+ showCloseIcon?: boolean;
12456
+ }
12457
+
11520
12458
  /**
11521
12459
  * @interface
11522
12460
  */
@@ -13350,6 +14288,52 @@ declare type SystemShutdownHandler = (shutdownEvent: {
13350
14288
  proceed: () => void;
13351
14289
  }) => void;
13352
14290
 
14291
+ declare interface Tab {
14292
+ _dragListener: EventEmitter_2;
14293
+
14294
+ /**
14295
+ * True if this tab is the selected tab
14296
+ */
14297
+ isActive: boolean;
14298
+
14299
+ /**
14300
+ * A reference to the header this tab is a child of
14301
+ */
14302
+ header: Header;
14303
+
14304
+ /**
14305
+ * A reference to the content item this tab relates to
14306
+ */
14307
+ contentItem: ContentItem;
14308
+
14309
+ /**
14310
+ * The tabs outer (jQuery) DOM element
14311
+ */
14312
+ element: JQuery;
14313
+
14314
+ /**
14315
+ * The (jQuery) DOM element containing the title
14316
+ */
14317
+ titleElement: JQuery;
14318
+
14319
+ /**
14320
+ * The (jQuery) DOM element that closes the tab
14321
+ */
14322
+ closeElement: JQuery;
14323
+
14324
+ /**
14325
+ * Sets the tab's title. Does not affect the contentItem's title!
14326
+ * @param title The new title
14327
+ */
14328
+ setTitle(title: string): void;
14329
+
14330
+ /**
14331
+ * Sets this tab's active state. To programmatically switch tabs, use header.setActiveContentItem( item ) instead.
14332
+ * @param isActive Whether the tab is active
14333
+ */
14334
+ setActive(isActive: boolean): void;
14335
+ }
14336
+
13353
14337
  /**
13354
14338
  * Set of apis used to facilitate tab drag interactions without needing to hide views.
13355
14339
  * @ignore
@@ -13856,6 +14840,11 @@ declare namespace v2 {
13856
14840
  }
13857
14841
  }
13858
14842
 
14843
+ declare type VerboseWebPermission = {
14844
+ api: string;
14845
+ enabled: boolean;
14846
+ };
14847
+
13859
14848
  declare type View = OpenFin_2.View;
13860
14849
 
13861
14850
  /**
@@ -15702,7 +16691,7 @@ declare namespace WebContentsEvents {
15702
16691
  * `clipboard-read`: Request access to read from the clipboard.<br>
15703
16692
  * `clipboard-sanitized-write`: Request access to write to the clipboard.
15704
16693
  */
15705
- declare type WebPermission = 'audio' | 'video' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'clipboard-read' | 'clipboard-sanitized-write';
16694
+ declare type WebPermission = 'audio' | 'video' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'clipboard-read' | 'clipboard-sanitized-write' | OpenExternalPermission;
15706
16695
 
15707
16696
  /**
15708
16697
  * Object representing headers and their values, where the