@types/openfin
Advanced tools
Comparing version
@@ -7,3 +7,3 @@ import { EmitterBase, Base, Reply } from '../base'; | ||
import Transport from '../../transport/transport'; | ||
import Bounds from '../window/bounds'; | ||
import { Bounds } from '../../shapes'; | ||
import { ApplicationEvents } from '../events/application'; | ||
@@ -10,0 +10,0 @@ import { ApplicationOption } from './applicationOption'; |
import { WindowEvent, BaseEventMap, ApplicationEvent } from './base'; | ||
import { WindowAlertRequestedEvent, WindowAuthRequestedEvent, WindowEndLoadEvent, PropagatedWindowEvents } from './window'; | ||
import { Bounds } from '../../shapes'; | ||
export interface CrashedEvent { | ||
@@ -11,2 +12,3 @@ reason: 'normal-termination' | 'abnormal-termination' | 'killed' | 'crashed' | 'still-running' | 'launch-failed' | 'out-of-memory'; | ||
button: 0 | 1 | 2; | ||
bounds: Bounds; | ||
x: number; | ||
@@ -13,0 +15,0 @@ y: number; |
@@ -0,3 +1,4 @@ | ||
import { Identity } from '../../identity'; | ||
import { FrameEvent } from './frame'; | ||
export declare type RuntimeEvent<Topic = string, Type = string> = Topic extends 'window' ? WindowEvent<Topic, Type> : Topic extends 'frame' ? FrameEvent<Type> : Topic extends 'application' ? ApplicationEvent<Topic, Type> : BaseEvent<Topic, Type>; | ||
export declare type RuntimeEvent<Topic = string, Type = string> = Topic extends 'window' ? WindowEvent<Topic, Type> : Topic extends 'frame' ? FrameEvent<Type> : Topic extends 'application' ? ApplicationEvent<Topic, Type> : Topic extends 'external-window' ? ApplicationEvent<Topic, Type> : BaseEvent<Topic, Type>; | ||
export interface BaseEvent<Topic, Type> { | ||
@@ -13,2 +14,4 @@ topic: Topic; | ||
} | ||
export interface ExternalWindowEvent<Topic, Type> extends BaseEvent<Topic, Type>, Identity { | ||
} | ||
export declare function getTopic(e: RuntimeEvent<any>): string; | ||
@@ -15,0 +18,0 @@ export interface BaseEventMap { |
@@ -14,3 +14,4 @@ /// <reference types="node" /> | ||
export declare type WindowEmitterAccessor = ['window', string, string]; | ||
export declare type ExternalWindowEmitterAccessor = ['external-window', string]; | ||
export declare type HotkeyEmitterAccessor = ['global-hotkey']; | ||
export declare type EmitterAccessor = SystemEmitterAccessor | ApplicationEmitterAccessor | WindowEmitterAccessor | HotkeyEmitterAccessor | string[]; | ||
export declare type EmitterAccessor = SystemEmitterAccessor | ApplicationEmitterAccessor | WindowEmitterAccessor | ExternalWindowEmitterAccessor | HotkeyEmitterAccessor | string[]; |
@@ -16,2 +16,6 @@ import { BaseEvent, ApplicationEvent, BaseEventMap } from './base'; | ||
'desktop-icon-clicked': ApplicationEvent<Topic, Type>; | ||
'external-window-closed': BaseEvent<Topic, Type>; | ||
'external-window-created': BaseEvent<Topic, Type>; | ||
'external-window-hidden': BaseEvent<Topic, Type>; | ||
'external-window-shown': BaseEvent<Topic, Type>; | ||
'idle-state-changed': IdleEvent<Topic, Type>; | ||
@@ -18,0 +22,0 @@ 'monitor-info-changed': MonitorEvent<Topic, Type>; |
@@ -30,5 +30,5 @@ import { Base, EmitterBase } from '../base'; | ||
/** | ||
* @classdesc An ExternalApplication object representing an application. Allows | ||
* the developer to create, execute, show and close an external application as | ||
* well as listen to <a href="tutorial-ExternalApplication.EventEmitter.html">application events</a>. | ||
* @classdesc An ExternalApplication object representing native language adapter connections to the runtime. Allows | ||
* the developer to listen to <a href="tutorial-ExternalApplication.EventEmitter.html">application events.</a> | ||
* Discovery of connections is provided by <a href="tutorial-System.getAllExternalApplications.html">getAllExternalApplications.</a> | ||
* @class | ||
@@ -35,0 +35,0 @@ * @hideconstructor |
@@ -11,2 +11,3 @@ /// <reference types="node" /> | ||
import ExternalApplication from './external-application/external-application'; | ||
import ExternalWindow from './external-window/external-window'; | ||
import _FrameModule from './frame/frame'; | ||
@@ -24,2 +25,3 @@ import GlobalHotkey from './global-hotkey'; | ||
ExternalApplication: ExternalApplication; | ||
ExternalWindow: ExternalWindow; | ||
Frame: _FrameModule; | ||
@@ -26,0 +28,0 @@ GlobalHotkey: GlobalHotkey; |
@@ -37,1 +37,4 @@ export interface ExternalProcessRequestType { | ||
} | ||
export interface ServiceConfiguration { | ||
name: string; | ||
} |
@@ -7,2 +7,3 @@ export interface RuntimeInfo { | ||
version: string; | ||
args: object; | ||
} |
@@ -15,3 +15,3 @@ import { EmitterBase } from '../base'; | ||
import { HostSpecs } from './host-specs'; | ||
import { ExternalProcessRequestType, TerminateExternalRequestType, ExternalConnection, ExternalProcessInfo } from './external-process'; | ||
import { ExternalProcessRequestType, TerminateExternalRequestType, ExternalConnection, ExternalProcessInfo, ServiceConfiguration } from './external-process'; | ||
import Transport from '../../transport/transport'; | ||
@@ -301,2 +301,3 @@ import { CookieInfo, CookieOption } from './cookie'; | ||
* @property { string } version The runtime version | ||
* @property { object } args the command line argument used to start the Runtime | ||
*/ | ||
@@ -376,2 +377,10 @@ /** | ||
/** | ||
* Service identifier | ||
* @typedef { object } ServiceIdentifier | ||
* @property { string } name The name of the service | ||
*/ | ||
interface ServiceIdentifier { | ||
name: string; | ||
} | ||
/** | ||
* An object representing the core of OpenFin Runtime. Allows the developer | ||
@@ -558,2 +567,8 @@ * to perform system-level actions, such as accessing logs, viewing processes, | ||
/** | ||
* Get currently focused external window. | ||
* @return {Promise.<Identity>} | ||
* @experimental | ||
*/ | ||
getFocusedExternalWindow(): Promise<Identity>; | ||
/** | ||
* Retrieves the contents of the log with the specified filename. | ||
@@ -716,2 +731,9 @@ * @param { GetLogRequestType } options A object that id defined by the GetLogRequestType interface | ||
/** | ||
* Retrieves an array of objects representing information about currently | ||
* running user-friendly native windows on the system. | ||
* @return {Promise.Array.<Identity>} | ||
* @experimental | ||
*/ | ||
getAllExternalWindows(): Promise<Array<Identity>>; | ||
/** | ||
* Retrieves app asset information. | ||
@@ -769,2 +791,12 @@ * @param { AppAssetRequest } options | ||
registerExternalConnection(uuid: string): Promise<ExternalConnection>; | ||
/** | ||
* Returns the json blob found in the [desktop owner settings](https://openfin.co/documentation/desktop-owner-settings/) | ||
* for the specified service. | ||
* More information about desktop services can be found [here](https://developers.openfin.co/docs/desktop-services). | ||
* @param { ServiceIdentifier } serviceIdentifier An object containing a name key that identifies the service. | ||
* @return {Promise.<ServiceConfiguration>} | ||
* @tutorial System.getServiceConfiguration | ||
*/ | ||
getServiceConfiguration(serviceIdentifier: ServiceIdentifier): Promise<ServiceConfiguration>; | ||
} | ||
export {}; |
@@ -1,11 +0,11 @@ | ||
import { Base, EmitterBase } from '../base'; | ||
import { Base } from '../base'; | ||
import { Identity } from '../../identity'; | ||
import Bounds from './bounds'; | ||
import { Transition, TransitionOptions } from './transition'; | ||
import { Application } from '../application/application'; | ||
import Transport from '../../transport/transport'; | ||
import { WindowEvents } from '../events/window'; | ||
import { AnchorType } from './anchor-type'; | ||
import { AnchorType, Transition, TransitionOptions, Bounds } from '../../shapes'; | ||
import { WindowOption } from './windowOption'; | ||
import { EntityType } from '../frame/frame'; | ||
import { ExternalWindow } from '../external-window/external-window'; | ||
import { WebContents } from '../webcontents/webcontents'; | ||
/** | ||
@@ -79,2 +79,5 @@ * @lends Window | ||
} | ||
interface WindowMovementOptions { | ||
moveIndependently: boolean; | ||
} | ||
/** | ||
@@ -118,2 +121,17 @@ * @typedef {object} Window~options | ||
* | ||
* @property {object} [alphaMask] - _Experimental._ _Updatable._ | ||
* <br> | ||
* alphaMask turns anything of matching RGB value transparent. | ||
* <br> | ||
* Caveats: | ||
* * runtime key --disable-gpu is required. Note: Unclear behavior on remote Desktop support | ||
* * User cannot click-through transparent regions | ||
* * Not supported on Mac | ||
* * Windows Aero must be enabled | ||
* * Won't make visual sense on Pixel-pushed environments such as Citrix | ||
* * Not supported on rounded corner windows | ||
* @property {number} [alphaMask.red=-1] 0-255 | ||
* @property {number} [alphaMask.green=-1] 0-255 | ||
* @property {number} [alphaMask.blue=-1] 0-255 | ||
* | ||
* @property {boolean} [alwaysOnTop=false] - _Updatable._ | ||
@@ -130,2 +148,4 @@ * A flag to always position the window at the top of the window stack. | ||
* | ||
* @property {string} [applicationIcon = ""] - _Deprecated_ - use `icon` instead. | ||
* | ||
* @property {number} [aspectRatio=0] - _Updatable._ | ||
@@ -155,2 +175,8 @@ * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero, | ||
* | ||
* @property {object} [contextMenuSettings] - _Updatable._ | ||
* Configure the context menu when right-clicking on a window. | ||
* @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 {object} [cornerRounding] - _Updatable._ | ||
@@ -262,2 +288,4 @@ * Defines and applies rounded corners for a frameless window. **NOTE:** On macOS corner is not ellipse but circle rounded by the | ||
* | ||
* @property {string} [taskbarIcon=string] - Deprecated - use `icon` instead._Windows_. | ||
* | ||
* @property {string} [taskbarIconGroup=<application uuid>] - _Windows_. | ||
@@ -282,3 +310,3 @@ * Specify a taskbar group for the window. | ||
/** | ||
* @typedef { Object } Area | ||
* @typedef { object } Area | ||
* @property { number } height Area's height | ||
@@ -290,2 +318,6 @@ * @property { number } width Area's width | ||
/** | ||
* @typedef { object } WindowMovementOptions | ||
* @property { boolean } moveIndependently - Move a window independently of its group or along with its group. Defaults to false. | ||
*/ | ||
/** | ||
* @typedef {object} Transition | ||
@@ -343,3 +375,3 @@ * @property {Opacity} opacity - The Opacity transition | ||
*/ | ||
export declare class _Window extends EmitterBase<WindowEvents> { | ||
export declare class _Window extends WebContents<WindowEvents> { | ||
identity: Identity; | ||
@@ -424,2 +456,52 @@ constructor(wire: Transport, identity: Identity); | ||
*/ | ||
/** | ||
* Returns the zoom level of the window. | ||
* @function getZoomLevel | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<number>} | ||
* @tutorial Window.getZoomLevel | ||
*/ | ||
/** | ||
* Sets the zoom level of the window. | ||
* @param { number } level The zoom level | ||
* @function setZoomLevel | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.setZoomLevel | ||
*/ | ||
/** | ||
* Navigates the window to a specified URL. The url must contain the protocol prefix such as http:// or https://. | ||
* @param {string} url - The URL to navigate the window to. | ||
* @function navigate | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.navigate | ||
*/ | ||
/** | ||
* Navigates the window back one page. | ||
* @function navigateBack | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.navigateBack | ||
*/ | ||
/** | ||
* Navigates the window forward one page. | ||
* @function navigateForward | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.navigateForward | ||
*/ | ||
/** | ||
* Stops any current navigation the window is performing. | ||
* @function stopNavigation | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.stopNavigation | ||
*/ | ||
createWindow(options: WindowOption): Promise<_Window>; | ||
@@ -506,6 +588,8 @@ private windowListFromNameList; | ||
* @param { string } code JavaScript code to be executed on the window. | ||
* @function executeJavaScript | ||
* @memberOf Window | ||
* @instance | ||
* @return {Promise.<void>} | ||
* @tutorial Window.executeJavaScript | ||
*/ | ||
executeJavaScript(code: string): Promise<void>; | ||
/** | ||
@@ -527,6 +611,6 @@ * Flashes the window’s frame and taskbar icon until stopFlashing is called or until a focus event is fired. | ||
* calling window is included in the result array. | ||
* @return {Promise.<Array<_Window>>} | ||
* @return {Promise.<Array<_Window|ExternalWindow>>} | ||
* @tutorial Window.getGroup | ||
*/ | ||
getGroup(): Promise<Array<_Window>>; | ||
getGroup(): Promise<Array<_Window | ExternalWindow>>; | ||
/** | ||
@@ -590,7 +674,7 @@ * Gets an information object for the window. | ||
* Joins the same window group as the specified window. | ||
* @param { _Window } target The window whose group is to be joined | ||
* @param { _Window | ExternalWindow } target The window whose group is to be joined | ||
* @return {Promise.<void>} | ||
* @tutorial Window.joinGroup | ||
*/ | ||
joinGroup(target: _Window): Promise<void>; | ||
joinGroup(target: _Window | ExternalWindow): Promise<void>; | ||
/** | ||
@@ -616,7 +700,7 @@ * Reloads the window current page | ||
* Merges the instance's window group with the same window group as the specified window | ||
* @param { _Window } target The window whose group is to be merged with | ||
* @param { _Window | ExternalWindow } target The window whose group is to be merged with | ||
* @return {Promise.<void>} | ||
* @tutorial Window.mergeGroups | ||
*/ | ||
mergeGroups(target: _Window): Promise<void>; | ||
mergeGroups(target: _Window | ExternalWindow): Promise<void>; | ||
/** | ||
@@ -632,6 +716,7 @@ * Minimizes the window. | ||
* @param { number } deltaTop The change in the top position of the window | ||
* @param { WindowMovementOptions } options Optional parameters to modify window movement | ||
* @return {Promise.<void>} | ||
* @tutorial Window.moveBy | ||
*/ | ||
moveBy(deltaLeft: number, deltaTop: number): Promise<void>; | ||
moveBy(deltaLeft: number, deltaTop: number, options?: WindowMovementOptions): Promise<void>; | ||
/** | ||
@@ -641,6 +726,7 @@ * Moves the window to a specified location. | ||
* @param { number } top The top position of the window | ||
* @param { WindowMovementOptions } options Optional parameters to modify window movement | ||
* @return {Promise.<void>} | ||
* @tutorial Window.moveTo | ||
*/ | ||
moveTo(left: number, top: number): Promise<void>; | ||
moveTo(left: number, top: number, options?: WindowMovementOptions): Promise<void>; | ||
/** | ||
@@ -653,6 +739,7 @@ * Resizes the window by a specified amount. | ||
* If undefined, the default is "top-left" | ||
* @param { WindowMovementOptions } options Optional parameters to modify window movement | ||
* @return {Promise.<void>} | ||
* @tutorial Window.resizeBy | ||
*/ | ||
resizeBy(deltaWidth: number, deltaHeight: number, anchor: AnchorType): Promise<void>; | ||
resizeBy(deltaWidth: number, deltaHeight: number, anchor: AnchorType, options?: WindowMovementOptions): Promise<void>; | ||
/** | ||
@@ -665,6 +752,7 @@ * Resizes the window to the specified dimensions. | ||
* If undefined, the default is "top-left" | ||
* @param { WindowMovementOptions } options Optional parameters to modify window movement | ||
* @return {Promise.<void>} | ||
* @tutorial Window.resizeTo | ||
*/ | ||
resizeTo(width: number, height: number, anchor: AnchorType): Promise<void>; | ||
resizeTo(width: number, height: number, anchor: AnchorType, options?: WindowMovementOptions): Promise<void>; | ||
/** | ||
@@ -685,6 +773,7 @@ * Restores the window to its normal state (i.e., unminimized, unmaximized). | ||
* @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of | ||
* @param { WindowMovementOptions } options Optional parameters to modify window movement | ||
* @return {Promise.<void>} | ||
* @tutorial Window.setBounds | ||
*/ | ||
setBounds(bounds: Bounds): Promise<void>; | ||
setBounds(bounds: Bounds, options?: WindowMovementOptions): Promise<void>; | ||
/** | ||
@@ -706,6 +795,7 @@ * Shows the window if it is hidden. | ||
* ‘show-requested’ has been subscribed to for application’s main window | ||
* @param { WindowMovementOptions } options Optional parameters to modify window movement | ||
* @return {Promise.<void>} | ||
* @tutorial Window.showAt | ||
*/ | ||
showAt(left: number, top: number, force?: boolean): Promise<void>; | ||
showAt(left: number, top: number, force?: boolean, options?: WindowMovementOptions): Promise<void>; | ||
/** | ||
@@ -733,40 +823,3 @@ * Shows the Chromium Developer Tools | ||
authenticate(userName: string, password: string): Promise<void>; | ||
/** | ||
* Returns the zoom level of the window. | ||
* @return {Promise.<number>} | ||
* @tutorial Window.getZoomLevel | ||
*/ | ||
getZoomLevel(): Promise<number>; | ||
/** | ||
* Sets the zoom level of the window. | ||
* @param { number } level The zoom level | ||
* @return {Promise.<void>} | ||
* @tutorial Window.setZoomLevel | ||
*/ | ||
setZoomLevel(level: number): Promise<void>; | ||
/** | ||
* Navigates the window to a specified URL. The url must contain the protocol prefix such as http:// or https://. | ||
* @param {string} url - The URL to navigate the window to. | ||
* @return {Promise.<void>} | ||
* @tutorial Window.navigate | ||
*/ | ||
navigate(url: string): Promise<void>; | ||
/** | ||
* Navigates the window back one page. | ||
* @return {Promise.<void>} | ||
* @tutorial Window.navigateBack | ||
*/ | ||
navigateBack(): Promise<void>; | ||
/** | ||
* Navigates the window forward one page. | ||
* @return {Promise.<void>} | ||
* @tutorial Window.navigateForward | ||
*/ | ||
navigateForward(): Promise<void>; | ||
/** | ||
* Stops any current navigation the window is performing. | ||
* @return {Promise.<void>} | ||
* @tutorial Window.stopNavigation | ||
*/ | ||
stopNavigation(): Promise<void>; | ||
} | ||
export {}; |
import { DownloadPreloadOption } from '../system/download-preload'; | ||
import { RGB, ContextMenuSettings } from '../../shapes'; | ||
export interface WindowOption { | ||
accelerator?: object; | ||
alphaMask?: RGB; | ||
alwaysOnTop?: boolean; | ||
api?: object; | ||
applicationIcon?: string; | ||
aspectRatio?: number; | ||
@@ -11,2 +14,3 @@ autoShow?: boolean; | ||
contextMenu?: boolean; | ||
contextMenuSettings?: ContextMenuSettings; | ||
cornerRounding?: object; | ||
@@ -13,0 +17,0 @@ customData?: string; |
@@ -5,1 +5,4 @@ export interface Identity { | ||
} | ||
export interface GroupWindowIdentity extends Identity { | ||
isExternalWindow?: boolean; | ||
} |
{ | ||
"name": "@types/openfin", | ||
"version": "41.0.0", | ||
"version": "43.0.0", | ||
"description": "TypeScript definitions for OpenFin API", | ||
@@ -26,2 +26,7 @@ "license": "MIT", | ||
"githubUsername": "licui3936" | ||
}, | ||
{ | ||
"name": "Tomer Sharon", | ||
"url": "https://github.com/tomer-openfin", | ||
"githubUsername": "tomer-openfin" | ||
} | ||
@@ -41,4 +46,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "e2e4256ce371df65a8c9410d63eb0956f6b5ac725239c4f8dd465d025d1b2e6a", | ||
"typesPublisherContentHash": "18d375f3ad0174de3c32423a326bc284a21ca50e1cc4c8ebf6d756117350bf13", | ||
"typeScriptVersion": "2.9" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for OpenFin API ( https://openfin.co/ ). | ||
This package contains type definitions for OpenFin API (https://openfin.co/). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Thu, 09 May 2019 00:42:18 GMT | ||
* Last updated: Thu, 27 Jun 2019 23:54:45 GMT | ||
* Dependencies: @types/node, @types/ws | ||
@@ -18,2 +18,2 @@ * Global values: 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>. | ||
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
237977
12.9%76
1.33%5708
13.95%