From f4614d3afbf18b376f25c356931dd009a3a607ea Mon Sep 17 00:00:00 2001
From: licui
Date: Tue, 29 Jan 2019 13:48:52 -0500
Subject: [PATCH 1/7] Create v37 folder
---
.../v37/_v2/api/application/application.d.ts | 242 +++
.../api/application/applicationOption.d.ts | 50 +
types/openfin/v37/_v2/api/base.d.ts | 46 +
.../v37/_v2/api/clipboard/clipboard.d.ts | 70 +
.../v37/_v2/api/clipboard/write-request.d.ts | 12 +
.../v37/_v2/api/events/application.d.ts | 56 +
types/openfin/v37/_v2/api/events/base.d.ts | 18 +
types/openfin/v37/_v2/api/events/channel.d.ts | 10 +
.../v37/_v2/api/events/emitterMap.d.ts | 15 +
.../v37/_v2/api/events/eventAggregator.d.ts | 5 +
.../_v2/api/events/externalApplication.d.ts | 5 +
types/openfin/v37/_v2/api/events/frame.d.ts | 9 +
.../v37/_v2/api/events/globalHotkey.d.ts | 11 +
.../v37/_v2/api/events/notifications.d.ts | 8 +
types/openfin/v37/_v2/api/events/system.d.ts | 22 +
types/openfin/v37/_v2/api/events/window.d.ts | 176 +++
.../external-application.d.ts | 44 +
types/openfin/v37/_v2/api/fin.d.ts | 27 +
types/openfin/v37/_v2/api/frame/frame.d.ts | 69 +
.../v37/_v2/api/global-hotkey/index.d.ts | 38 +
.../_v2/api/interappbus/channel/channel.d.ts | 31 +
.../_v2/api/interappbus/channel/client.d.ts | 6 +
.../_v2/api/interappbus/channel/index.d.ts | 32 +
.../_v2/api/interappbus/channel/provider.d.ts | 15 +
.../v37/_v2/api/interappbus/interappbus.d.ts | 80 +
.../_v2/api/notification/notification.d.ts | 70 +
.../v37/_v2/api/system/application.d.ts | 5 +
.../v37/_v2/api/system/clearCacheOption.d.ts | 6 +
types/openfin/v37/_v2/api/system/cookie.d.ts | 8 +
.../_v2/api/system/crashReporterOption.d.ts | 4 +
.../v37/_v2/api/system/download-asset.d.ts | 18 +
.../v37/_v2/api/system/download-preload.d.ts | 8 +
types/openfin/v37/_v2/api/system/entity.d.ts | 11 +
.../v37/_v2/api/system/external-process.d.ts | 36 +
.../v37/_v2/api/system/host-specs.d.ts | 24 +
types/openfin/v37/_v2/api/system/log.d.ts | 11 +
types/openfin/v37/_v2/api/system/monitor.d.ts | 39 +
types/openfin/v37/_v2/api/system/point.d.ts | 8 +
types/openfin/v37/_v2/api/system/process.d.ts | 15 +
types/openfin/v37/_v2/api/system/proxy.d.ts | 15 +
.../v37/_v2/api/system/registry-info.d.ts | 7 +
.../v37/_v2/api/system/runtime-info.d.ts | 7 +
types/openfin/v37/_v2/api/system/rvm.d.ts | 8 +
types/openfin/v37/_v2/api/system/system.d.ts | 588 ++++++++
types/openfin/v37/_v2/api/system/window.d.ts | 16 +
.../v37/_v2/api/window/anchor-type.d.ts | 1 +
.../v37/_v2/api/window/bounds-changed.d.ts | 14 +
types/openfin/v37/_v2/api/window/bounds.d.ts | 9 +
.../v37/_v2/api/window/transition.d.ts | 24 +
types/openfin/v37/_v2/api/window/window.d.ts | 778 ++++++++++
.../v37/_v2/api/window/windowOption.d.ts | 46 +
.../v37/_v2/environment/environment.d.ts | 10 +
.../openfin/v37/_v2/environment/node-env.d.ts | 11 +
.../v37/_v2/environment/openfin-env.d.ts | 11 +
.../_v2/environment/openfin-renderer-api.d.ts | 6 +
types/openfin/v37/_v2/identity.d.ts | 4 +
types/openfin/v37/_v2/launcher/launcher.d.ts | 15 +
.../openfin/v37/_v2/launcher/nix-launch.d.ts | 14 +
types/openfin/v37/_v2/launcher/util.d.ts | 8 +
.../openfin/v37/_v2/launcher/win-launch.d.ts | 4 +
types/openfin/v37/_v2/main.d.ts | 11 +
types/openfin/v37/_v2/of-main.d.ts | 1 +
types/openfin/v37/_v2/transport/elipc.d.ts | 13 +
.../v37/_v2/transport/port-discovery.d.ts | 17 +
.../v37/_v2/transport/transport-errors.d.ts | 17 +
.../openfin/v37/_v2/transport/transport.d.ts | 65 +
.../openfin/v37/_v2/transport/websocket.d.ts | 14 +
types/openfin/v37/_v2/transport/wire.d.ts | 71 +
.../v37/_v2/util/normalize-config.d.ts | 3 +
types/openfin/v37/_v2/util/promises.d.ts | 5 +
types/openfin/v37/_v2/util/ref-counter.d.ts | 7 +
types/openfin/v37/index.d.ts | 1304 +++++++++++++++++
types/openfin/v37/openfin-tests.ts | 851 +++++++++++
types/openfin/v37/tsconfig.json | 84 ++
types/openfin/v37/tslint.json | 18 +
75 files changed, 5437 insertions(+)
create mode 100644 types/openfin/v37/_v2/api/application/application.d.ts
create mode 100644 types/openfin/v37/_v2/api/application/applicationOption.d.ts
create mode 100644 types/openfin/v37/_v2/api/base.d.ts
create mode 100644 types/openfin/v37/_v2/api/clipboard/clipboard.d.ts
create mode 100644 types/openfin/v37/_v2/api/clipboard/write-request.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/application.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/base.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/channel.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/emitterMap.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/eventAggregator.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/externalApplication.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/frame.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/globalHotkey.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/notifications.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/system.d.ts
create mode 100644 types/openfin/v37/_v2/api/events/window.d.ts
create mode 100644 types/openfin/v37/_v2/api/external-application/external-application.d.ts
create mode 100644 types/openfin/v37/_v2/api/fin.d.ts
create mode 100644 types/openfin/v37/_v2/api/frame/frame.d.ts
create mode 100644 types/openfin/v37/_v2/api/global-hotkey/index.d.ts
create mode 100644 types/openfin/v37/_v2/api/interappbus/channel/channel.d.ts
create mode 100644 types/openfin/v37/_v2/api/interappbus/channel/client.d.ts
create mode 100644 types/openfin/v37/_v2/api/interappbus/channel/index.d.ts
create mode 100644 types/openfin/v37/_v2/api/interappbus/channel/provider.d.ts
create mode 100644 types/openfin/v37/_v2/api/interappbus/interappbus.d.ts
create mode 100644 types/openfin/v37/_v2/api/notification/notification.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/application.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/clearCacheOption.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/cookie.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/crashReporterOption.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/download-asset.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/download-preload.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/entity.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/external-process.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/host-specs.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/log.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/monitor.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/point.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/process.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/proxy.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/registry-info.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/runtime-info.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/rvm.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/system.d.ts
create mode 100644 types/openfin/v37/_v2/api/system/window.d.ts
create mode 100644 types/openfin/v37/_v2/api/window/anchor-type.d.ts
create mode 100644 types/openfin/v37/_v2/api/window/bounds-changed.d.ts
create mode 100644 types/openfin/v37/_v2/api/window/bounds.d.ts
create mode 100644 types/openfin/v37/_v2/api/window/transition.d.ts
create mode 100644 types/openfin/v37/_v2/api/window/window.d.ts
create mode 100644 types/openfin/v37/_v2/api/window/windowOption.d.ts
create mode 100644 types/openfin/v37/_v2/environment/environment.d.ts
create mode 100644 types/openfin/v37/_v2/environment/node-env.d.ts
create mode 100644 types/openfin/v37/_v2/environment/openfin-env.d.ts
create mode 100644 types/openfin/v37/_v2/environment/openfin-renderer-api.d.ts
create mode 100644 types/openfin/v37/_v2/identity.d.ts
create mode 100644 types/openfin/v37/_v2/launcher/launcher.d.ts
create mode 100644 types/openfin/v37/_v2/launcher/nix-launch.d.ts
create mode 100644 types/openfin/v37/_v2/launcher/util.d.ts
create mode 100644 types/openfin/v37/_v2/launcher/win-launch.d.ts
create mode 100644 types/openfin/v37/_v2/main.d.ts
create mode 100644 types/openfin/v37/_v2/of-main.d.ts
create mode 100644 types/openfin/v37/_v2/transport/elipc.d.ts
create mode 100644 types/openfin/v37/_v2/transport/port-discovery.d.ts
create mode 100644 types/openfin/v37/_v2/transport/transport-errors.d.ts
create mode 100644 types/openfin/v37/_v2/transport/transport.d.ts
create mode 100644 types/openfin/v37/_v2/transport/websocket.d.ts
create mode 100644 types/openfin/v37/_v2/transport/wire.d.ts
create mode 100644 types/openfin/v37/_v2/util/normalize-config.d.ts
create mode 100644 types/openfin/v37/_v2/util/promises.d.ts
create mode 100644 types/openfin/v37/_v2/util/ref-counter.d.ts
create mode 100644 types/openfin/v37/index.d.ts
create mode 100644 types/openfin/v37/openfin-tests.ts
create mode 100644 types/openfin/v37/tsconfig.json
create mode 100644 types/openfin/v37/tslint.json
diff --git a/types/openfin/v37/_v2/api/application/application.d.ts b/types/openfin/v37/_v2/api/application/application.d.ts
new file mode 100644
index 0000000000..37263a9a63
--- /dev/null
+++ b/types/openfin/v37/_v2/api/application/application.d.ts
@@ -0,0 +1,242 @@
+import { EmitterBase, Base, Reply } from '../base';
+import { Identity } from '../../identity';
+import { _Window } from '../window/window';
+import { Point } from '../system/point';
+import { MonitorInfo } from '../system/monitor';
+import Transport from '../../transport/transport';
+import Bounds from '../window/bounds';
+import { ApplicationEvents } from '../events/application';
+import { ApplicationOption } from './applicationOption';
+export interface TrayIconClickReply extends Point, Reply<'application', 'tray-icon-clicked'> {
+ button: number;
+ monitorInfo: MonitorInfo;
+}
+export interface ApplicationInfo {
+ initialOptions: object;
+ launchMode: string;
+ manifest: object;
+ manifestUrl: string;
+ parentUuid?: string;
+ runtime: object;
+}
+export declare class NavigationRejectedReply extends Reply<'window-navigation-rejected', void> {
+ sourceName: string;
+ url: string;
+}
+export interface ShortCutConfig {
+ desktop?: boolean;
+ startMenu?: boolean;
+ systemStartup?: boolean;
+}
+export interface TrayInfo {
+ bounds: Bounds;
+ monitorInfo: MonitorInfo;
+ x: number;
+ y: number;
+}
+/**
+ * @lends Application
+ */
+export default class ApplicationModule extends Base {
+ /**
+ * Asynchronously returns an Application object that represents an existing application.
+ * @param { Identity } identity
+ * @return {Promise.}
+ * @tutorial Application.wrap
+ * @static
+ */
+ wrap(identity: Identity): Promise;
+ /**
+ * Synchronously returns an Application object that represents an existing application.
+ * @param { Identity } identity
+ * @return {Application}
+ * @tutorial Application.wrapSync
+ * @static
+ */
+ wrapSync(identity: Identity): Application;
+ /**
+ * Creates a new Application.
+ * @param { ApplicationOption } appOptions
+ * @return {Promise.}
+ * @tutorial Application.create
+ * @static
+ */
+ create(appOptions: ApplicationOption): Promise;
+ /**
+ * Asynchronously returns an Application object that represents the current application
+ * @return {Promise.}
+ * @tutorial Application.getCurrent
+ * @static
+ */
+ getCurrent(): Promise;
+ /**
+ * Synchronously returns an Application object that represents the current application
+ * @return {Application}
+ * @tutorial Application.getCurrentSync
+ * @static
+ */
+ getCurrentSync(): Application;
+ /**
+ * Retrieves application's manifest and returns a wrapped application.
+ * @param {string} manifestUrl - The URL of app's manifest.
+ * @return {Promise.}
+ * @tutorial Application.createFromManifest
+ * @static
+ */
+ createFromManifest(manifestUrl: string): Promise;
+}
+/**
+ * @classdesc An object representing an application. Allows the developer to create,
+ * execute, show/close an application as well as listen to application events.
+ * @class
+ */
+export declare class Application extends EmitterBase {
+ identity: Identity;
+ _manifestUrl?: string;
+ private window;
+ constructor(wire: Transport, identity: Identity);
+ private windowListFromIdentityList;
+ /**
+ * Determines if the application is currently running.
+ * @return {Promise.}
+ * @tutorial Application.isRunning
+ */
+ isRunning(): Promise;
+ /**
+ * Closes the application and any child windows created by the application.
+ * @param { boolean } [force = false] Close will be prevented from closing when force is false and
+ * ‘close-requested’ has been subscribed to for application’s main window.
+ * @return {Promise.}
+ * @tutorial Application.close
+ */
+ close(force?: boolean): Promise;
+ /**
+ * Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
+ * @return {Promise.Array.<_Window>}
+ * @tutorial Application.getChildWindows
+ */
+ getChildWindows(): Promise>;
+ /**
+ * Retrieves an array of active window groups for all of the application's windows. Each group is
+ * represented as an array of wrapped fin.Windows.
+ * @return {Promise.Array.Array.<_Window>}
+ * @tutorial Application.getGroups
+ */
+ getGroups(): Promise>>;
+ /**
+ * Retrieves the JSON manifest that was used to create the application. Invokes the error callback
+ * if the application was not created from a manifest.
+ * @return {Promise.}
+ * @tutorial Application.getManifest
+ */
+ getManifest(): Promise;
+ /**
+ * Retrieves UUID of the application that launches this application. Invokes the error callback
+ * if the application was created from a manifest.
+ * @return {Promise.}
+ * @tutorial Application.getParentUuid
+ */
+ getParentUuid(): Promise;
+ /**
+ * Retrieves current application's shortcut configuration.
+ * @return {Promise.}
+ * @tutorial Application.getShortcuts
+ */
+ getShortcuts(): Promise;
+ /**
+ * Returns the current zoom level of the application.
+ * @return {Promise.}
+ * @tutorial Application.getZoomLevel
+ */
+ getZoomLevel(): Promise;
+ /**
+ * Returns an instance of the main Window of the application
+ * @return {Promise.<_Window>}
+ * @tutorial Application.getWindow
+ */
+ getWindow(): Promise<_Window>;
+ /**
+ * Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
+ * @param { string } userName - username to be passed to the RVM.
+ * @param { string } appName - app name to be passed to the RVM.
+ * @return {Promise.}
+ * @tutorial Application.registerUser
+ */
+ registerUser(userName: string, appName: string): Promise;
+ /**
+ * Removes the application’s icon from the tray.
+ * @return {Promise.}
+ * @tutorial Application.removeTrayIcon
+ */
+ removeTrayIcon(): Promise;
+ /**
+ * Restarts the application.
+ * @return {Promise.}
+ * @tutorial Application.restart
+ */
+ restart(): Promise;
+ /**
+ * Runs the application. When the application is created, run must be called.
+ * @return {Promise.}
+ * @tutorial Application.run
+ */
+ run(): Promise;
+ /**
+ * Instructs the RVM to schedule one restart of the application.
+ * @return {Promise.}
+ * @tutorial Application.scheduleRestart
+ */
+ scheduleRestart(): Promise;
+ /**
+ * Adds a customizable icon in the system tray and notifies the application when clicked.
+ * @param { string } iconUrl Image URL to be used as the icon
+ * @return {Promise.}
+ * @tutorial Application.setTrayIcon
+ */
+ setTrayIcon(iconUrl: string): Promise;
+ /**
+ * Sets new application's shortcut configuration.
+ * @param { Object } config New application's shortcut configuration.
+ * @param {Boolean} [config.desktop] - Enable/disable desktop shortcut.
+ * @param {Boolean} [config.startMenu] - Enable/disable start menu shortcut.
+ * @param {Boolean} [config.systemStartup] - Enable/disable system startup shortcut.
+ * @return {Promise.}
+ * @tutorial Application.setShortcuts
+ */
+ setShortcuts(config: ShortCutConfig): Promise;
+ /**
+ * Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
+ * larger or smaller to default limits of 300% and 50% of original size, respectively.
+ * @param { number } level The zoom level
+ * @return {Promise.}
+ * @tutorial Application.setZoomLevel
+ */
+ setZoomLevel(level: number): Promise;
+ /**
+ * @summary Retrieves information about the system tray.
+ * @desc The only information currently returned is the position and dimensions.
+ * @return {Promise.}
+ * @tutorial Application.getTrayIconInfo
+ */
+ getTrayIconInfo(): Promise;
+ /**
+ * Closes the application by terminating its process.
+ * @return {Promise.}
+ * @tutorial Application.terminate
+ */
+ terminate(): Promise;
+ /**
+ * Waits for a hanging application. This method can be called in response to an application
+ * "not-responding" to allow the application to continue and to generate another "not-responding"
+ * message after a certain period of time.
+ * @return {Promise.}
+ * @ignore
+ */
+ wait(): Promise;
+ /**
+ * Retrieves information about the application.
+ * @return {Promise.}
+ * @tutorial Application.getInfo
+ */
+ getInfo(): Promise;
+}
diff --git a/types/openfin/v37/_v2/api/application/applicationOption.d.ts b/types/openfin/v37/_v2/api/application/applicationOption.d.ts
new file mode 100644
index 0000000000..134e4482d6
--- /dev/null
+++ b/types/openfin/v37/_v2/api/application/applicationOption.d.ts
@@ -0,0 +1,50 @@
+import { WindowOption, CustomRequestHeaders } from '../window/windowOption';
+import { DownloadPreloadOption } from '../system/download-preload';
+export interface ApplicationOption {
+ disableIabSecureLogging?: boolean;
+ loadErrorMessage?: string;
+ mainWindowOptions?: WindowOption;
+ name?: string;
+ nonPersistent?: boolean;
+ plugins?: boolean;
+ spellCheck?: boolean;
+ url?: string;
+ uuid: string;
+ webSecurity?: boolean;
+ accelerator?: object;
+ alwaysOnTop?: boolean;
+ api?: object;
+ aspectRatio?: number;
+ autoShow?: boolean;
+ backgroundColor?: string;
+ contentNavigation?: object;
+ contextMenu?: boolean;
+ cornerRounding?: object;
+ customData?: string;
+ customRequestHeaders?: Array;
+ defaultCentered?: boolean;
+ defaultHeight?: number;
+ defaultLeft?: number;
+ defaultTop?: number;
+ defaultWidth?: number;
+ frame?: boolean;
+ hideOnClose?: boolean;
+ icon?: string;
+ maxHeight?: number;
+ maximizable?: boolean;
+ maxWidth?: number;
+ minHeight?: number;
+ minimizable?: boolean;
+ minWidth?: number;
+ opacity?: number;
+ preloadScripts?: Array;
+ resizable?: boolean;
+ resizeRegion?: object;
+ saveWindowState?: boolean;
+ shadow?: boolean;
+ showTaskbarIcon?: boolean;
+ smallWindow?: boolean;
+ state?: string;
+ taskbarIconGroup?: string;
+ waitForPageLoad?: boolean;
+}
diff --git a/types/openfin/v37/_v2/api/base.d.ts b/types/openfin/v37/_v2/api/base.d.ts
new file mode 100644
index 0000000000..5cbb8658a7
--- /dev/null
+++ b/types/openfin/v37/_v2/api/base.d.ts
@@ -0,0 +1,46 @@
+///
+import Transport from '../transport/transport';
+import { Identity } from '../identity';
+import { EventEmitter } from 'events';
+import { EmitterAccessor } from './events/emitterMap';
+import { BaseEventMap } from './events/base';
+interface SubOptions {
+ timestamp?: number;
+}
+export declare class Base {
+ wire: Transport;
+ constructor(wire: Transport);
+ private _topic;
+ protected topic: string;
+ readonly me: Identity;
+ protected isNodeEnvironment: () => boolean;
+ protected isOpenFinEnvironment: () => boolean;
+}
+export declare class EmitterBase extends Base {
+ private emitterAccessor;
+ protected identity: Identity;
+ constructor(wire: Transport, emitterAccessor: EmitterAccessor);
+ eventNames: () => (string | symbol)[];
+ emit: >(eventName: E, payload: E extends Extract ? EventTypes[E] : any, ...args: any[]) => boolean;
+ private hasEmitter;
+ private getEmitter;
+ listeners: (type: string | symbol) => Function[];
+ listenerCount: (type: string | symbol) => number;
+ protected registerEventListener: (eventType: string | symbol | Extract, options?: SubOptions) => Promise;
+ protected deregisterEventListener: (eventType: string | symbol | Extract, options?: SubOptions) => Promise;
+ on | string | symbol>(eventType: E, listener: (payload: E extends keyof EventTypes ? EventTypes[E] : any, ...args: any[]) => void, options?: SubOptions): Promise;
+ addListener: >(eventType: E, listener: (payload: E extends keyof EventTypes ? EventTypes[E] : any, ...args: any[]) => void, options?: SubOptions) => Promise;
+ once | string | symbol>(eventType: E, listener: (payload: E extends keyof EventTypes ? EventTypes[E] : any, ...args: any[]) => void, options?: SubOptions): Promise;
+ prependListener | string | symbol>(eventType: E, listener: (payload: E extends keyof EventTypes ? EventTypes[E] : any, ...args: any[]) => void, options?: SubOptions): Promise;
+ prependOnceListener | string | symbol>(eventType: E, listener: (payload: E extends keyof EventTypes ? EventTypes[E] : any, ...args: any[]) => void, options?: SubOptions): Promise;
+ removeListener | string | symbol>(eventType: E, listener: (payload: E extends keyof EventTypes ? EventTypes[E] : any, ...args: any[]) => void, options?: SubOptions): Promise;
+ protected deregisterAllListeners: (eventType: string | symbol | Extract) => Promise;
+ removeAllListeners(eventType?: Extract | string | symbol): Promise;
+}
+export declare class Reply implements Identity {
+ topic: TOPIC;
+ type: TYPE;
+ uuid: string;
+ name?: string;
+}
+export {};
diff --git a/types/openfin/v37/_v2/api/clipboard/clipboard.d.ts b/types/openfin/v37/_v2/api/clipboard/clipboard.d.ts
new file mode 100644
index 0000000000..11b466dea0
--- /dev/null
+++ b/types/openfin/v37/_v2/api/clipboard/clipboard.d.ts
@@ -0,0 +1,70 @@
+import { Base } from '../base';
+import { WriteRequestType, WriteAnyRequestType } from './write-request';
+/**
+ * WriteRequestType interface
+ * @typedef { Object } WriteRequestType
+ * @property { string } name The name of the running application
+ * @property { string } uuid The uuid of the running application
+ */
+/**
+ * The Clipboard API allows reading and writing to the clipboard in multiple formats.
+ * @namespace
+*/
+export default class Clipboard extends Base {
+ /**
+ * Writes data into the clipboard as plain text
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typeof
+ * @return {Promise.}
+ * @tutorial Clipboard.writeText
+ */
+ writeText(writeObj: WriteRequestType): Promise;
+ /**
+ * Read the content of the clipboard as plain text
+ * @param { string } type Clipboard Type
+ * @return {Promise.}
+ * @tutorial Clipboard.readText
+ */
+ readText(type?: string): Promise;
+ /**
+ * Writes data into the clipboard as Html
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
+ * @return {Promise.}
+ * @tutorial Clipboard.writeHtml
+ */
+ writeHtml(writeObj: WriteRequestType): Promise;
+ /**
+ * Read the content of the clipboard as Html
+ * @param { string } type Clipboard Type
+ * @return {Promise.}
+ * @tutorial Clipboard.readHtml
+ */
+ readHtml(type?: string): Promise;
+ /**
+ * Writes data into the clipboard as Rtf
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
+ * @return {Promise.}
+ * @tutorial Clipboard.writeRtf
+ */
+ writeRtf(writeObj: WriteRequestType): Promise;
+ /**
+ * Read the content of the clipboard as Rtf
+ * @param { string } type Clipboard Type
+ * @return {Promise.}
+ * @tutorial Clipboard.readRtf
+ */
+ readRtf(type?: string): Promise;
+ /**
+ * Writes data into the clipboard
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
+ * @return {Promise.}
+ * @tutorial Clipboard.write
+ */
+ write(writeObj: WriteAnyRequestType): Promise;
+ /**
+ * Reads available formats for the clipboard type
+ * @param { string } type Clipboard Type
+ * @return {Promise.Array.}
+ * @tutorial Clipboard.getAvailableFormats
+ */
+ getAvailableFormats(type?: string): Promise>;
+}
diff --git a/types/openfin/v37/_v2/api/clipboard/write-request.d.ts b/types/openfin/v37/_v2/api/clipboard/write-request.d.ts
new file mode 100644
index 0000000000..a2fc5c333e
--- /dev/null
+++ b/types/openfin/v37/_v2/api/clipboard/write-request.d.ts
@@ -0,0 +1,12 @@
+export interface WriteRequestType {
+ data: string;
+ type?: string;
+}
+export interface WriteAnyRequestType {
+ data: {
+ text?: string;
+ html?: string;
+ rtf?: string;
+ };
+ type?: string;
+}
diff --git a/types/openfin/v37/_v2/api/events/application.d.ts b/types/openfin/v37/_v2/api/events/application.d.ts
new file mode 100644
index 0000000000..444d358cbd
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/application.d.ts
@@ -0,0 +1,56 @@
+import { WindowEvent, BaseEventMap, ApplicationEvent } from './base';
+import { WindowAlertRequestedEvent, WindowAuthRequestedEvent, WindowEndLoadEvent, PropagatedWindowEvents } from './window';
+export interface CrashedEvent {
+ reason: 'normal-termination' | 'abnormal-termination' | 'killed' | 'crashed' | 'still-running' | 'launch-failed' | 'out-of-memory';
+}
+export interface RunRequestedEvent extends ApplicationEvent {
+ userAppConfigArgs: any;
+}
+export interface TrayIconClicked extends ApplicationEvent {
+ button: 0 | 1 | 2;
+ x: number;
+ y: number;
+ monitorInfo: any;
+}
+export interface ApplicationEventMapping extends BaseEventMap {
+ 'closed': ApplicationEvent;
+ 'connected': ApplicationEvent;
+ 'crashed': CrashedEvent & ApplicationEvent;
+ 'initialized': ApplicationEvent;
+ 'manifest-changed': ApplicationEvent;
+ 'not-responding': ApplicationEvent;
+ 'responding': ApplicationEvent;
+ 'run-requested': RunRequestedEvent;
+ 'started': ApplicationEvent;
+ 'tray-icon-clicked': TrayIconClicked;
+ 'window-alert-requested': WindowAlertRequestedEvent;
+ 'window-auth-requested': WindowAuthRequestedEvent;
+ 'window-created': WindowEvent;
+ 'window-end-load': WindowEndLoadEvent;
+ 'window-not-responding': WindowEvent;
+ 'window-responding': WindowEvent;
+ 'window-show-requested': WindowEvent;
+ 'window-start-load': WindowEvent;
+}
+export interface PropagatedApplicationEventMapping {
+ 'application-closed': ApplicationEvent;
+ 'application-connected': ApplicationEvent;
+ 'application-crashed': CrashedEvent & ApplicationEvent;
+ 'application-initialized': ApplicationEvent;
+ 'application-manifest-changed': ApplicationEvent;
+ 'application-not-responding': ApplicationEvent;
+ 'application-responding': ApplicationEvent;
+ 'application-started': ApplicationEvent;
+ 'application-tray-icon-clicked': TrayIconClicked;
+ 'window-created': WindowEvent;
+ 'window-end-load': WindowEndLoadEvent;
+ 'window-not-responding': WindowEvent;
+ 'window-responding': WindowEvent;
+ 'window-start-load': WindowEvent;
+}
+export declare type ApplicationEvents = PropagatedWindowEvents<'application'> & {
+ [Type in keyof ApplicationEventMapping]: ApplicationEventMapping<'application', Type>[Type];
+};
+export declare type PropagatedApplicationEvents = {
+ [Type in keyof PropagatedApplicationEventMapping]: PropagatedApplicationEventMapping[Type];
+};
diff --git a/types/openfin/v37/_v2/api/events/base.d.ts b/types/openfin/v37/_v2/api/events/base.d.ts
new file mode 100644
index 0000000000..700f82679b
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/base.d.ts
@@ -0,0 +1,18 @@
+import { FrameEvent } from './frame';
+export declare type RuntimeEvent = Topic extends 'window' ? WindowEvent : Topic extends 'frame' ? FrameEvent : Topic extends 'application' ? ApplicationEvent : BaseEvent;
+export interface BaseEvent {
+ topic: Topic;
+ type: Type;
+}
+export interface ApplicationEvent extends BaseEvent {
+ uuid: string;
+}
+export interface WindowEvent extends ApplicationEvent {
+ name: string;
+}
+export declare function getTopic(e: RuntimeEvent): string;
+export interface BaseEventMap {
+ [name: string]: any;
+ 'newListener': string;
+ 'listenerRemoved': string;
+}
diff --git a/types/openfin/v37/_v2/api/events/channel.d.ts b/types/openfin/v37/_v2/api/events/channel.d.ts
new file mode 100644
index 0000000000..3c448071cb
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/channel.d.ts
@@ -0,0 +1,10 @@
+import { BaseEventMap, ApplicationEvent } from './base';
+export interface ChannelEvent extends ApplicationEvent<'channel', Type> {
+ channelName: string;
+ channelId: string;
+ name?: string;
+}
+export interface ChannelEvents extends BaseEventMap {
+ 'connected': ChannelEvent<'connected'>;
+ 'disconnected': ChannelEvent<'disconnected'>;
+}
diff --git a/types/openfin/v37/_v2/api/events/emitterMap.d.ts b/types/openfin/v37/_v2/api/events/emitterMap.d.ts
new file mode 100644
index 0000000000..aa3fb498e8
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/emitterMap.d.ts
@@ -0,0 +1,15 @@
+///
+import { EventEmitter } from 'events';
+export declare class EmitterMap {
+ private storage;
+ constructor();
+ private hashKeys;
+ get(keys: EmitterAccessor): EventEmitter;
+ has(keys: EmitterAccessor): boolean;
+ delete(keys: EmitterAccessor): boolean;
+}
+export declare type SystemEmitterAccessor = ['system'];
+export declare type ApplicationEmitterAccessor = ['application', string];
+export declare type WindowEmitterAccessor = ['window', string, string];
+export declare type HotkeyEmitterAccessor = ['global-hotkey'];
+export declare type EmitterAccessor = SystemEmitterAccessor | ApplicationEmitterAccessor | WindowEmitterAccessor | HotkeyEmitterAccessor | string[];
diff --git a/types/openfin/v37/_v2/api/events/eventAggregator.d.ts b/types/openfin/v37/_v2/api/events/eventAggregator.d.ts
new file mode 100644
index 0000000000..ac7b7ca1b2
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/eventAggregator.d.ts
@@ -0,0 +1,5 @@
+import { Message } from '../../transport/transport';
+import { EmitterMap } from './emitterMap';
+export declare class EventAggregator extends EmitterMap {
+ dispatchEvent: (message: Message) => boolean;
+}
diff --git a/types/openfin/v37/_v2/api/events/externalApplication.d.ts b/types/openfin/v37/_v2/api/events/externalApplication.d.ts
new file mode 100644
index 0000000000..f7cd85f45d
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/externalApplication.d.ts
@@ -0,0 +1,5 @@
+import { RuntimeEvent, BaseEventMap } from './base';
+export interface ExternalApplicationEvents extends BaseEventMap {
+ connected: RuntimeEvent<'externalapplication', 'connected'>;
+ disconnected: RuntimeEvent<'externalapplication', 'disconnected'>;
+}
diff --git a/types/openfin/v37/_v2/api/events/frame.d.ts b/types/openfin/v37/_v2/api/events/frame.d.ts
new file mode 100644
index 0000000000..c31933e557
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/frame.d.ts
@@ -0,0 +1,9 @@
+import { BaseEventMap, WindowEvent } from './base';
+export interface FrameEvent extends WindowEvent<'frame', Type> {
+ entityType: 'iframe';
+ frameName: string;
+}
+export interface FrameEvents extends BaseEventMap {
+ connected: FrameEvent<'connected'>;
+ disconnected: FrameEvent<'disconnected'>;
+}
diff --git a/types/openfin/v37/_v2/api/events/globalHotkey.d.ts b/types/openfin/v37/_v2/api/events/globalHotkey.d.ts
new file mode 100644
index 0000000000..561baba446
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/globalHotkey.d.ts
@@ -0,0 +1,11 @@
+import { RuntimeEvent, BaseEventMap } from './base';
+import { Identity } from '../../identity';
+import { nonHotkeyEvents } from '../global-hotkey';
+export interface GlobalHotkeyEvent extends RuntimeEvent<'global-hotkey', Type> {
+ identity: Identity;
+ hotkey: string;
+}
+export interface GlobalHotkeyEvents extends BaseEventMap {
+ [nonHotkeyEvents.REGISTERED]: GlobalHotkeyEvent;
+ [nonHotkeyEvents.UNREGISTERED]: GlobalHotkeyEvent;
+}
diff --git a/types/openfin/v37/_v2/api/events/notifications.d.ts b/types/openfin/v37/_v2/api/events/notifications.d.ts
new file mode 100644
index 0000000000..a269817222
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/notifications.d.ts
@@ -0,0 +1,8 @@
+import { RuntimeEvent, BaseEventMap } from './base';
+export interface NotificationEvents extends BaseEventMap {
+ show: RuntimeEvent<'notification', 'show'>;
+ close: RuntimeEvent<'notification', 'close'>;
+ error: RuntimeEvent<'notification', 'error'>;
+ click: RuntimeEvent<'notification', 'click'>;
+ message: RuntimeEvent<'notification', 'message'>;
+}
diff --git a/types/openfin/v37/_v2/api/events/system.d.ts b/types/openfin/v37/_v2/api/events/system.d.ts
new file mode 100644
index 0000000000..20285a8862
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/system.d.ts
@@ -0,0 +1,22 @@
+import { BaseEvent, ApplicationEvent, BaseEventMap } from './base';
+import { MonitorInfo } from '../system/monitor';
+import { PropagatedWindowEvents } from './window';
+import { PropagatedApplicationEvents } from './application';
+export interface IdleEvent extends BaseEvent {
+ elapsedTime: number;
+ isIdle: boolean;
+}
+export declare type MonitorEvent = MonitorInfo & BaseEvent;
+export interface SessionChangedEvent extends BaseEvent {
+ reason: 'lock' | 'unlock' | 'remote-connect' | 'remote-disconnect' | 'unknown';
+}
+export interface SystemEventMapping extends BaseEventMap {
+ 'application-created': ApplicationEvent;
+ 'desktop-icon-clicked': ApplicationEvent;
+ 'idle-state-changed': IdleEvent;
+ 'monitor-info-changed': MonitorEvent;
+ 'session-changed': SessionChangedEvent;
+}
+export declare type SystemEvents = PropagatedWindowEvents<'system'> & PropagatedApplicationEvents<'system'> & {
+ [Type in keyof SystemEventMapping]: SystemEventMapping<'system', Type>[Type];
+};
diff --git a/types/openfin/v37/_v2/api/events/window.d.ts b/types/openfin/v37/_v2/api/events/window.d.ts
new file mode 100644
index 0000000000..85d4d553f0
--- /dev/null
+++ b/types/openfin/v37/_v2/api/events/window.d.ts
@@ -0,0 +1,176 @@
+import { CrashedEvent } from './application';
+import { WindowEvent, BaseEventMap } from './base';
+export declare type SpecificWindowEvent = WindowEvent<'window', Type>;
+export interface WindowAlertRequestedEvent extends WindowEvent {
+ message: string;
+ url: string;
+}
+export interface WindowAuthRequestedEvent extends WindowEvent {
+ authInfo: {
+ host: string;
+ isProxy: boolean;
+ port: number;
+ realm: string;
+ scheme: string;
+ };
+}
+export interface WindowEndLoadEvent extends WindowEvent {
+ documentName: string;
+ isMain: boolean;
+}
+export interface WindowNavigationRejectedEvent extends WindowEvent {
+ sourceName: string;
+ url: string;
+}
+export interface WindowReloadedEvent extends WindowEvent {
+ url: string;
+}
+export interface WindowExternalProcessExitedEvent extends WindowEvent {
+ processUuid: string;
+ exitCode: number;
+}
+export interface WindowExternalProcessStartedEvent extends WindowEvent {
+ processUuid: string;
+}
+export interface WindowHiddenEvent extends WindowEvent {
+ reason: 'closing' | 'hide' | 'hide-on-close';
+}
+export interface PreloadScriptInfoRunning {
+ state: 'load-started' | // started loading preload script
+ 'load-failed' | // preload script failed to load
+ 'load-succeeded' | // preload script is loaded and ready to be eval'ed
+ 'failed' | // preload script failed to eval
+ 'succeeded';
+}
+export interface PreloadScriptInfo {
+ state: 'load-failed' | // preload script failed to load
+ 'failed' | // preload script failed to eval
+ 'succeeded';
+}
+export interface WindowPreloadScriptsStateChangeEvent extends WindowEvent {
+ preloadScripts: (PreloadScriptInfoRunning & any)[];
+}
+export interface WindowPreloadScriptsStateChangedEvent extends WindowEvent {
+ preloadScripts: (PreloadScriptInfoRunning & any)[];
+}
+export interface WindowPreloadScriptsStateChangedEvent extends WindowEvent {
+ preloadScripts: (PreloadScriptInfo & any)[];
+}
+export interface WindowResourceLoadFailedEvent extends WindowEvent {
+ errorCode: number;
+ errorDescription: string;
+ validatedURL: string;
+ isMainFrame: boolean;
+}
+export interface WindowResourceResponseReceivedEvent extends WindowEvent {
+ status: boolean;
+ newUrl: string;
+ originalUrl: string;
+ httpResponseCode: number;
+ requestMethod: string;
+ referrer: string;
+ headers: any;
+ resourceType: 'mainFrame' | 'subFrame' | 'styleSheet' | 'script' | 'image' | 'object' | 'xhr' | 'other';
+}
+export interface WindowBeginBoundsChangingEvent extends WindowEvent {
+ height: number;
+ left: number;
+ top: number;
+ width: number;
+ windowState: 'minimized' | 'normal' | 'maximized';
+}
+export interface WindowBoundsChange extends WindowEvent {
+ changeType: 0 | 1 | 2;
+ deferred: boolean;
+ height: number;
+ left: number;
+ top: number;
+ width: number;
+}
+export interface WindowGroupChanged extends WindowEvent {
+ memberOf: 'source' | 'target' | 'nothing';
+ reason: 'leave' | 'join' | 'merge' | 'disband';
+ sourceGroup: {
+ appUuid: string;
+ windowName: string;
+ }[];
+ sourceWindowAppUuid: string;
+ sourceWindowName: string;
+ targetGroup: {
+ appUuid: string;
+ windowName: string;
+ }[];
+ targetWindowAppUuid: string;
+ targetWindowName: string;
+}
+export interface WindowEventMapping extends BaseEventMap {
+ 'auth-requested': WindowAuthRequestedEvent;
+ 'begin-user-bounds-changing': WindowBeginBoundsChangingEvent;
+ 'blurred': WindowEvent;
+ 'bounds-changed': WindowBoundsChange;
+ 'bounds-changing': WindowBoundsChange;
+ 'close-requested': WindowEvent;
+ 'closed': WindowEvent;
+ 'closing': WindowEvent;
+ 'crashed': CrashedEvent & WindowEvent;
+ 'disabled-frame-bounds-changed': WindowBoundsChange;
+ 'disabled-frame-bounds-changing': WindowBoundsChange;
+ 'embedded': WindowEvent;
+ 'end-user-bounds-changing': WindowBeginBoundsChangingEvent;
+ 'external-process-exited': WindowExternalProcessExitedEvent;
+ 'external-process-started': WindowExternalProcessStartedEvent;
+ 'focused': WindowEvent;
+ 'frame-disabled': WindowEvent;
+ 'frame-enabled': WindowEvent;
+ 'group-changed': WindowGroupChanged;
+ 'hidden': WindowHiddenEvent;
+ 'initialized': WindowEvent;
+ 'maximized': WindowEvent;
+ 'minimized': WindowEvent;
+ 'navigation-rejected': WindowNavigationRejectedEvent;
+ 'preload-scripts-state-changed': WindowPreloadScriptsStateChangeEvent;
+ 'preload-scripts-state-changing': WindowPreloadScriptsStateChangeEvent;
+ 'resource-load-failed': WindowResourceLoadFailedEvent;
+ 'resource-response-received': WindowResourceResponseReceivedEvent;
+ 'reloaded': WindowReloadedEvent;
+ 'restored': WindowEvent;
+ 'show-requested': WindowEvent;
+ 'shown': WindowEvent;
+}
+export interface PropagatedWindowEventMapping extends BaseEventMap {
+ 'window-begin-user-bounds-changing': WindowBeginBoundsChangingEvent;
+ 'window-blurred': WindowEvent;
+ 'window-bounds-changed': WindowBoundsChange;
+ 'window-bounds-changing': WindowBoundsChange;
+ 'window-closed': WindowEvent;
+ 'window-closing': WindowEvent;
+ 'window-crashed': CrashedEvent & WindowEvent;
+ 'window-disabled-frame-bounds-changed': WindowBoundsChange;
+ 'window-disabled-frame-bounds-changing': WindowBoundsChange;
+ 'window-embedded': WindowEvent;
+ 'window-end-user-bounds-changing': WindowBeginBoundsChangingEvent;
+ 'window-external-process-exited': WindowExternalProcessExitedEvent;
+ 'window-external-process-started': WindowExternalProcessStartedEvent;
+ 'window-focused': WindowEvent;
+ 'window-frame-disabled': WindowEvent;
+ 'window-frame-enabled': WindowEvent;
+ 'window-group-changed': WindowGroupChanged;
+ 'window-hidden': WindowHiddenEvent;
+ 'window-initialized': WindowEvent;
+ 'window-maximized': WindowEvent;
+ 'window-minimized': WindowEvent;
+ 'window-navigation-rejected': WindowNavigationRejectedEvent;
+ 'window-preload-scripts-state-changed': WindowPreloadScriptsStateChangeEvent;
+ 'window-preload-scripts-state-changing': WindowPreloadScriptsStateChangedEvent;
+ 'window-resource-load-failed': WindowResourceLoadFailedEvent;
+ 'window-resource-response-received': WindowResourceResponseReceivedEvent;
+ 'window-reloaded': WindowReloadedEvent;
+ 'window-restored': WindowEvent