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