@openfin/core 33.76.36 → 33.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OpenFin.d.ts +1 -1
- package/README.md +29 -4
- package/fin.d.ts +2 -2
- package/{src → out}/GlobalOpenFin.d.ts +1 -1
- package/out/mock-alpha.d.ts +16112 -0
- package/out/mock-beta.d.ts +16112 -0
- package/out/mock-public.d.ts +16112 -0
- package/out/mock.d.ts +16797 -0
- package/out/mock.js +17111 -0
- package/package.json +30 -23
- package/LICENSE +0 -13
- package/NOTICE +0 -16
- package/openfin-core-33.76.36.tgz +0 -0
- package/src/OpenFin.d.ts +0 -3091
- package/src/OpenFin.js +0 -2
- package/src/api/api-exposer/api-consumer.d.ts +0 -28
- package/src/api/api-exposer/api-consumer.js +0 -28
- package/src/api/api-exposer/api-exposer.d.ts +0 -35
- package/src/api/api-exposer/api-exposer.js +0 -38
- package/src/api/api-exposer/decorators.d.ts +0 -10
- package/src/api/api-exposer/decorators.js +0 -18
- package/src/api/api-exposer/index.d.ts +0 -4
- package/src/api/api-exposer/index.js +0 -20
- package/src/api/api-exposer/strategies/index.d.ts +0 -1
- package/src/api/api-exposer/strategies/index.js +0 -17
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
- package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
- package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
- package/src/api/application/Factory.d.ts +0 -196
- package/src/api/application/Factory.js +0 -278
- package/src/api/application/Instance.d.ts +0 -692
- package/src/api/application/Instance.js +0 -821
- package/src/api/application/index.d.ts +0 -12
- package/src/api/application/index.js +0 -28
- package/src/api/base.d.ts +0 -117
- package/src/api/base.js +0 -246
- package/src/api/clipboard/index.d.ts +0 -172
- package/src/api/clipboard/index.js +0 -200
- package/src/api/events/application.d.ts +0 -158
- package/src/api/events/application.js +0 -14
- package/src/api/events/base.d.ts +0 -42
- package/src/api/events/base.js +0 -2
- package/src/api/events/channel.d.ts +0 -35
- package/src/api/events/channel.js +0 -7
- package/src/api/events/emitterMap.d.ts +0 -11
- package/src/api/events/emitterMap.js +0 -35
- package/src/api/events/eventAggregator.d.ts +0 -5
- package/src/api/events/eventAggregator.js +0 -35
- package/src/api/events/externalApplication.d.ts +0 -24
- package/src/api/events/externalApplication.js +0 -7
- package/src/api/events/frame.d.ts +0 -35
- package/src/api/events/frame.js +0 -2
- package/src/api/events/globalHotkey.d.ts +0 -25
- package/src/api/events/globalHotkey.js +0 -2
- package/src/api/events/platform.d.ts +0 -34
- package/src/api/events/platform.js +0 -10
- package/src/api/events/system.d.ts +0 -126
- package/src/api/events/system.js +0 -15
- package/src/api/events/typedEventEmitter.d.ts +0 -20
- package/src/api/events/typedEventEmitter.js +0 -2
- package/src/api/events/view.d.ts +0 -92
- package/src/api/events/view.js +0 -12
- package/src/api/events/webcontents.d.ts +0 -277
- package/src/api/events/webcontents.js +0 -13
- package/src/api/events/window.d.ts +0 -421
- package/src/api/events/window.js +0 -12
- package/src/api/external-application/Factory.d.ts +0 -34
- package/src/api/external-application/Factory.js +0 -47
- package/src/api/external-application/Instance.d.ts +0 -110
- package/src/api/external-application/Instance.js +0 -117
- package/src/api/external-application/index.d.ts +0 -12
- package/src/api/external-application/index.js +0 -28
- package/src/api/fin.d.ts +0 -54
- package/src/api/fin.js +0 -45
- package/src/api/frame/Factory.d.ts +0 -54
- package/src/api/frame/Factory.js +0 -86
- package/src/api/frame/Instance.d.ts +0 -136
- package/src/api/frame/Instance.js +0 -143
- package/src/api/frame/index.d.ts +0 -14
- package/src/api/frame/index.js +0 -30
- package/src/api/global-hotkey/index.d.ts +0 -106
- package/src/api/global-hotkey/index.js +0 -132
- package/src/api/interappbus/channel/channel.d.ts +0 -285
- package/src/api/interappbus/channel/channel.js +0 -334
- package/src/api/interappbus/channel/channels-docs.d.ts +0 -342
- package/src/api/interappbus/channel/channels-docs.js +0 -401
- package/src/api/interappbus/channel/client.d.ts +0 -117
- package/src/api/interappbus/channel/client.js +0 -181
- package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
- package/src/api/interappbus/channel/connection-manager.js +0 -246
- package/src/api/interappbus/channel/index.d.ts +0 -189
- package/src/api/interappbus/channel/index.js +0 -333
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
- package/src/api/interappbus/channel/protocols/index.js +0 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
- package/src/api/interappbus/channel/protocols/strategy.js +0 -2
- package/src/api/interappbus/channel/provider.d.ts +0 -206
- package/src/api/interappbus/channel/provider.js +0 -338
- package/src/api/interappbus/index.d.ts +0 -120
- package/src/api/interappbus/index.js +0 -210
- package/src/api/interop/Factory.d.ts +0 -57
- package/src/api/interop/Factory.js +0 -96
- package/src/api/interop/InteropBroker.d.ts +0 -665
- package/src/api/interop/InteropBroker.js +0 -1313
- package/src/api/interop/InteropClient.d.ts +0 -502
- package/src/api/interop/InteropClient.js +0 -683
- package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
- package/src/api/interop/SessionContextGroupBroker.js +0 -108
- package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
- package/src/api/interop/SessionContextGroupClient.js +0 -86
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
- package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
- package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
- package/src/api/interop/fdc3/documentationStub.d.ts +0 -14
- package/src/api/interop/fdc3/documentationStub.js +0 -17
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -205
- package/src/api/interop/fdc3/fdc3-1.2.js +0 -435
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -298
- package/src/api/interop/fdc3/fdc3-2.0.js +0 -479
- package/src/api/interop/fdc3/fdc3.d.ts +0 -12
- package/src/api/interop/fdc3/fdc3.js +0 -35
- package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
- package/src/api/interop/fdc3/overrideCheck.js +0 -32
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
- package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
- package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
- package/src/api/interop/fdc3/utils.d.ts +0 -45
- package/src/api/interop/fdc3/utils.js +0 -239
- package/src/api/interop/fdc3/versions.d.ts +0 -1
- package/src/api/interop/fdc3/versions.js +0 -2
- package/src/api/interop/index.d.ts +0 -12
- package/src/api/interop/index.js +0 -28
- package/src/api/interop/utils.d.ts +0 -18
- package/src/api/interop/utils.js +0 -61
- package/src/api/me.d.ts +0 -40
- package/src/api/me.js +0 -134
- package/src/api/platform/Factory.d.ts +0 -171
- package/src/api/platform/Factory.js +0 -240
- package/src/api/platform/Instance.d.ts +0 -653
- package/src/api/platform/Instance.js +0 -834
- package/src/api/platform/common-utils.d.ts +0 -7
- package/src/api/platform/common-utils.js +0 -16
- package/src/api/platform/index.d.ts +0 -12
- package/src/api/platform/index.js +0 -28
- package/src/api/platform/layout/Factory.d.ts +0 -91
- package/src/api/platform/layout/Factory.js +0 -151
- package/src/api/platform/layout/Instance.d.ts +0 -192
- package/src/api/platform/layout/Instance.js +0 -224
- package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
- package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
- package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
- package/src/api/platform/layout/entities/layout-entities.d.ts +0 -427
- package/src/api/platform/layout/entities/layout-entities.js +0 -504
- package/src/api/platform/layout/entities/shapes.d.ts +0 -6
- package/src/api/platform/layout/entities/shapes.js +0 -2
- package/src/api/platform/layout/index.d.ts +0 -11
- package/src/api/platform/layout/index.js +0 -27
- package/src/api/platform/layout/layout.constants.d.ts +0 -1
- package/src/api/platform/layout/layout.constants.js +0 -4
- package/src/api/platform/layout/shapes.d.ts +0 -16
- package/src/api/platform/layout/shapes.js +0 -2
- package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
- package/src/api/platform/layout/utils/layout-traversal.js +0 -65
- package/src/api/platform/provider.d.ts +0 -510
- package/src/api/platform/provider.js +0 -2
- package/src/api/snapshot-source/Factory.d.ts +0 -53
- package/src/api/snapshot-source/Factory.js +0 -81
- package/src/api/snapshot-source/Instance.d.ts +0 -53
- package/src/api/snapshot-source/Instance.js +0 -154
- package/src/api/snapshot-source/index.d.ts +0 -12
- package/src/api/snapshot-source/index.js +0 -28
- package/src/api/snapshot-source/utils.d.ts +0 -2
- package/src/api/snapshot-source/utils.js +0 -6
- package/src/api/system/index.d.ts +0 -1468
- package/src/api/system/index.js +0 -1851
- package/src/api/view/Factory.d.ts +0 -88
- package/src/api/view/Factory.js +0 -141
- package/src/api/view/Instance.d.ts +0 -601
- package/src/api/view/Instance.js +0 -671
- package/src/api/view/index.d.ts +0 -12
- package/src/api/view/index.js +0 -28
- package/src/api/webcontents/main.d.ts +0 -922
- package/src/api/webcontents/main.js +0 -1046
- package/src/api/window/Factory.d.ts +0 -96
- package/src/api/window/Factory.js +0 -142
- package/src/api/window/Instance.d.ts +0 -1598
- package/src/api/window/Instance.js +0 -1851
- package/src/api/window/index.d.ts +0 -14
- package/src/api/window/index.js +0 -30
- package/src/browser.d.ts +0 -10
- package/src/browser.js +0 -36
- package/src/environment/browser.d.ts +0 -29
- package/src/environment/browser.js +0 -60
- package/src/environment/environment.d.ts +0 -33
- package/src/environment/environment.js +0 -4
- package/src/environment/mockEnvironment.d.ts +0 -27
- package/src/environment/mockEnvironment.js +0 -61
- package/src/environment/node-env.d.ts +0 -29
- package/src/environment/node-env.js +0 -72
- package/src/fdc3.d.ts +0 -3
- package/src/fdc3.js +0 -9
- package/src/mock.d.ts +0 -3
- package/src/mock.js +0 -18
- package/src/namespaces.d.ts +0 -22
- package/src/namespaces.js +0 -26
- package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
- package/src/shapes/ERROR_BOX_TYPES.js +0 -2
- package/src/shapes/WebOptions.d.ts +0 -13
- package/src/shapes/WebOptions.js +0 -2
- package/src/shapes/WindowOptions.d.ts +0 -43
- package/src/shapes/WindowOptions.js +0 -2
- package/src/shapes/protocol.d.ts +0 -204
- package/src/shapes/protocol.js +0 -2
- package/src/transport/mockWire.d.ts +0 -11
- package/src/transport/mockWire.js +0 -26
- package/src/transport/transport-errors.d.ts +0 -31
- package/src/transport/transport-errors.js +0 -79
- package/src/transport/transport.d.ts +0 -73
- package/src/transport/transport.js +0 -219
- package/src/transport/wire.d.ts +0 -77
- package/src/transport/wire.js +0 -36
- package/src/util/asyncFilter.d.ts +0 -1
- package/src/util/asyncFilter.js +0 -7
- package/src/util/channel-api-relay.d.ts +0 -13
- package/src/util/channel-api-relay.js +0 -47
- package/src/util/errors.d.ts +0 -10
- package/src/util/errors.js +0 -12
- package/src/util/exhaustive.d.ts +0 -1
- package/src/util/exhaustive.js +0 -7
- package/src/util/http.d.ts +0 -11
- package/src/util/http.js +0 -90
- package/src/util/inaccessibleObject.d.ts +0 -2
- package/src/util/inaccessibleObject.js +0 -49
- package/src/util/lazy.d.ts +0 -34
- package/src/util/lazy.js +0 -54
- package/src/util/normalize-config.d.ts +0 -3
- package/src/util/normalize-config.js +0 -52
- package/src/util/promises.d.ts +0 -5
- package/src/util/promises.js +0 -27
- package/src/util/ref-counter.d.ts +0 -7
- package/src/util/ref-counter.js +0 -52
- package/src/util/reversible-map.d.ts +0 -11
- package/src/util/reversible-map.js +0 -49
- package/src/util/runtimeVersioning.d.ts +0 -3
- package/src/util/runtimeVersioning.js +0 -25
- package/src/util/utilTypes.d.ts +0 -8
- package/src/util/utilTypes.js +0 -2
- package/src/util/validate.d.ts +0 -3
- package/src/util/validate.js +0 -11
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entry point for the OpenFin Application namespace.
|
|
3
|
-
*
|
|
4
|
-
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "ApplicationModule" is used for
|
|
5
|
-
* the module containing static members of the `Application` namespace (available under `fin.Application`), while `Application` documents
|
|
6
|
-
* instances of the OpenFin `Application` class.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import ApplicationModule from './Factory';
|
|
11
|
-
export * from './Instance';
|
|
12
|
-
export default ApplicationModule;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/**
|
|
18
|
-
* Entry point for the OpenFin Application namespace.
|
|
19
|
-
*
|
|
20
|
-
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "ApplicationModule" is used for
|
|
21
|
-
* the module containing static members of the `Application` namespace (available under `fin.Application`), while `Application` documents
|
|
22
|
-
* instances of the OpenFin `Application` class.
|
|
23
|
-
*
|
|
24
|
-
* @packageDocumentation
|
|
25
|
-
*/
|
|
26
|
-
const Factory_1 = require("./Factory");
|
|
27
|
-
__exportStar(require("./Instance"), exports);
|
|
28
|
-
exports.default = Factory_1.default;
|
package/src/api/base.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { Transport } from '../transport/transport';
|
|
4
|
-
import type * as OpenFin from '../OpenFin';
|
|
5
|
-
import { BaseEvent, EventHandler } from './events/base';
|
|
6
|
-
type ApplicationIdentity = OpenFin.ApplicationIdentity;
|
|
7
|
-
type Identity = OpenFin.Identity;
|
|
8
|
-
export declare class Base {
|
|
9
|
-
wire: Transport;
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
constructor(wire: Transport);
|
|
14
|
-
protected get fin(): OpenFin.Fin<OpenFin.EntityType>;
|
|
15
|
-
get me(): Identity;
|
|
16
|
-
protected isNodeEnvironment: () => boolean;
|
|
17
|
-
protected isOpenFinEnvironment: () => boolean;
|
|
18
|
-
protected isBrowserEnvironment: () => boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* An entity that emits OpenFin events.
|
|
22
|
-
*
|
|
23
|
-
* @remarks Event-binding methods are asynchronous as they must cross process boundaries
|
|
24
|
-
* and setup the listener in the browser process. When the `EventEmitter` receives an event from the browser process
|
|
25
|
-
* and emits on the renderer, all of the functions attached to that specific event are called synchronously. Any values
|
|
26
|
-
* returned by the called listeners are ignored and will be discarded. If the execution context of the window is destroyed
|
|
27
|
-
* by page navigation or reload, any events that have been setup in that context will be destroyed.
|
|
28
|
-
*
|
|
29
|
-
* It is important to keep in mind that when an ordinary listener function is called, the standard `this` keyword is intentionally
|
|
30
|
-
* set to reference the `EventEmitter` instance to which the listener is attached. It is possible to use ES6 Arrow Functions as
|
|
31
|
-
* listeners, however, when doing so, the `this` keyword will no longer reference the `EventEmitter` instance.
|
|
32
|
-
*
|
|
33
|
-
* Events re-propagate from smaller/more-local scopes to larger/more-global scopes. For example, an event emitted on a specific
|
|
34
|
-
* view will propagate to the window in which the view is embedded, and then to the application in which the window is running, and
|
|
35
|
-
* finally to the OpenFin runtime itself at the "system" level. Re-propagated events are prefixed with the name of the scope in which
|
|
36
|
-
* they originated - for example, a "shown" event emitted on a view will be re-propagated at the window level as "view-shown", and
|
|
37
|
-
* then to the application as "window-view-shown", and finally at the system level as "application-window-view-shown".
|
|
38
|
-
*
|
|
39
|
-
* All event propagations are visible at the System level, regardless of source, so transitive re-propagations (e.g. from view to window
|
|
40
|
-
* to application) are visible in their entirety at the system level. So, we can listen to the above event as "shown", "view-shown",
|
|
41
|
-
* "window-view-shown", or "application-window-view-shown."
|
|
42
|
-
*/
|
|
43
|
-
export declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventType extends EmitterEvent['type'] = EmitterEvent['type']> extends Base {
|
|
44
|
-
#private;
|
|
45
|
-
private topic;
|
|
46
|
-
protected identity: ApplicationIdentity;
|
|
47
|
-
constructor(wire: Transport, topic: string, ...additionalAccessors: string[]);
|
|
48
|
-
eventNames: () => (string | symbol)[];
|
|
49
|
-
emit: <EventType extends EmitterEventType>(eventType: EventType, payload: Extract<EmitterEvent, {
|
|
50
|
-
type: EventType;
|
|
51
|
-
}>, ...args: any[]) => boolean;
|
|
52
|
-
private hasEmitter;
|
|
53
|
-
private getOrCreateEmitter;
|
|
54
|
-
listeners: (type: string | symbol) => Function[];
|
|
55
|
-
listenerCount: (type: string | symbol) => number;
|
|
56
|
-
protected registerEventListener: (eventType: EmitterEventType, options: OpenFin.SubscriptionOptions, applySubscription: (emitter: EventEmitter) => void, undoSubscription: (emitter: EventEmitter) => void) => Promise<void>;
|
|
57
|
-
protected deregisterEventListener: (eventType: EmitterEventType, options?: OpenFin.SubscriptionOptions) => Promise<void | EventEmitter>;
|
|
58
|
-
/**
|
|
59
|
-
* Adds a listener to the end of the listeners array for the specified event.
|
|
60
|
-
*
|
|
61
|
-
* @param eventType
|
|
62
|
-
* @param listener
|
|
63
|
-
* @param options
|
|
64
|
-
*/
|
|
65
|
-
on<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
66
|
-
addListener: <EventType extends EmitterEventType>(eventType: EventType, listener: OpenFin.BaseEvents.EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions) => Promise<this>;
|
|
67
|
-
/**
|
|
68
|
-
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
69
|
-
*
|
|
70
|
-
* @param eventType
|
|
71
|
-
* @param listener
|
|
72
|
-
* @param options
|
|
73
|
-
*/
|
|
74
|
-
once<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
75
|
-
/**
|
|
76
|
-
* Adds a listener to the beginning of the listeners array for the specified event.
|
|
77
|
-
*
|
|
78
|
-
* @param eventType
|
|
79
|
-
* @param listener
|
|
80
|
-
* @param options
|
|
81
|
-
*/
|
|
82
|
-
prependListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
83
|
-
/**
|
|
84
|
-
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired,
|
|
85
|
-
* after which it is removed. The listener is added to the beginning of the listeners array.
|
|
86
|
-
*
|
|
87
|
-
* @param eventType
|
|
88
|
-
* @param listener
|
|
89
|
-
* @param options
|
|
90
|
-
*/
|
|
91
|
-
prependOnceListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
92
|
-
/**
|
|
93
|
-
* Remove a listener from the listener array for the specified event.
|
|
94
|
-
*
|
|
95
|
-
* @remarks Caution: Calling this method changes the array indices in the listener array behind the listener.
|
|
96
|
-
*
|
|
97
|
-
* @param eventType
|
|
98
|
-
* @param listener
|
|
99
|
-
* @param options
|
|
100
|
-
*/
|
|
101
|
-
removeListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
102
|
-
protected deregisterAllListeners(eventType: EmitterEventType): Promise<EventEmitter | void>;
|
|
103
|
-
/**
|
|
104
|
-
* Removes all listeners, or those of the specified event.
|
|
105
|
-
*
|
|
106
|
-
* @param eventType
|
|
107
|
-
*/
|
|
108
|
-
removeAllListeners(eventType?: EmitterEventType): Promise<this>;
|
|
109
|
-
private deleteEmitterIfNothingRegistered;
|
|
110
|
-
}
|
|
111
|
-
export declare class Reply<TOPIC extends string, TYPE extends string | void> implements Identity {
|
|
112
|
-
topic: TOPIC;
|
|
113
|
-
type: TYPE;
|
|
114
|
-
uuid: string;
|
|
115
|
-
name: string;
|
|
116
|
-
}
|
|
117
|
-
export {};
|
package/src/api/base.js
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _EmitterBase_emitterAccessor;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Reply = exports.EmitterBase = exports.Base = void 0;
|
|
16
|
-
const promises_1 = require("../util/promises");
|
|
17
|
-
class Base {
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
constructor(wire) {
|
|
22
|
-
this.isNodeEnvironment = () => {
|
|
23
|
-
return this.wire.environment.constructor.name === 'NodeEnvironment';
|
|
24
|
-
};
|
|
25
|
-
this.isOpenFinEnvironment = () => {
|
|
26
|
-
return this.wire.environment.constructor.name === 'OpenFinEnvironment';
|
|
27
|
-
};
|
|
28
|
-
this.isBrowserEnvironment = () => {
|
|
29
|
-
return this.wire.environment.constructor.name === 'BrowserEnvironment';
|
|
30
|
-
};
|
|
31
|
-
this.wire = wire;
|
|
32
|
-
}
|
|
33
|
-
get fin() {
|
|
34
|
-
return this.wire.getFin();
|
|
35
|
-
}
|
|
36
|
-
get me() {
|
|
37
|
-
return this.wire.me;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.Base = Base;
|
|
41
|
-
/**
|
|
42
|
-
* An entity that emits OpenFin events.
|
|
43
|
-
*
|
|
44
|
-
* @remarks Event-binding methods are asynchronous as they must cross process boundaries
|
|
45
|
-
* and setup the listener in the browser process. When the `EventEmitter` receives an event from the browser process
|
|
46
|
-
* and emits on the renderer, all of the functions attached to that specific event are called synchronously. Any values
|
|
47
|
-
* returned by the called listeners are ignored and will be discarded. If the execution context of the window is destroyed
|
|
48
|
-
* by page navigation or reload, any events that have been setup in that context will be destroyed.
|
|
49
|
-
*
|
|
50
|
-
* It is important to keep in mind that when an ordinary listener function is called, the standard `this` keyword is intentionally
|
|
51
|
-
* set to reference the `EventEmitter` instance to which the listener is attached. It is possible to use ES6 Arrow Functions as
|
|
52
|
-
* listeners, however, when doing so, the `this` keyword will no longer reference the `EventEmitter` instance.
|
|
53
|
-
*
|
|
54
|
-
* Events re-propagate from smaller/more-local scopes to larger/more-global scopes. For example, an event emitted on a specific
|
|
55
|
-
* view will propagate to the window in which the view is embedded, and then to the application in which the window is running, and
|
|
56
|
-
* finally to the OpenFin runtime itself at the "system" level. Re-propagated events are prefixed with the name of the scope in which
|
|
57
|
-
* they originated - for example, a "shown" event emitted on a view will be re-propagated at the window level as "view-shown", and
|
|
58
|
-
* then to the application as "window-view-shown", and finally at the system level as "application-window-view-shown".
|
|
59
|
-
*
|
|
60
|
-
* All event propagations are visible at the System level, regardless of source, so transitive re-propagations (e.g. from view to window
|
|
61
|
-
* to application) are visible in their entirety at the system level. So, we can listen to the above event as "shown", "view-shown",
|
|
62
|
-
* "window-view-shown", or "application-window-view-shown."
|
|
63
|
-
*/
|
|
64
|
-
class EmitterBase extends Base {
|
|
65
|
-
constructor(wire, topic, ...additionalAccessors) {
|
|
66
|
-
super(wire);
|
|
67
|
-
this.topic = topic;
|
|
68
|
-
_EmitterBase_emitterAccessor.set(this, void 0);
|
|
69
|
-
this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
|
|
70
|
-
this.emit = (eventType, payload, ...args) => {
|
|
71
|
-
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
72
|
-
};
|
|
73
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet(this, _EmitterBase_emitterAccessor, "f"));
|
|
74
|
-
this.getOrCreateEmitter = () => this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet(this, _EmitterBase_emitterAccessor, "f"));
|
|
75
|
-
this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
|
|
76
|
-
this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
|
|
77
|
-
this.registerEventListener = async (eventType, options = {}, applySubscription, undoSubscription) => {
|
|
78
|
-
const runtimeEvent = {
|
|
79
|
-
...this.identity,
|
|
80
|
-
timestamp: options.timestamp || Date.now(),
|
|
81
|
-
topic: this.topic,
|
|
82
|
-
type: eventType
|
|
83
|
-
};
|
|
84
|
-
const emitter = this.getOrCreateEmitter();
|
|
85
|
-
// We apply the subscription and then undo if the async call fails to avoid
|
|
86
|
-
// indeterminacy in subscription application order, which can break things elsewhere
|
|
87
|
-
applySubscription(emitter);
|
|
88
|
-
try {
|
|
89
|
-
await this.wire.sendAction('subscribe-to-desktop-event', runtimeEvent);
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
undoSubscription(emitter);
|
|
93
|
-
this.deleteEmitterIfNothingRegistered(emitter);
|
|
94
|
-
throw e;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
this.deregisterEventListener = async (eventType, options = {}) => {
|
|
98
|
-
if (this.hasEmitter()) {
|
|
99
|
-
const runtimeEvent = {
|
|
100
|
-
...this.identity,
|
|
101
|
-
timestamp: options.timestamp || Date.now(),
|
|
102
|
-
topic: this.topic,
|
|
103
|
-
type: eventType
|
|
104
|
-
};
|
|
105
|
-
await this.wire.sendAction('unsubscribe-to-desktop-event', runtimeEvent).catch(() => null);
|
|
106
|
-
const emitter = this.getOrCreateEmitter();
|
|
107
|
-
return emitter;
|
|
108
|
-
}
|
|
109
|
-
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
110
|
-
return Promise.resolve();
|
|
111
|
-
};
|
|
112
|
-
this.addListener = this.on;
|
|
113
|
-
__classPrivateFieldSet(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
114
|
-
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Adds a listener to the end of the listeners array for the specified event.
|
|
118
|
-
*
|
|
119
|
-
* @param eventType
|
|
120
|
-
* @param listener
|
|
121
|
-
* @param options
|
|
122
|
-
*/
|
|
123
|
-
async on(eventType, listener, options) {
|
|
124
|
-
await this.registerEventListener(eventType, options, (emitter) => {
|
|
125
|
-
emitter.on(eventType, listener);
|
|
126
|
-
}, (emitter) => {
|
|
127
|
-
emitter.removeListener(eventType, listener);
|
|
128
|
-
});
|
|
129
|
-
return this;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
133
|
-
*
|
|
134
|
-
* @param eventType
|
|
135
|
-
* @param listener
|
|
136
|
-
* @param options
|
|
137
|
-
*/
|
|
138
|
-
async once(eventType, listener, options) {
|
|
139
|
-
const deregister = () => this.deregisterEventListener(eventType);
|
|
140
|
-
await this.registerEventListener(eventType, options, (emitter) => {
|
|
141
|
-
emitter.once(eventType, deregister);
|
|
142
|
-
emitter.once(eventType, listener);
|
|
143
|
-
}, (emitter) => {
|
|
144
|
-
emitter.removeListener(eventType, deregister);
|
|
145
|
-
emitter.removeListener(eventType, listener);
|
|
146
|
-
});
|
|
147
|
-
return this;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Adds a listener to the beginning of the listeners array for the specified event.
|
|
151
|
-
*
|
|
152
|
-
* @param eventType
|
|
153
|
-
* @param listener
|
|
154
|
-
* @param options
|
|
155
|
-
*/
|
|
156
|
-
async prependListener(eventType, listener, options) {
|
|
157
|
-
await this.registerEventListener(eventType, options, (emitter) => {
|
|
158
|
-
emitter.prependListener(eventType, listener);
|
|
159
|
-
}, (emitter) => {
|
|
160
|
-
emitter.removeListener(eventType, listener);
|
|
161
|
-
});
|
|
162
|
-
return this;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired,
|
|
166
|
-
* after which it is removed. The listener is added to the beginning of the listeners array.
|
|
167
|
-
*
|
|
168
|
-
* @param eventType
|
|
169
|
-
* @param listener
|
|
170
|
-
* @param options
|
|
171
|
-
*/
|
|
172
|
-
async prependOnceListener(eventType, listener, options) {
|
|
173
|
-
const deregister = () => this.deregisterEventListener(eventType);
|
|
174
|
-
await this.registerEventListener(eventType, options, (emitter) => {
|
|
175
|
-
emitter.prependOnceListener(eventType, listener);
|
|
176
|
-
emitter.once(eventType, deregister);
|
|
177
|
-
}, (emitter) => {
|
|
178
|
-
emitter.removeListener(eventType, listener);
|
|
179
|
-
emitter.removeListener(eventType, deregister);
|
|
180
|
-
});
|
|
181
|
-
return this;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Remove a listener from the listener array for the specified event.
|
|
185
|
-
*
|
|
186
|
-
* @remarks Caution: Calling this method changes the array indices in the listener array behind the listener.
|
|
187
|
-
*
|
|
188
|
-
* @param eventType
|
|
189
|
-
* @param listener
|
|
190
|
-
* @param options
|
|
191
|
-
*/
|
|
192
|
-
async removeListener(eventType, listener, options) {
|
|
193
|
-
const emitter = await this.deregisterEventListener(eventType, options);
|
|
194
|
-
if (emitter) {
|
|
195
|
-
emitter.removeListener(eventType, listener);
|
|
196
|
-
this.deleteEmitterIfNothingRegistered(emitter);
|
|
197
|
-
}
|
|
198
|
-
return this;
|
|
199
|
-
}
|
|
200
|
-
async deregisterAllListeners(eventType) {
|
|
201
|
-
const runtimeEvent = { ...this.identity, type: eventType, topic: this.topic };
|
|
202
|
-
if (this.hasEmitter()) {
|
|
203
|
-
const emitter = this.getOrCreateEmitter();
|
|
204
|
-
const refCount = emitter.listenerCount(runtimeEvent.type);
|
|
205
|
-
const unsubscribePromises = [];
|
|
206
|
-
for (let i = 0; i < refCount; i++) {
|
|
207
|
-
unsubscribePromises.push(this.wire.sendAction('unsubscribe-to-desktop-event', runtimeEvent).catch(() => null));
|
|
208
|
-
}
|
|
209
|
-
await Promise.all(unsubscribePromises);
|
|
210
|
-
return emitter;
|
|
211
|
-
}
|
|
212
|
-
return undefined;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Removes all listeners, or those of the specified event.
|
|
216
|
-
*
|
|
217
|
-
* @param eventType
|
|
218
|
-
*/
|
|
219
|
-
async removeAllListeners(eventType) {
|
|
220
|
-
const removeByEvent = async (event) => {
|
|
221
|
-
const emitter = await this.deregisterAllListeners(event);
|
|
222
|
-
if (emitter) {
|
|
223
|
-
emitter.removeAllListeners(event);
|
|
224
|
-
this.deleteEmitterIfNothingRegistered(emitter);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
if (eventType) {
|
|
228
|
-
await removeByEvent(eventType);
|
|
229
|
-
}
|
|
230
|
-
else if (this.hasEmitter()) {
|
|
231
|
-
const events = this.getOrCreateEmitter().eventNames();
|
|
232
|
-
await (0, promises_1.promiseMap)(events, removeByEvent);
|
|
233
|
-
}
|
|
234
|
-
return this;
|
|
235
|
-
}
|
|
236
|
-
deleteEmitterIfNothingRegistered(emitter) {
|
|
237
|
-
if (emitter.eventNames().length === 0) {
|
|
238
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet(this, _EmitterBase_emitterAccessor, "f"));
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
exports.EmitterBase = EmitterBase;
|
|
243
|
-
_EmitterBase_emitterAccessor = new WeakMap();
|
|
244
|
-
class Reply {
|
|
245
|
-
}
|
|
246
|
-
exports.Reply = Reply;
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type * as OpenFin from '../../OpenFin';
|
|
2
|
-
import { Base } from '../base';
|
|
3
|
-
/**
|
|
4
|
-
* @PORTED
|
|
5
|
-
* WriteRequestType interface
|
|
6
|
-
* @typedef { object } WriteRequestType
|
|
7
|
-
* @property { string } data Data to be written
|
|
8
|
-
* @property { string } [type] Clipboard Type
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @PORTED
|
|
12
|
-
* OpenFin.WriteAnyClipboardRequest interface
|
|
13
|
-
* @typedef { object } OpenFin.WriteAnyClipboardRequest
|
|
14
|
-
* @property { string } data Data to be written
|
|
15
|
-
* @property { OpenFin.ClipboardSelectionType } [type] Clipboard Type defaults to 'clipboard', use 'selection' for linux
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
export default class Clipboard extends Base {
|
|
22
|
-
/**
|
|
23
|
-
* Writes data into the clipboard as plain text
|
|
24
|
-
* @param writeObj The object for writing data into the clipboard
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```js
|
|
28
|
-
* fin.Clipboard.writeText({
|
|
29
|
-
* data: 'hello, world'
|
|
30
|
-
* }).then(() => console.log('Text On clipboard')).catch(err => console.log(err));
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
writeText(writeObj: OpenFin.WriteClipboardRequest): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Read the content of the clipboard as plain text
|
|
36
|
-
* @param type Clipboard Type defaults to 'clipboard', use 'selection' for linux
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```js
|
|
40
|
-
* fin.Clipboard.readText().then(text => console.log(text)).catch(err => console.log(err));
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
readText(type?: OpenFin.ClipboardSelectionType): Promise<string>;
|
|
44
|
-
/**
|
|
45
|
-
* Writes data into the clipboard as an Image
|
|
46
|
-
* @param writeRequest The object to write an image to the clipboard
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```js
|
|
50
|
-
* fin.Clipboard.writeImage({
|
|
51
|
-
* // raw base64 string, or dataURL of either data:image/png or data:image/jpeg type
|
|
52
|
-
* image: '...'
|
|
53
|
-
* }).then(() => console.log('Image written to clipboard')).catch(err => console.log(err));
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
writeImage(writeRequest: OpenFin.WriteImageClipboardRequest): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Read the content of the clipboard as a base64 string or a dataURL based on the input parameter 'format', defaults to 'dataURL'
|
|
59
|
-
* @param readRequest Clipboard Read Image request with formatting options
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```js
|
|
63
|
-
* // see TS type: OpenFin.ImageFormatOptions
|
|
64
|
-
*
|
|
65
|
-
* const pngOrDataURLOrBmpOptions = {
|
|
66
|
-
* format: 'png', // can be: 'png' | 'dataURL' | 'bmp'
|
|
67
|
-
* };
|
|
68
|
-
*
|
|
69
|
-
* const jpgOptions = {
|
|
70
|
-
* format: 'jpg',
|
|
71
|
-
* quality: 80 // optional, if omitted defaults to 100
|
|
72
|
-
* };
|
|
73
|
-
*
|
|
74
|
-
* fin.Clipboard.readImage(pngOrDataURLOrBmpOptions)
|
|
75
|
-
* .then(image => console.log('Image read from clipboard as PNG, DataURL or BMP', image))
|
|
76
|
-
* .catch(err => console.log(err));
|
|
77
|
-
*
|
|
78
|
-
* fin.Clipboard.readImage(jpgOptions)
|
|
79
|
-
* .then(image => console.log('Image read from clipboard as JPG', image))
|
|
80
|
-
* .catch(err => console.log(err));
|
|
81
|
-
*
|
|
82
|
-
* // defaults to {format: 'dataURL'}
|
|
83
|
-
* fin.Clipboard.readImage()
|
|
84
|
-
* .then(image => console.log('Image read from clipboard as DataURL', image))
|
|
85
|
-
* .catch(err => console.log(err));
|
|
86
|
-
*
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
readImage(readRequest?: OpenFin.ReadImageClipboardRequest): Promise<string>;
|
|
90
|
-
/**
|
|
91
|
-
* Writes data into the clipboard as Html
|
|
92
|
-
* @param writeObj The object for writing data into the clipboard
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```js
|
|
96
|
-
* fin.Clipboard.writeHtml({
|
|
97
|
-
* data: '<h1>Hello, World!</h1>'
|
|
98
|
-
* }).then(() => console.log('HTML On clipboard')).catch(err => console.log(err));
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
writeHtml(writeObj: OpenFin.WriteClipboardRequest): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Read the content of the clipboard as Html
|
|
104
|
-
* @param type Clipboard Type defaults to 'clipboard', use 'selection' for linux
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```js
|
|
108
|
-
* fin.Clipboard.readHtml().then(html => console.log(html)).catch(err => console.log(err));
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
readHtml(type?: OpenFin.ClipboardSelectionType): Promise<string>;
|
|
112
|
-
/**
|
|
113
|
-
* Writes data into the clipboard as Rtf
|
|
114
|
-
* @param writeObj The object for writing data into the clipboard
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```js
|
|
118
|
-
* fin.Clipboard.writeRtf({
|
|
119
|
-
* data: 'some text goes here'
|
|
120
|
-
* }).then(() => console.log('RTF On clipboard')).catch(err => console.log(err));
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
writeRtf(writeObj: OpenFin.WriteClipboardRequest): Promise<void>;
|
|
124
|
-
/**
|
|
125
|
-
* Read the content of the clipboard as Rtf
|
|
126
|
-
* @param type Clipboard Type defaults to 'clipboard', use 'selection' for linux
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
*
|
|
130
|
-
* ```js
|
|
131
|
-
* const writeObj = {
|
|
132
|
-
* data: 'some text goes here'
|
|
133
|
-
* };
|
|
134
|
-
* async function readRtf() {
|
|
135
|
-
* await fin.Clipboard.writeRtf(writeObj);
|
|
136
|
-
* return await fin.Clipboard.readRtf();
|
|
137
|
-
* }
|
|
138
|
-
* readRtf().then(rtf => console.log(rtf)).catch(err => console.log(err));
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
readRtf(type?: OpenFin.ClipboardSelectionType): Promise<string>;
|
|
142
|
-
/**
|
|
143
|
-
* Writes data into the clipboard
|
|
144
|
-
* @param writeObj The object for writing data into the clipboard
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```js
|
|
148
|
-
* fin.Clipboard.write({
|
|
149
|
-
* data: {
|
|
150
|
-
* text: 'a',
|
|
151
|
-
* html: 'b',
|
|
152
|
-
* rtf: 'c',
|
|
153
|
-
* // Can be either a base64 string, or a DataURL string. If using DataURL, the
|
|
154
|
-
* // supported formats are `data:image/png[;base64],` and `data:image/jpeg[;base64],`.
|
|
155
|
-
* // Using other image/<format> DataURLs will throw an Error.
|
|
156
|
-
* image: '...'
|
|
157
|
-
* }
|
|
158
|
-
* }).then(() => console.log('write data into clipboard')).catch(err => console.log(err));
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
write(writeObj: OpenFin.WriteAnyClipboardRequest): Promise<void>;
|
|
162
|
-
/**
|
|
163
|
-
* Reads available formats for the clipboard type
|
|
164
|
-
* @param type Clipboard Type defaults to 'clipboard', use 'selection' for linux
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```js
|
|
168
|
-
* fin.Clipboard.getAvailableFormats().then(formats => console.log(formats)).catch(err => console.log(err));
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
getAvailableFormats(type?: OpenFin.ClipboardSelectionType): Promise<Array<string>>;
|
|
172
|
-
}
|