import type * as OpenFin from '../../OpenFin';
import { EmitterBase } from '../base';
type View = OpenFin.View;
type Channel = OpenFin.Fin['InterApplicationBus']['Channel'];
type ChannelClient = OpenFin.ChannelClient;
type LayoutModule = OpenFin.Fin['Platform']['Layout'];
/** Manages the life cycle of windows and views in the application.
*
* Enables taking snapshots of itself and applyi
* ng them to restore a previous configuration
* as well as listen to platform events.
* @namespace
*/
export declare class Platform extends EmitterBase {
#private;
Layout: LayoutModule;
private _channel;
Application: OpenFin.Application;
identity: OpenFin.ApplicationIdentity;
constructor(identity: OpenFin.ApplicationIdentity, channel: Channel);
getClient: (identity?: OpenFin.ApplicationIdentity) => Promise;
/**
* Creates a new view and attaches it to a specified target window.
* @param { View~options } viewOptions View creation options
* @param { Identity } [target] The window to which the new view is to be attached. If no target, create a view in a new window.
* @param { Identity } [targetView] If provided, the new view will be added to the same tabstrip as targetView.
* @return { Promise }
* @tutorial Platform.createView
*/
createView(viewOptions: OpenFin.PlatformViewCreationOptions, target?: OpenFin.CreateViewTarget, targetView?: OpenFin.Identity): Promise;
/**
* Creates a new Window.
* @param { Window~options } options Window creation options
* @return { Promise<_Window> }
* @tutorial Platform.createWindow
*/
createWindow(options: OpenFin.PlatformWindowCreationOptions): Promise;
/**
* Closes current platform, all its windows, and their views.
* @return { Promise }
* @tutorial Platform.quit
*/
quit(): Promise;
/**
* Closes a specified view in a target window.
* @param { Identity } viewIdentity View identity
* @return { Promise }
* @tutorial Platform.closeView
*/
closeView(viewIdentity: OpenFin.Identity): Promise;
/**
* ***DEPRECATED - please use Platform.createView.***
* Reparents a specified view in a new target window.
* @param { Identity } viewIdentity View identity
* @param { Identity } target new owner window identity
* @return { Promise }
* @tutorial Platform.createView
*/
reparentView(viewIdentity: OpenFin.Identity, target: OpenFin.Identity): Promise;
/**
* Returns a snapshot of the platform in its current state.
*
* Can be used to restore an application to a previous state.
* @return { Promise }
* @tutorial Platform.getSnapshot
*/
getSnapshot(): Promise;
/**
* **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
*
* Returns a snapshot of a single view's options in its current state.
*
* Can be used to restore a view to a previous state.
*
* @param { Identity } viewIdentity View identity
* @returns { Promise }
* @internal
* @experimental
* @tutorial Platform.getViewSnapshot
*/
getViewSnapshot(viewIdentity: OpenFin.Identity): Promise;
/**
* Adds a snapshot to a running Platform.
* Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
*
* Can optionally close existing windows and overwrite current platform state with that of a snapshot.
*
* The function accepts either a snapshot taken using {@link Platform#getSnapshot getSnapshot},
* or a url or filepath to a snapshot JSON object.
* @param { Snapshot | string } requestedSnapshot Snapshot to apply, or a url or filepath.
* @param { ApplySnapshotOptions } [options] Optional parameters to specify whether existing windows should be closed.
* @return { Promise }
* @tutorial Platform.applySnapshot
*/
applySnapshot(requestedSnapshot: OpenFin.Snapshot | string, options?: OpenFin.ApplySnapshotOptions): Promise;
/**
* Fetches a JSON manifest using the browser process and returns a Javascript object.
* Can be overwritten using {@link Platform#init Platform.init}.
* @param { string } manifestUrl The URL of the manifest to fetch.
* @return { Promise }
* @tutorial Platform.fetchManifest
*/
fetchManifest(manifestUrl: string): Promise;
launchLegacyManifest: (manifestUrl: string) => Promise;
/**
* Retrieves a manifest by url and launches a legacy application manifest or snapshot into the platform. Returns a promise that
* resolves to the wrapped Platform.
* @param {string} manifestUrl - The URL of the manifest that will be launched into the platform. If this app manifest
* contains a snapshot, that will be launched into the platform. If not, the application described in startup_app options
* will be launched into the platform. The applicable startup_app options will become {@link View~options View Options}.
* @return {Promise}
* @tutorial Platform.launchContentManifest
* @experimental
*/
launchContentManifest(manifestUrl: string): Promise;
/**
* Set the context of a host window. The context will be available to the window itself, and to its child Views. It will be saved in any platform snapshots.
* It can be retrieved using {@link Platform#getWindowContext getWindowContext}.
* @param {any} context - A field where serializable context data can be stored to be saved in platform snapshots.
* @param {Identity} [target] - A target window or view may optionally be provided. If no target is provided, the update will be applied
* to the current window (if called from a Window) or the current host window (if called from a View).
* @return {Promise}
* @tutorial Platform.setWindowContext
* @experimental
*/
setWindowContext(context?: any, target?: OpenFin.Identity): Promise;
/**
* Get the context context of a host window that was previously set using {@link Platform#setWindowContext setWindowContext}.
* The context will be saved in any platform snapshots. Returns a promise that resolves to the context.
* @param {Identity} [target] - A target window or view may optionally be provided. If no target is provided, target will be
* the current window (if called from a Window) or the current host window (if called from a View).
* @return {Promise}
* @tutorial Platform.getWindowContext
* @experimental
*/
getWindowContext(target?: OpenFin.Identity): Promise;
/**
* Closes a window. If enableBeforeUnload is enabled in the Platform options, any beforeunload handler set on Views will fire
* This behavior can be disabled by setting skipBeforeUnload to false in the options parameter.
* @param {Identity} winId
* @param {closeWindowoptions} [options]
* @returns {Promise}
* @tutorial Platform.closeWindow
* @experimental
*/
closeWindow(windowId: OpenFin.Identity, options?: {
skipBeforeUnload: boolean;
}): Promise;
}
export {};