@types/openfin
Advanced tools
Comparing version
@@ -16,3 +16,3 @@ import { EmitterBase, Base, Reply } from '../base'; | ||
export interface ApplicationInfo { | ||
initialOptions: object; | ||
initialOptions: ApplicationOption; | ||
launchMode: string; | ||
@@ -22,3 +22,5 @@ manifest: object; | ||
parentUuid?: string; | ||
runtime: object; | ||
runtime: { | ||
version: string; | ||
}; | ||
} | ||
@@ -25,0 +27,0 @@ export interface LogInfo { |
import { WindowOption } from '../window/windowOption'; | ||
import { ShortcutOverride } from '../../shapes'; | ||
import { ViewCreationOptions } from '../view/view'; | ||
export interface ApplicationOption extends LegacyWinOptionsInAppOptions { | ||
@@ -14,3 +16,7 @@ disableIabSecureLogging?: boolean; | ||
fdc3Api?: boolean; | ||
commands?: ShortcutOverride[]; | ||
isPlatformController?: boolean; | ||
defaultWindowOptions?: WindowOption; | ||
defaultViewOptions?: ViewCreationOptions; | ||
} | ||
export declare type LegacyWinOptionsInAppOptions = Pick<WindowOption, 'accelerator' | 'alwaysOnTop' | 'api' | 'aspectRatio' | 'autoShow' | 'backgroundColor' | 'contentNavigation' | 'contextMenu' | 'cornerRounding' | 'customData' | 'customRequestHeaders' | 'defaultCentered' | 'defaultHeight' | 'defaultLeft' | 'defaultTop' | 'defaultWidth' | 'frame' | 'hideOnClose' | 'icon' | 'maxHeight' | 'maximizable' | 'maxWidth' | 'minHeight' | 'minimizable' | 'minWidth' | 'opacity' | 'preloadScripts' | 'resizable' | 'resizeRegion' | 'saveWindowState' | 'shadow' | 'showTaskbarIcon' | 'smallWindow' | 'state' | 'taskbarIconGroup' | 'waitForPageLoad'>; |
@@ -5,2 +5,3 @@ import { WebContentsEventMapping, WindowResourceLoadFailedEvent, WindowResourceResponseReceivedEvent } from './webcontents'; | ||
import { CrashedEvent } from './application'; | ||
import { Identity } from '../../main'; | ||
export interface ViewEventMapping<Topic = string, Type = string> extends WebContentsEventMapping { | ||
@@ -10,5 +11,7 @@ 'attached': WindowEvent<Topic, Type>; | ||
'destroyed': WindowEvent<Topic, Type>; | ||
'focused': WindowEvent<Topic, Type>; | ||
'hidden': WindowEvent<Topic, Type>; | ||
'hotkey': InputEvent & WindowEvent<Topic, Type>; | ||
'shown': WindowEvent<Topic, Type>; | ||
'target-changed': WindowEvent<Topic, Type>; | ||
'target-changed': TargetChangedEvent<Topic, Type>; | ||
} | ||
@@ -20,3 +23,5 @@ export interface PropagatedViewEventMapping<Topic = string, Type = string> extends BaseEventMap { | ||
'view-did-change-theme-color': WindowEvent<Topic, Type>; | ||
'view-focused': WindowEvent<Topic, Type>; | ||
'view-hidden': WindowEvent<Topic, Type>; | ||
'view-hotkey': InputEvent & WindowEvent<Topic, Type>; | ||
'view-navigation-rejected': WindowNavigationRejectedEvent<Topic, Type>; | ||
@@ -28,3 +33,3 @@ 'view-page-favicon-updated': WindowEvent<Topic, Type>; | ||
'view-shown': WindowEvent<Topic, Type>; | ||
'view-target-changed': WindowEvent<Topic, Type>; | ||
'view-target-changed': TargetChangedEvent<Topic, Type>; | ||
} | ||
@@ -37,1 +42,16 @@ export declare type ViewEvents = { | ||
}; | ||
export interface InputEvent { | ||
inputType: 'keyUp' | 'keyDown'; | ||
ctrlKey: boolean; | ||
shiftKey: boolean; | ||
altKey: boolean; | ||
metaKey: boolean; | ||
key: string; | ||
code: string; | ||
repeat: boolean; | ||
command?: string; | ||
} | ||
export interface TargetChangedEvent<Topic, Type> extends WindowEvent<Topic, Type> { | ||
previousTarget: Identity; | ||
target: Identity; | ||
} |
@@ -5,3 +5,4 @@ import { CrashedEvent } from './application'; | ||
import { WebContentsEventMapping, WindowResourceLoadFailedEvent, WindowResourceResponseReceivedEvent } from './webcontents'; | ||
import { PropagatedViewEventMapping } from './view'; | ||
import { PropagatedViewEventMapping, InputEvent } from './view'; | ||
import { Identity } from '../../main'; | ||
export declare type SpecificWindowEvent<Type> = WindowEvent<'window', Type>; | ||
@@ -117,2 +118,7 @@ export interface WindowAlertRequestedEvent<Topic, Type> extends WindowEvent<Topic, Type> { | ||
} | ||
export interface ViewDetached<Topic, Type> extends WindowEvent<Topic, Type> { | ||
previousTarget: Identity; | ||
target: Identity; | ||
viewIdentity: Identity; | ||
} | ||
export interface WindowEventMapping<Topic = string, Type = string> extends WebContentsEventMapping { | ||
@@ -136,3 +142,6 @@ 'auth-requested': WindowAuthRequestedEvent<Topic, Type>; | ||
'hidden': WindowHiddenEvent<Topic, Type>; | ||
'hotkey': InputEvent & WindowEvent<Topic, Type>; | ||
'initialized': WindowEvent<Topic, Type>; | ||
'layout-initialized': WindowEvent<Topic, Type>; | ||
'layout-ready': WindowEvent<Topic, Type>; | ||
'maximized': WindowEvent<Topic, Type>; | ||
@@ -151,3 +160,3 @@ 'minimized': WindowEvent<Topic, Type>; | ||
'view-attached': WindowEvent<Topic, Type>; | ||
'view-detached': WindowEvent<Topic, Type>; | ||
'view-detached': ViewDetached<Topic, Type>; | ||
'will-move': WillMoveOrResize<Topic, Type>; | ||
@@ -173,3 +182,6 @@ 'will-resize': WillMoveOrResize<Topic, Type>; | ||
'window-hidden': WindowHiddenEvent<Topic, Type>; | ||
'window-hotkey': InputEvent & WindowEvent<Topic, Type>; | ||
'window-initialized': WindowEvent<Topic, Type>; | ||
'window-layout-initialized': WindowEvent<Topic, Type>; | ||
'window-layout-ready': WindowEvent<Topic, Type>; | ||
'window-maximized': WindowEvent<Topic, Type>; | ||
@@ -176,0 +188,0 @@ 'window-minimized': WindowEvent<Topic, Type>; |
@@ -14,4 +14,5 @@ /// <reference types="node" /> | ||
import GlobalHotkey from './global-hotkey'; | ||
import ViewModule from './view/view'; | ||
import ViewModule, { View } from './view/view'; | ||
import PlatformModule from './platform/platform'; | ||
import { Frame } from '../main'; | ||
export default class Fin extends EventEmitter { | ||
@@ -31,4 +32,4 @@ private wire; | ||
Platform: PlatformModule; | ||
readonly me: Transport['me']; | ||
readonly me: (View | Window | Frame | {}) & Transport['me']; | ||
constructor(wire: Transport); | ||
} |
import { Identity } from '../../../identity'; | ||
import Transport, { Message } from '../../../transport/transport'; | ||
export interface ProviderIdentity extends Identity { | ||
channelId: string; | ||
isExternal?: boolean; | ||
channelName: string; | ||
} | ||
import { ProviderIdentity } from '../../../shapes'; | ||
export declare type Action = (() => any) | ((payload: any) => any) | ((payload: any, id: ProviderIdentity) => any); | ||
@@ -21,4 +17,3 @@ export declare type Middleware = (() => any) | ((action: string) => any) | ((action: string, payload: any) => any) | ((action: string, payload: any, id: ProviderIdentity) => any); | ||
export declare class ChannelBase { | ||
protected removeChannel: (mapKey: string) => void; | ||
protected channelMap: Map<string, ChannelBase>; | ||
protected removeChannel: (mapKey: string, endpointId?: string) => void; | ||
protected subscriptions: any; | ||
@@ -25,0 +20,0 @@ defaultAction: (action?: string, payload?: any, senderIdentity?: ProviderIdentity) => any; |
@@ -1,7 +0,13 @@ | ||
import { ChannelBase, ProviderIdentity } from './channel'; | ||
import { ChannelBase } from './channel'; | ||
import Transport from '../../../transport/transport'; | ||
import { ProviderIdentity } from '../../../shapes'; | ||
declare type DisconnectionListener = (providerIdentity: ProviderIdentity) => any; | ||
interface RoutingInfo extends ProviderIdentity { | ||
endpointId: string; | ||
} | ||
export declare class ChannelClient extends ChannelBase { | ||
private disconnectListener; | ||
constructor(providerIdentity: ProviderIdentity, send: Transport['sendAction'], channelMap: Map<string, ChannelBase>); | ||
private endpointId; | ||
private clientMap; | ||
constructor(routingInfo: RoutingInfo, send: Transport['sendAction'], clientMap: Map<string, ChannelClient>); | ||
readonly providerIdentity: ProviderIdentity; | ||
@@ -8,0 +14,0 @@ dispatch(action: string, payload?: any): Promise<any>; |
@@ -6,4 +6,4 @@ import { ChannelClient } from './client'; | ||
import Transport, { Message, Payload } from '../../../transport/transport'; | ||
import { ProviderIdentity } from './channel'; | ||
import { ChannelEvents } from '../../events/channel'; | ||
import { ProviderIdentity } from '../../../shapes'; | ||
export interface ConnectOptions { | ||
@@ -23,3 +23,5 @@ wait?: boolean; | ||
export declare class Channel extends EmitterBase<ChannelEvents> { | ||
private channelMap; | ||
private providerMap; | ||
private clientMap; | ||
private endpointIdMap; | ||
constructor(wire: Transport); | ||
@@ -31,3 +33,6 @@ getAllChannels(): Promise<ProviderIdentity[]>; | ||
create(channelName: string): Promise<ChannelProvider>; | ||
protected removeChannelFromMap(mapKey: string): void; | ||
protected addChannelToClientMaps(channel: ChannelClient, channelId: string, endpointId: string): void; | ||
protected removeChannelFromClientMaps(channelId: string, endpointId: string): void; | ||
protected removeChannelFromProviderMap(channelId: string): void; | ||
protected checkForPreviousClientConnection(channelId: string): void; | ||
onmessage: (msg: ChannelMessage) => boolean; | ||
@@ -34,0 +39,0 @@ private processChannelMessage; |
@@ -1,4 +0,5 @@ | ||
import { ChannelBase, ProviderIdentity } from './channel'; | ||
import { ChannelBase } from './channel'; | ||
import Transport from '../../../transport/transport'; | ||
import { Identity } from '../../../main'; | ||
import { ClientIdentity, ProviderIdentity } from '../../../shapes'; | ||
export declare type ConnectionListener = (identity: Identity, connectionMessage?: any) => any; | ||
@@ -9,5 +10,5 @@ export declare type DisconnectionListener = (identity: Identity) => any; | ||
private disconnectListener; | ||
connections: Identity[]; | ||
connections: ClientIdentity[]; | ||
constructor(providerIdentity: ProviderIdentity, send: Transport['sendAction']); | ||
dispatch(to: Identity, action: string, payload: any): Promise<any>; | ||
dispatch(to: Identity, action: string, payload?: any): Promise<any>; | ||
processAction(action: string, payload: any, senderIdentity: ProviderIdentity): Promise<any>; | ||
@@ -14,0 +15,0 @@ processConnection(senderId: Identity, payload: any): Promise<any>; |
@@ -0,1 +1,3 @@ | ||
import { View } from './../view/view'; | ||
import { Base, EmitterBase } from '../base'; | ||
import { Channel } from '../interappbus/channel/index'; | ||
@@ -8,2 +10,6 @@ import { ChannelClient } from '../interappbus/channel/client'; | ||
import { RvmLaunchOptions } from '../application/application'; | ||
import Transport from '../../transport/transport'; | ||
import LayoutModule from './layout'; | ||
import { PlatformEvents } from '../events/platform'; | ||
import { _Window } from '../window/window'; | ||
export interface Snapshot { | ||
@@ -16,12 +22,33 @@ windows: WindowOption[]; | ||
export interface PlatformOptions extends ApplicationOption { | ||
defaultWindowOptions?: WindowOption; | ||
defaultWindowOptions?: DefaultWindowOptions; | ||
defaultViewOptions?: ViewCreationOptions; | ||
disableDefaultCommands?: boolean; | ||
} | ||
interface DefaultWindowOptions extends WindowOption { | ||
stylesheetUrl: string; | ||
} | ||
declare type PlatformProvider = any; | ||
export declare type OverrideCallback<T extends PlatformProvider> = (arg: PlatformProvider) => T; | ||
export interface InitPlatformOptions { | ||
overrideCallback: OverrideCallback<any>; | ||
} | ||
/** | ||
* @lends Platform | ||
*/ | ||
export default class PlatformModule { | ||
export default class PlatformModule extends Base { | ||
private _channel; | ||
constructor(channel: Channel); | ||
Layout: LayoutModule; | ||
private _initializer; | ||
constructor(wire: Transport, channel: Channel); | ||
/** | ||
* Initializes a Platform. Must be called from the Provider when using a custom provider. | ||
* @param { InitPlatformOptions } [options] - platform options including a callback function that can be used to extend or replace | ||
* default Provider behavior. | ||
* @return {Promise.<void>} | ||
* @tutorial Platform.init | ||
* @experimental | ||
* @static | ||
*/ | ||
init(options?: InitPlatformOptions): Promise<any>; | ||
/** | ||
* Asynchronously returns a Platform object that represents an existing platform. | ||
@@ -32,3 +59,2 @@ * @param { Identity } identity | ||
* @static | ||
* @experimental | ||
*/ | ||
@@ -42,3 +68,2 @@ wrap(identity: Identity): Promise<Platform>; | ||
* @static | ||
* @experimental | ||
*/ | ||
@@ -58,7 +83,6 @@ wrapSync(identity: Identity): Platform; | ||
* @static | ||
* @experimental | ||
*/ | ||
getCurrentSync(): Platform; | ||
/** | ||
* Creates and starts a Platform and returns a wrapped and running Platform. The wrapped Platform methods can | ||
* Creates and starts a Platform and returns a wrapped and running Platform instance. The wrapped Platform methods can | ||
* be used to launch content into the platform. Promise will reject if the platform is already running. | ||
@@ -69,3 +93,2 @@ * @param { PlatformOptions } platformOptions | ||
* @static | ||
* @experimental | ||
*/ | ||
@@ -81,3 +104,2 @@ start(platformOptions: PlatformOptions): Promise<Platform>; | ||
* @static | ||
* @experimental | ||
*/ | ||
@@ -88,8 +110,11 @@ startFromManifest(manifestUrl: string, opts?: RvmLaunchOptions): Promise<Platform>; | ||
* | ||
* Enables taking snapshots of itself and applying them to restore a previous configuration. | ||
* Enables taking snapshots of itself and applying them to restore a previous configuration | ||
* as well as listen to <a href="tutorial-Platform.EventEmitter.html">platform events</a>. | ||
* @namespace | ||
*/ | ||
export declare class Platform { | ||
export declare class Platform extends EmitterBase<PlatformEvents> { | ||
Layout: LayoutModule; | ||
private _channel; | ||
private identity; | ||
identity: Identity; | ||
onWindowContextUpdate: Platform['onWindowContextUpdated']; | ||
constructor(identity: Identity, channel: Channel); | ||
@@ -101,15 +126,13 @@ getClient(identity?: Identity): Promise<ChannelClient>; | ||
* @param { Identity } [target] The window to which the new view is to be attached. If no target, create a view in a new window. | ||
* @return { Promise<Identity> } | ||
* @return { Promise<View> } | ||
* @tutorial Platform.createView | ||
* @experimental | ||
*/ | ||
createView(viewOptions: ViewCreationOptions, target?: Identity): Promise<Identity>; | ||
createView(viewOptions: ViewCreationOptions, target?: Identity): Promise<View>; | ||
/** | ||
* Creates a new Window. | ||
* @param { Window~options } options Window creation options | ||
* @return { Promise<Identity> } | ||
* @return { Promise<_Window> } | ||
* @tutorial Platform.createWindow | ||
* @experimental | ||
*/ | ||
createWindow(options: WindowOption): Promise<Identity>; | ||
createWindow(options: WindowOption): Promise<_Window & Identity>; | ||
/** | ||
@@ -119,3 +142,2 @@ * Closes current platform, all its windows, and their views. | ||
* @tutorial Platform.quit | ||
* @experimental | ||
*/ | ||
@@ -128,3 +150,2 @@ quit(): Promise<void>; | ||
* @tutorial Platform.closeView | ||
* @experimental | ||
*/ | ||
@@ -136,7 +157,6 @@ closeView(viewIdentity: Identity): Promise<void>; | ||
* @param { Identity } target new owner window identity | ||
* @return { Promise<Identity> } | ||
* @return { Promise<View> } | ||
* @tutorial Platform.reparentView | ||
* @experimental | ||
*/ | ||
reparentView(viewIdentity: Identity, target: Identity): Promise<Identity>; | ||
reparentView(viewIdentity: Identity, target: Identity): Promise<View>; | ||
/** | ||
@@ -147,4 +167,3 @@ * Returns a snapshot of the platform in its current state. | ||
* @return { Promise<Snapshot> } | ||
* @tutorial Platform.applySnapshot | ||
* @experimental | ||
* @tutorial Platform.getSnapshot | ||
*/ | ||
@@ -163,3 +182,2 @@ getSnapshot(): Promise<Snapshot>; | ||
* @tutorial Platform.applySnapshot | ||
* @experimental | ||
*/ | ||
@@ -199,9 +217,10 @@ applySnapshot(requestedSnapshot: Snapshot | string, options?: ApplySnapshotOptions): Promise<Platform>; | ||
* {@link Platform#setContext setContext} was called. This can only be set once per javascript environment (once per View), and any | ||
* subsequent calls to onWindowContextUpdate will error out. If the listener is successfully set, returns a promise that resolves to | ||
* subsequent calls to onWindowContextUpdated will error out. If the listener is successfully set, returns a promise that resolves to | ||
* true. | ||
* @return {Promise.<boolean>} | ||
* @tutorial Platform.onWindowContextUpdate | ||
* @tutorial Platform.onWindowContextUpdated | ||
* @experimental | ||
*/ | ||
onWindowContextUpdate(listener: (newContext: any, oldContext?: any) => any): Promise<boolean>; | ||
onWindowContextUpdated(listener: (newContext: any, oldContext?: any) => any): Promise<boolean>; | ||
} | ||
export {}; |
@@ -840,3 +840,9 @@ import { EmitterBase } from '../base'; | ||
getServiceConfiguration(serviceIdentifier: ServiceIdentifier): Promise<ServiceConfiguration>; | ||
/** | ||
* Signals the RVM to perform a health check and returns the results as json. | ||
* @return {Promise.<string[]>} | ||
* @tutorial System.runRvmHealthCheck | ||
*/ | ||
runRvmHealthCheck(): Promise<string[]>; | ||
} | ||
export {}; |
@@ -7,4 +7,5 @@ import { WebContents } from '../webcontents/webcontents'; | ||
import { _Window } from '../window/window'; | ||
import { WindowOption, CustomRequestHeaders } from '../window/windowOption'; | ||
import { ViewBounds, ContextMenuSettings } from '../../shapes'; | ||
import { WindowOption, CustomRequestHeaders, Api, ContentNavigation } from '../window/windowOption'; | ||
import { ViewBounds, ContextMenuSettings, Hotkey, PreloadScript } from '../../shapes'; | ||
/** | ||
@@ -14,2 +15,3 @@ * @lends View | ||
export default class ViewModule extends Base { | ||
constructor(wire: Transport); | ||
/** | ||
@@ -24,2 +26,3 @@ * Creates a new View. | ||
create(options: ViewCreationOptions): Promise<View>; | ||
private onmessage; | ||
/** | ||
@@ -61,2 +64,90 @@ * Asynchronously returns a View object that represents an existing view. | ||
/** | ||
* @typedef {object} View~options | ||
* @summary View creation options. | ||
* @desc This is the options object required by {@link View.create View.create}. | ||
* | ||
* Note that `name` and `target` are the only required properties — albeit the `url` property is usually provided as well | ||
* (defaults to `"about:blank"` when omitted). | ||
* | ||
* @property {object} [experimental] | ||
* Configurations for API injection. | ||
* | ||
* @property {boolean} [experimental.childWindows] Configure if the runtime should enable child windows for views. | ||
* | ||
* @property {object} [api] | ||
* Configurations for API injection. | ||
* | ||
* @property {object} [api.iframe] Configure if the the API should be injected into iframes based on domain. | ||
* | ||
* @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes. | ||
* @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes. | ||
* | ||
* @property {object} [autoResize] AutoResize options | ||
* | ||
* @property {object} [bounds] initial bounds | ||
* | ||
* @property {string} [backgroundColor="#FFF"] - _Updatable._ | ||
* The view’s _backfill_ color as a hexadecimal value. Not to be confused with the content background color | ||
* (`document.body.style.backgroundColor`), | ||
* this color briefly fills a view’s (a) content area before its content is loaded as well as (b) newly exposed | ||
* areas when growing a window. Setting | ||
* this value to the anticipated content background color can help improve user experience. | ||
* Default is white. | ||
* | ||
* @property {object} [contentNavigation] | ||
* Restrict navigation to URLs that match a whitelisted pattern. | ||
* In the lack of a whitelist, navigation to URLs that match a blacklisted pattern would be prohibited. | ||
* See [here](https://developer.chrome.com/extensions/match_patterns) for more details. | ||
* @property {string[]} [contentNavigation.whitelist=[]] List of whitelisted URLs. | ||
* @property {string[]} [contentNavigation.blacklist=[]] List of blacklisted URLs. | ||
* | ||
* @property {object} [contextMenuSettings] - _Updatable._ | ||
* Configure the context menu when right-clicking on a view. | ||
* @property {boolean} [contextMenuSettings.enable=true] Should the context menu display on right click. | ||
* @property {boolean} [contextMenuSettings.devtools=true] Should the context menu contain a button for opening devtools. | ||
* @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page. | ||
* | ||
* @property {any} [customData=""] - _Updatable._ | ||
* A field that the user can attach serializable data to to be ferried around with the view options. | ||
* _When omitted, the default value of this property is the empty string (`""`)._ | ||
* | ||
* @property {any} [customContext=""] - _Updatable._ | ||
* A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot} | ||
* is called. If a window or a view in a Platform is trying to update or retrieve its own context, it can use the | ||
* {@link Platform#setContext Platform.setContext} and {@link Platform#getContext Platform.getContext} calls. | ||
* When omitted, the default value of this property is the empty string (`""`). | ||
* As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext} | ||
* | ||
* @property {object[]} [hotkeys=[]] - _Updatable._ | ||
* Defines the list of hotkeys that will be emitted as a `hotkey` event on the view. For usage example see [example]{@tutorial hotkeys}. | ||
* Within Platform, OpenFin also implements a set of pre-defined actions called | ||
* [keyboard commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands} | ||
* that can be assigned to a specific hotkey in the platform manifest. | ||
* @property {string} hotkeys.keys The key combination of the hotkey, i.e. "Ctrl+T" | ||
* @property {boolean} [hotkeys.preventDefault=false] preventDefault will prevent the page keydown/keyup events from being emitted. | ||
* | ||
* @property {string} name | ||
* The name of the view. | ||
* @property {preloadScript[]} [preloadScripts] - _Inheritable_ | ||
* A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_ | ||
* from the parent application. | ||
* | ||
* @property {string} [processAffinity=<application uuid>] | ||
* A string to attempt to group renderers together. Will only be used if pages are on the same origin. | ||
* | ||
* @property {Identity} [target] | ||
* The identity of the window this view should be attached to. | ||
* | ||
* @property {string} [url="about:blank"] | ||
* The URL of the view. | ||
* | ||
* @property {string} [uuid=<application uuid>] | ||
* The `uuid` of the application, unique within the set of all `Application`s running in OpenFin Runtime. | ||
* If omitted, defaults to the `uuid` of the application spawning the view. | ||
* If given, must match the `uuid` of the application spawning the view. | ||
* In other words, the application's `uuid` is the only acceptable value, but is the default, so there's | ||
* really no need to provide it. | ||
*/ | ||
/** | ||
* @classdesc a View can be used to embed additional web content into a Window. | ||
@@ -78,12 +169,62 @@ * It is like a child window, except it is positioned relative to its owning window. | ||
/** | ||
* Attaches the current view to a the given window identity. | ||
* Identity must be the identity of a window in the same application. | ||
* This detaches the view from it's current window, and sets the view to be destroyed when its new window closes. | ||
* @param target {Identity} | ||
* @return {Promise.<void>} | ||
* @tutorial View.attach | ||
* @experimental | ||
* Executes Javascript on the view, restricted to contents you own or contents owned by | ||
* applications you have created. | ||
* @param { string } code JavaScript code to be executed on the view. | ||
* @function executeJavaScript | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.executeJavaScript | ||
*/ | ||
/** | ||
* Focuses the view | ||
* @return {Promise.<void>} | ||
* @function focus | ||
* @memberof View | ||
* @emits focused | ||
* @instance | ||
* @tutorial View.focus | ||
* @experimental | ||
*/ | ||
attach: (target: Identity) => Promise<void>; | ||
/** | ||
* Returns the zoom level of the view. | ||
* @function getZoomLevel | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<number>} | ||
* @tutorial View.getZoomLevel | ||
*/ | ||
/** | ||
* Sets the zoom level of the view. | ||
* @param { number } level The zoom level | ||
* @function setZoomLevel | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.setZoomLevel | ||
*/ | ||
/** | ||
* Find and highlight text on a page. | ||
* @param { string } searchTerm Term to find in page | ||
* @param { FindInPageOptions } options Search options | ||
* @function findInPage | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<number>} | ||
* @tutorial View.findInPage | ||
*/ | ||
/** | ||
* Stops any findInPage call with the provided action. | ||
* @param {string} action | ||
* Action to execute when stopping a find in page:<br> | ||
* "clearSelection" - Clear the selection.<br> | ||
* "keepSelection" - Translate the selection into a normal selection.<br> | ||
* "activateSelection" - Focus and click the selection node.<br> | ||
* @function stopFindInPage | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.stopFindInPage | ||
*/ | ||
/** | ||
* Navigates the view to a specified URL. The url must contain the protocol prefix such as http:// or https://. | ||
@@ -99,2 +240,69 @@ * @param { string } url - The URL to navigate the view to. | ||
/** | ||
* Navigates the view back one page. | ||
* @function navigateBack | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.navigateBack | ||
*/ | ||
/** | ||
* Navigates the view forward one page. | ||
* @function navigateForward | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.navigateForward | ||
*/ | ||
/** | ||
* Stops any current navigation the view is performing. | ||
* @function stopNavigation | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.stopNavigation | ||
*/ | ||
/** | ||
* Reloads the view current page | ||
* @function reload | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.reload | ||
*/ | ||
/** | ||
* Prints the view's web page | ||
* @param { PrintOptions } [options] Printer Options | ||
* @function print | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.print | ||
*/ | ||
/** | ||
* Returns an array with all system printers | ||
* @function getPrinters | ||
* @memberOf View | ||
* @instance | ||
* @return { Promise.Array.<PrinterInfo> } | ||
* @tutorial View.getPrinters | ||
*/ | ||
/** | ||
* Shows the Chromium Developer Tools | ||
* @function showDeveloperTools | ||
* @memberOf View | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial View.showDeveloperTools | ||
*/ | ||
/** | ||
* Attaches the current view to a the given window identity. | ||
* Identity must be the identity of a window in the same application. | ||
* This detaches the view from its current window, and sets the view to be destroyed when its new window closes. | ||
* @param target {Identity} | ||
* @return {Promise.<void>} | ||
* @tutorial View.attach | ||
* @experimental | ||
*/ | ||
attach: (target: Identity) => Promise<void>; | ||
/** | ||
* Destroys the current view | ||
@@ -129,2 +337,9 @@ * @return {Promise.<void>} | ||
/** | ||
* Gets the bounds (top, left, width, height) of the view relative to its window. | ||
* @return {Promise.<Bounds>} | ||
* @tutorial View.getBounds | ||
* @experimental | ||
*/ | ||
getBounds: () => Promise<any>; | ||
/** | ||
* Gets the View's info. | ||
@@ -154,3 +369,2 @@ * @return {Promise.<ViewInfo>} | ||
* @return {Promise.<_Window>} | ||
* @tutorial View.getCurrentWindow | ||
* @experimental | ||
@@ -160,8 +374,15 @@ */ | ||
/** | ||
* Sets a custom window handler. | ||
* @return {function} | ||
* @param { string | string[] } urls | ||
* Sets a custom window handler. Only works if experimental child windows are enabled for the view. | ||
* Takes a match pattern or array of match patterns for which to call the handler. | ||
* If multiple handlers are set that match a url, only the first set one will be called. | ||
* This can be used to "cascade" listeners. | ||
* Returns a function to unsubscribe this handler. | ||
* @tutorial View.setCustomWindowHandler | ||
* @param { string | string[] } urls Url match pattern or array of match patterns | ||
* see (https://developer.chrome.com/extensions/match_patterns) | ||
* @param {Function} handler function that will be called with the window options that match the url. | ||
* @return {Function} | ||
* @experimental | ||
*/ | ||
setCustomWindowHandler: (urls: string | string[], handler: (options: WindowOption) => void) => Promise<() => void>; | ||
setCustomWindowHandler: (urls: string | string[], handler: (options: WindowOption) => void) => Promise<() => Promise<void>>; | ||
} | ||
@@ -196,2 +417,5 @@ export interface AutoResizeOptions { | ||
customContext?: any; | ||
api?: Api; | ||
contentNavigation?: ContentNavigation; | ||
experimental?: any; | ||
} | ||
@@ -205,2 +429,4 @@ export interface ViewCreationOptions extends ViewOptions { | ||
processAffinity?: string; | ||
hotkeys?: Hotkey[]; | ||
preloadScripts?: PreloadScript[]; | ||
} |
@@ -21,2 +21,4 @@ import { EmitterBase } from '../base'; | ||
getPrinters(): Promise<PrinterInfo>; | ||
focus(): Promise<void>; | ||
showDeveloperTools(): Promise<void>; | ||
} |
@@ -309,2 +309,10 @@ import { Base } from '../base'; | ||
* | ||
* @property {object[]} [hotkeys=[]] - _Updatable._ | ||
* Defines the list of hotkeys that will be emitted as a `hotkey` event on the window. For usage example see [example]{@tutorial hotkeys}. | ||
* Within Platform, OpenFin also implements a set of pre-defined actions called | ||
* [keyboard commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands} | ||
* that can be assigned to a specific hotkey in the platform manifest. | ||
* @property {string} hotkeys.keys The key combination of the hotkey, i.e. "Ctrl+T" | ||
* @property {boolean} [hotkeys.preventDefault=false] Whether or not to prevent default key handling before emitting the event | ||
* | ||
* @property {string} [icon] - _Updatable. Inheritable._ | ||
@@ -357,2 +365,3 @@ * A URL for the icon to be shown in the window title bar and the taskbar. | ||
* A flag to cache the location of the window. | ||
* ** note ** - This option is ignored in Platforms as it would cause inconsistent {@link Platform#applySnapshot applySnapshot} behavior. | ||
* | ||
@@ -553,2 +562,21 @@ * @property {boolean} [shadow=false] | ||
/** | ||
* Executes Javascript on the window, restricted to windows you own or windows owned by | ||
* applications you have created. | ||
* @param { string } code JavaScript code to be executed on the window. | ||
* @function executeJavaScript | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.executeJavaScript | ||
*/ | ||
/** | ||
* Gives focus to the window. | ||
* @return {Promise.<void>} | ||
* @function focus | ||
* @emits focused | ||
* @memberOf Window | ||
* @instance | ||
* @tutorial Window.focus | ||
*/ | ||
/** | ||
* Returns the zoom level of the window. | ||
@@ -667,9 +695,2 @@ * @function getZoomLevel | ||
/** | ||
* Gives focus to the window. | ||
* @return {Promise.<void>} | ||
* @emits _Window#focused | ||
* @tutorial Window.focus | ||
*/ | ||
focus(): Promise<void>; | ||
/** | ||
* Centers the window on its current screen. | ||
@@ -743,12 +764,2 @@ * @return {Promise.<void>} | ||
/** | ||
* Executes Javascript on the window, restricted to windows you own or windows owned by | ||
* applications you have created. | ||
* @param { string } code JavaScript code to be executed on the window. | ||
* @function executeJavaScript | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.executeJavaScript | ||
*/ | ||
/** | ||
* Flashes the window’s frame and taskbar icon until stopFlashing is called or until a focus event is fired. | ||
@@ -950,3 +961,2 @@ * @return {Promise.<void>} | ||
*/ | ||
showDeveloperTools(): Promise<void>; | ||
/** | ||
@@ -953,0 +963,0 @@ * Updates the window using the passed options. |
import { DownloadPreloadOption } from '../system/download-preload'; | ||
import { RGB, ContextMenuSettings } from '../../shapes'; | ||
import { RGB, ContextMenuSettings, Hotkey } from '../../shapes'; | ||
export interface WindowOption { | ||
@@ -14,2 +13,3 @@ accelerator?: Accelerator; | ||
contentNavigation?: ContentNavigation; | ||
contentRedirect?: ContentRedirect; | ||
contextMenu?: boolean; | ||
@@ -28,3 +28,5 @@ contextMenuSettings?: ContextMenuSettings; | ||
hideOnClose?: boolean; | ||
hotkeys?: Hotkey[]; | ||
icon?: string; | ||
layout?: GoldenLayout.Config; | ||
maxHeight?: number; | ||
@@ -87,2 +89,6 @@ maximizable?: boolean; | ||
} | ||
export interface ContentRedirect { | ||
whitelist?: string[]; | ||
blacklist?: string[]; | ||
} | ||
export interface CornerRounding { | ||
@@ -89,0 +95,0 @@ height?: number; |
@@ -14,3 +14,4 @@ import { NewConnectConfig } from '../transport/wire'; | ||
getCurrentEntityType(): EntityType; | ||
raiseEvent(eventName: string, eventArgs: any): void; | ||
} | ||
export declare const notImplementedEnvErrorMsg = "Not implemented in this environment"; |
@@ -16,2 +16,3 @@ import { Environment } from './environment'; | ||
getCurrentEntityType: () => EntityType; | ||
raiseEvent: (eventName: string, eventArgs: any) => void; | ||
} |
@@ -6,2 +6,4 @@ import { Environment } from './environment'; | ||
export default class OpenFinEnvironment implements Environment { | ||
private raiseEventAsync; | ||
constructor(); | ||
writeToken: (path: string, token: string) => Promise<string>; | ||
@@ -17,2 +19,3 @@ retrievePort: (config: NewConnectConfig) => Promise<number>; | ||
getCurrentEntityType: () => EntityType; | ||
raiseEvent: (eventName: string, eventArgs: any) => void; | ||
} |
@@ -0,1 +1,3 @@ | ||
import { Identity } from "./identity"; | ||
export declare type AnchorType = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; | ||
@@ -45,1 +47,24 @@ export interface TransitionOptions { | ||
} | ||
export interface Hotkey { | ||
keys: string; | ||
preventDefault?: boolean; | ||
} | ||
export interface ShortcutOverride extends Hotkey { | ||
command: string; | ||
} | ||
export interface ProviderIdentity extends Identity { | ||
channelId?: string; | ||
channelName?: string; | ||
isExternal?: boolean; | ||
runtimeUuid?: string; | ||
} | ||
export interface ClientIdentity extends Identity { | ||
endpointId?: string; | ||
} | ||
export interface PreloadScript { | ||
mandatory?: boolean; | ||
state?: 'load-started' | 'load-failed' | 'load-succeeded' | 'failed' | 'succeeded'; | ||
url: string; | ||
} |
@@ -8,4 +8,2 @@ /// <reference types="node" /> | ||
import { EventAggregator } from '../api/events/eventAggregator'; | ||
import { View } from '../api/view/view'; | ||
import { Frame, Window } from '../main'; | ||
import { EntityTypeHelpers } from '../util/entity-type'; | ||
@@ -19,3 +17,3 @@ export declare type MessageHandler = (data: any) => boolean; | ||
protected uncorrelatedListener: Function; | ||
me: (View | Window | Frame | {}) & Identity & EntityTypeHelpers; | ||
me: Identity & EntityTypeHelpers; | ||
environment: Environment; | ||
@@ -22,0 +20,0 @@ topicRefMap: Map<string, number>; |
import { Identity } from '../main'; | ||
import { _Window } from '../api/window/window'; | ||
import { View } from '../api/view/view'; | ||
import { default as Transport } from '../transport/transport'; | ||
import { _Frame, EntityType } from '../api/frame/frame'; | ||
export declare function getInstanceByEntityType(entityType: string, wire: Transport, identity: Identity): View | _Window | _Frame; | ||
import { EntityType } from '../api/frame/frame'; | ||
export declare function getInstanceByEntityType(entityType: string, wire: Transport, identity: Identity): {}; | ||
export interface EntityTypeHelpers { | ||
@@ -8,0 +6,0 @@ isView: boolean; |
{ | ||
"name": "@types/openfin", | ||
"version": "49.0.0", | ||
"version": "50.0.0", | ||
"description": "TypeScript definitions for OpenFin API", | ||
@@ -42,7 +42,9 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/jquery": "*", | ||
"@types/node": "*", | ||
"@types/resize-observer-browser": "*", | ||
"@types/ws": "*" | ||
}, | ||
"typesPublisherContentHash": "eef2a432a560e6442716c844cfd8c054dd3475e1fe02a473602f027466044809", | ||
"typeScriptVersion": "2.9" | ||
"typesPublisherContentHash": "8812a6bc78b1ec1b79fdb144ae420223541ce87bacb7614614be5f7b540ee816", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 29 Jan 2020 22:02:38 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/ws](https://npmjs.com/package/@types/ws) | ||
* Global values: `fin` | ||
* Last updated: Wed, 13 May 2020 18:13:20 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/resize-observer-browser](https://npmjs.com/package/@types/resize-observer-browser), [@types/jquery](https://npmjs.com/package/@types/jquery), [@types/ws](https://npmjs.com/package/@types/ws) | ||
* Global values: `GoldenLayout`, `fdc3`, `fin` | ||
# Credits | ||
These definitions were written by Chris Barker (https://github.com/chrisbarker), Ricardo de Pena (https://github.com/rdepena), Roma (https://github.com/whyn07m3), Li Cui (https://github.com/licui3936), and Tomer Sharon (https://github.com/tomer-openfin). | ||
These definitions were written by [Chris Barker](https://github.com/chrisbarker), [Ricardo de Pena](https://github.com/rdepena), [Roma](https://github.com/whyn07m3), [Li Cui](https://github.com/licui3936), and [Tomer Sharon](https://github.com/tomer-openfin). |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
398533
39.33%95
17.28%9504
39.54%4
100%+ Added
+ Added
+ Added
+ Added