@finsemble/finsemble-electron-adapter 0.0.0
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/LICENSE +1 -0
- package/README.md +9 -0
- package/dist/app.d.ts +1 -0
- package/dist/app.js +3 -0
- package/dist/app.js.LICENSE.txt +334 -0
- package/dist/app.js.map +1 -0
- package/dist/deploy/deploymentHelpers.d.ts +46 -0
- package/dist/deploy/installer.d.ts +5 -0
- package/dist/deploy/packageCreator.d.ts +4 -0
- package/dist/e2o.d.ts +2 -0
- package/dist/e2o.js +2 -0
- package/dist/e2o.js.map +1 -0
- package/dist/exports.d.ts +16 -0
- package/dist/exports.js +3 -0
- package/dist/exports.js.LICENSE.txt +334 -0
- package/dist/exports.js.map +1 -0
- package/dist/logger/classes/LoggerMain.d.ts +30 -0
- package/dist/logger/classes/LoggerRenderer.d.ts +11 -0
- package/dist/logger/colorizer.d.ts +2 -0
- package/dist/logger/config.d.ts +12 -0
- package/dist/logger/formatters/basic.d.ts +2 -0
- package/dist/logger/main.d.ts +2 -0
- package/dist/logger/renderer.d.ts +1 -0
- package/dist/logger/transports/winston-daily-rotate-file.d.ts +2 -0
- package/dist/logger/transports/winston-terminal-transport.d.ts +2 -0
- package/dist/logger/types.d.ts +9 -0
- package/dist/main/AffinityGroupManager.d.ts +15 -0
- package/dist/main/BrowserViews.d.ts +39 -0
- package/dist/main/Config.d.ts +16 -0
- package/dist/main/DownloadManager.d.ts +31 -0
- package/dist/main/ExternalApplicationManager.d.ts +42 -0
- package/dist/main/IAB.d.ts +17 -0
- package/dist/main/IAC.d.ts +33 -0
- package/dist/main/Main.d.ts +6 -0
- package/dist/main/MainBus.d.ts +22 -0
- package/dist/main/MainSystem.d.ts +82 -0
- package/dist/main/MainWindow.d.ts +154 -0
- package/dist/main/Manifest.d.ts +13 -0
- package/dist/main/MonitorInfo.d.ts +4 -0
- package/dist/main/PermissionsManager.d.ts +12 -0
- package/dist/main/ScreenCapture.d.ts +7 -0
- package/dist/main/SplashScreen.d.ts +13 -0
- package/dist/main/appDataFolder.d.ts +9 -0
- package/dist/main/autoUpdaterWrapper.d.ts +37 -0
- package/dist/main/contentSecurity.d.ts +17 -0
- package/dist/main/contextMenu.d.ts +2 -0
- package/dist/main/download.d.ts +28 -0
- package/dist/main/getWindowIdentity.d.ts +3 -0
- package/dist/main/listeners.d.ts +7 -0
- package/dist/main/mainStore.d.ts +3 -0
- package/dist/main/preloads.d.ts +8 -0
- package/dist/main/protocolHandler.d.ts +11 -0
- package/dist/main/updateManager.d.ts +20 -0
- package/dist/makeInstaller.d.ts +9 -0
- package/dist/makeInstaller.js +3 -0
- package/dist/makeInstaller.js.LICENSE.txt +12 -0
- package/dist/makeInstaller.js.map +1 -0
- package/dist/permissions/chromePermissions.d.ts +59 -0
- package/dist/permissions/defaultWindowOptions.d.ts +385 -0
- package/dist/render/InterApplicationBus.d.ts +16 -0
- package/dist/render/Notification.d.ts +3 -0
- package/dist/render/RequestHelper.d.ts +23 -0
- package/dist/render/System.d.ts +72 -0
- package/dist/render/Window.d.ts +75 -0
- package/dist/render/renderHelpers.d.ts +1 -0
- package/dist/server/AppD.d.ts +18 -0
- package/dist/server/AppDStaticConfigPlugin.d.ts +8 -0
- package/dist/server/CosaicCloud.d.ts +21 -0
- package/dist/server/Progress.d.ts +26 -0
- package/dist/server/Server.d.ts +18 -0
- package/dist/server/SmartDesktop.d.ts +41 -0
- package/dist/server/SmartDesktopEndpoints.d.ts +106 -0
- package/dist/server/SmartDesktopStaticConfigPlugin.d.ts +10 -0
- package/dist/server/cssUtilities.d.ts +6 -0
- package/dist/server/writeJSON.d.ts +1 -0
- package/dist/startup/e2oLauncher.d.ts +1 -0
- package/dist/startup/runScriptInElectron.d.ts +6 -0
- package/dist/types/types.d.ts +144 -0
- package/dist/util.d.ts +24 -0
- package/exports.js +10 -0
- package/node_modules/electron-ipc-mock/.npmignore +2 -0
- package/node_modules/electron-ipc-mock/.travis.yml +8 -0
- package/node_modules/electron-ipc-mock/LICENSE +19 -0
- package/node_modules/electron-ipc-mock/README.md +42 -0
- package/node_modules/electron-ipc-mock/dist/constants.js +8 -0
- package/node_modules/electron-ipc-mock/dist/electron-ipc-mock.js +56 -0
- package/node_modules/electron-ipc-mock/dist/event.js +25 -0
- package/node_modules/electron-ipc-mock/dist/index.js +22 -0
- package/node_modules/electron-ipc-mock/dist/ipc-main.js +103 -0
- package/node_modules/electron-ipc-mock/dist/ipc-renderer.js +113 -0
- package/node_modules/electron-ipc-mock/dist/pipe.js +40 -0
- package/node_modules/electron-ipc-mock/dist/utils.js +33 -0
- package/node_modules/electron-ipc-mock/package.json +34 -0
- package/node_modules/image-size/LICENSE +9 -0
- package/node_modules/image-size/Readme.md +185 -0
- package/node_modules/image-size/bin/image-size.js +48 -0
- package/node_modules/image-size/dist/detector.d.ts +3 -0
- package/node_modules/image-size/dist/detector.js +30 -0
- package/node_modules/image-size/dist/index.d.ts +11 -0
- package/node_modules/image-size/dist/index.js +123 -0
- package/node_modules/image-size/dist/readUInt.d.ts +4 -0
- package/node_modules/image-size/dist/readUInt.js +11 -0
- package/node_modules/image-size/dist/types/bmp.d.ts +2 -0
- package/node_modules/image-size/dist/types/bmp.js +14 -0
- package/node_modules/image-size/dist/types/cur.d.ts +2 -0
- package/node_modules/image-size/dist/types/cur.js +19 -0
- package/node_modules/image-size/dist/types/dds.d.ts +2 -0
- package/node_modules/image-size/dist/types/dds.js +14 -0
- package/node_modules/image-size/dist/types/gif.d.ts +2 -0
- package/node_modules/image-size/dist/types/gif.js +16 -0
- package/node_modules/image-size/dist/types/icns.d.ts +2 -0
- package/node_modules/image-size/dist/types/icns.js +103 -0
- package/node_modules/image-size/dist/types/ico.d.ts +2 -0
- package/node_modules/image-size/dist/types/ico.js +70 -0
- package/node_modules/image-size/dist/types/interface.d.ts +14 -0
- package/node_modules/image-size/dist/types/interface.js +2 -0
- package/node_modules/image-size/dist/types/j2c.d.ts +2 -0
- package/node_modules/image-size/dist/types/j2c.js +15 -0
- package/node_modules/image-size/dist/types/jp2.d.ts +2 -0
- package/node_modules/image-size/dist/types/jp2.js +58 -0
- package/node_modules/image-size/dist/types/jpg.d.ts +2 -0
- package/node_modules/image-size/dist/types/jpg.js +123 -0
- package/node_modules/image-size/dist/types/ktx.d.ts +2 -0
- package/node_modules/image-size/dist/types/ktx.js +15 -0
- package/node_modules/image-size/dist/types/png.d.ts +2 -0
- package/node_modules/image-size/dist/types/png.js +34 -0
- package/node_modules/image-size/dist/types/pnm.d.ts +2 -0
- package/node_modules/image-size/dist/types/pnm.js +75 -0
- package/node_modules/image-size/dist/types/psd.d.ts +2 -0
- package/node_modules/image-size/dist/types/psd.js +14 -0
- package/node_modules/image-size/dist/types/svg.d.ts +2 -0
- package/node_modules/image-size/dist/types/svg.js +91 -0
- package/node_modules/image-size/dist/types/tga.d.ts +2 -0
- package/node_modules/image-size/dist/types/tga.js +14 -0
- package/node_modules/image-size/dist/types/tiff.d.ts +2 -0
- package/node_modules/image-size/dist/types/tiff.js +97 -0
- package/node_modules/image-size/dist/types/webp.d.ts +2 -0
- package/node_modules/image-size/dist/types/webp.js +58 -0
- package/node_modules/image-size/dist/types.d.ts +20 -0
- package/node_modules/image-size/dist/types.js +40 -0
- package/node_modules/image-size/package.json +68 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/queue/LICENSE +8 -0
- package/node_modules/queue/index.d.ts +173 -0
- package/node_modules/queue/index.js +195 -0
- package/node_modules/queue/package.json +43 -0
- package/node_modules/queue/readme.md +221 -0
- package/package.json +106 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
export declare class LoggerMain {
|
|
3
|
+
initialized: boolean;
|
|
4
|
+
winston: any;
|
|
5
|
+
fileTransport: any;
|
|
6
|
+
terminalTransport: any;
|
|
7
|
+
logLevel: string;
|
|
8
|
+
logsQueue: any[] | null;
|
|
9
|
+
sendLogToCentralLogger: ((message: any) => void) | null;
|
|
10
|
+
logToCentralLoggerEnabled: boolean;
|
|
11
|
+
centralLoggerLogLevels: any;
|
|
12
|
+
errorCallback: ((...args: any[]) => void) | null;
|
|
13
|
+
constructor(winstonLogger: any);
|
|
14
|
+
initialize(appDataPath: string): void;
|
|
15
|
+
enableLoggingToCentralLogger(logToCentralLogger: (message: any) => void): void;
|
|
16
|
+
sendLogToCentralLoggerBasedOnLevel: (msg: any) => void;
|
|
17
|
+
updateCentralLoggerState(loggerState: any): void;
|
|
18
|
+
enableConsole(): void;
|
|
19
|
+
setLevel(level?: string): void;
|
|
20
|
+
onLog(event: any, message: any): void;
|
|
21
|
+
setupLoggingToCentralLogger(transmitToCentralLogger?: boolean): void;
|
|
22
|
+
maybeSendToCentralLogger(messages: any[], level: string): void;
|
|
23
|
+
setErrorCallback(cb: (...args: any[]) => void): void;
|
|
24
|
+
error(...messages: any[]): void;
|
|
25
|
+
warn(...messages: any[]): void;
|
|
26
|
+
info(...messages: any[]): void;
|
|
27
|
+
log(...messages: any[]): void;
|
|
28
|
+
debug(...messages: any[]): void;
|
|
29
|
+
verbose(...messages: any[]): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default class LoggerRenderer {
|
|
2
|
+
ipc: any;
|
|
3
|
+
constructor(ipcRenderer: any);
|
|
4
|
+
send(level: string, args: any): void;
|
|
5
|
+
error(...messages: any[]): void;
|
|
6
|
+
warn(...messages: any[]): void;
|
|
7
|
+
info(...messages: any[]): void;
|
|
8
|
+
log(...messages: any[]): void;
|
|
9
|
+
debug(...messages: any[]): void;
|
|
10
|
+
verbose(...messages: any[]): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getOrCreateRendererLogger: () => any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ConsoleLogger {
|
|
2
|
+
debug: (...args: any[]) => void;
|
|
3
|
+
error: (...args: any[]) => void;
|
|
4
|
+
info: (...args: any[]) => void;
|
|
5
|
+
log: (...args: any[]) => void;
|
|
6
|
+
warn: (...args: any[]) => void;
|
|
7
|
+
verbose: (...args: any[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const noopLogger: ConsoleLogger;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BrowserWindow } from "electron";
|
|
2
|
+
import { BrowserWindowConstructorOptions } from "electron/main";
|
|
3
|
+
export declare class AffinityManager {
|
|
4
|
+
private affinitySurrogateInstances;
|
|
5
|
+
private static surrogateURL;
|
|
6
|
+
constructor();
|
|
7
|
+
static getSurrogateUrl(): string | null;
|
|
8
|
+
static setSurrogateUrl(url: string): void;
|
|
9
|
+
private maybeCreateAffinitySurrogate;
|
|
10
|
+
private createAffinitySurrogate;
|
|
11
|
+
private removeAffinitySurrogate;
|
|
12
|
+
spawn(affinityID: string, url: string, opts: BrowserWindowConstructorOptions): Promise<BrowserWindow>;
|
|
13
|
+
}
|
|
14
|
+
declare const affinityManagerSingleton: AffinityManager;
|
|
15
|
+
export { affinityManagerSingleton };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MainWindow } from "./MainWindow";
|
|
2
|
+
import { WebContentsId } from "../types/types";
|
|
3
|
+
import { BrowserView, BrowserWindow } from "electron";
|
|
4
|
+
export declare const setViewBounds: (bounds: any, view: any) => void;
|
|
5
|
+
export declare const calculateBrowserViewBounds: (windowWidth: number, windowHeight: number, titleBarHeight: number | undefined | null, overrideBounds: any) => {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
declare type View = {
|
|
12
|
+
id: WebContentsId;
|
|
13
|
+
browserView: BrowserView;
|
|
14
|
+
devtools: BrowserWindow | null;
|
|
15
|
+
webContentsName: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class BrowserViews {
|
|
18
|
+
views: Record<string, View>;
|
|
19
|
+
parentWindow: MainWindow;
|
|
20
|
+
constructor(parentWindow: MainWindow);
|
|
21
|
+
addBrowserView(params: {
|
|
22
|
+
url: string;
|
|
23
|
+
webContentsName?: string;
|
|
24
|
+
allowAutoResize?: boolean;
|
|
25
|
+
bounds?: any;
|
|
26
|
+
closeWindowOnWebContentsClose?: boolean;
|
|
27
|
+
}): Promise<number>;
|
|
28
|
+
adjustToParent(id?: number): void;
|
|
29
|
+
showDeveloperTools(id: number): void;
|
|
30
|
+
reload(): boolean;
|
|
31
|
+
setViewBounds(id: number, bounds: any): void;
|
|
32
|
+
bringViewToFront(id: number): void;
|
|
33
|
+
focus(id?: number): boolean;
|
|
34
|
+
removeAll(): Promise<void>;
|
|
35
|
+
closeCleanup(): void;
|
|
36
|
+
private cleanupView;
|
|
37
|
+
removeBrowserView(id: number): Promise<boolean>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare type FinsembleConfig = {
|
|
2
|
+
folderName: string;
|
|
3
|
+
chromiumFlags: Record<string, string>;
|
|
4
|
+
manifestUrl: string;
|
|
5
|
+
smartDesktop: boolean;
|
|
6
|
+
updateFeedUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const defaultConfig: FinsembleConfig;
|
|
9
|
+
export declare const getPackageRoot: (dirname?: string) => string;
|
|
10
|
+
export declare const getConfigPath: () => string;
|
|
11
|
+
export declare const getConfig: ({ throws, suppressLog, }?: {
|
|
12
|
+
throws?: boolean | undefined;
|
|
13
|
+
suppressLog?: boolean | undefined;
|
|
14
|
+
}) => FinsembleConfig;
|
|
15
|
+
export declare const writeConfig: (configToWrite: FinsembleConfig) => void;
|
|
16
|
+
export declare const deleteConfig: () => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MainProcessBusEvent } from "../types/types";
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
|
+
declare type DownloadItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
item: Electron.DownloadItem;
|
|
7
|
+
displayInfo: {
|
|
8
|
+
filename: string;
|
|
9
|
+
url: string;
|
|
10
|
+
state: string;
|
|
11
|
+
receivedBytes?: number;
|
|
12
|
+
totalBytes: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare class DownloadManager extends EventEmitter {
|
|
16
|
+
downloadList: Array<DownloadItem>;
|
|
17
|
+
saveLocation: string;
|
|
18
|
+
constructor();
|
|
19
|
+
bind(): void;
|
|
20
|
+
handleNewDownloadItem(item: Electron.DownloadItem): void;
|
|
21
|
+
getDownloadState(item: Electron.DownloadItem): "progressing" | "completed" | "cancelled" | "interrupted" | "paused";
|
|
22
|
+
getDownloadList(eventObj: MainProcessBusEvent): void;
|
|
23
|
+
showDownloadedFileInFolder(eventObj: MainProcessBusEvent): void;
|
|
24
|
+
removeDownloadItem(eventObj: MainProcessBusEvent): void;
|
|
25
|
+
cancelDownload(eventObj: MainProcessBusEvent): void;
|
|
26
|
+
pauseDownload(eventObj: MainProcessBusEvent): void;
|
|
27
|
+
resumeDownload(eventObj: MainProcessBusEvent): Promise<void>;
|
|
28
|
+
setDownloadSavePath(eventObj: MainProcessBusEvent): void;
|
|
29
|
+
clearDownloadList(eventObj: MainProcessBusEvent): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { Asset } from "../types/types";
|
|
4
|
+
import { SpawnOptionsWithoutStdio } from "child_process";
|
|
5
|
+
import { StandardResponse, StandardPromise } from "../types/types";
|
|
6
|
+
declare type ExternalApp = {
|
|
7
|
+
filePath: string;
|
|
8
|
+
kill: (signal?: number | NodeJS.Signals | undefined) => void;
|
|
9
|
+
};
|
|
10
|
+
declare type DownloadedAsset = {
|
|
11
|
+
alias: string;
|
|
12
|
+
executable: string;
|
|
13
|
+
version: string;
|
|
14
|
+
assetFolder: string;
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class ExternalApplicationManager {
|
|
18
|
+
assets: Record<string, DownloadedAsset>;
|
|
19
|
+
assetsFolder: string;
|
|
20
|
+
externalApps: ExternalApp[];
|
|
21
|
+
constructor(assetsFolder: string);
|
|
22
|
+
getCachedAssetInfo(etagFilePath: string, executablePath: string, currentUrl: string): {
|
|
23
|
+
etag?: string;
|
|
24
|
+
version?: string;
|
|
25
|
+
};
|
|
26
|
+
maybeDownloadAsset(asset: Asset): StandardPromise<DownloadedAsset>;
|
|
27
|
+
deleteAssets(alias?: string | null): string | null;
|
|
28
|
+
downloadAssets(appAssets: Asset[]): StandardPromise<DownloadedAsset[]>;
|
|
29
|
+
maybePathFromAlias(alias?: string): StandardResponse<string>;
|
|
30
|
+
spawn({ alias, path: filePath, certificate, options, arguments: spawnArguments, env, }: {
|
|
31
|
+
alias?: string;
|
|
32
|
+
path?: string;
|
|
33
|
+
certificate?: {
|
|
34
|
+
trusted: boolean;
|
|
35
|
+
};
|
|
36
|
+
options?: SpawnOptionsWithoutStdio;
|
|
37
|
+
arguments?: string[] | string;
|
|
38
|
+
env?: Record<string, string>;
|
|
39
|
+
}): StandardPromise<void>;
|
|
40
|
+
closeAllApps(): void;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IpcMainEvent, WebContents } from "electron";
|
|
2
|
+
import { WebContentsId, IABPublish, IABSubscribe, IABUnsubscribe } from "../types/types";
|
|
3
|
+
declare class IAB {
|
|
4
|
+
subscribers: {
|
|
5
|
+
[destination: string]: {
|
|
6
|
+
[listenerID: string]: WebContents;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
constructor();
|
|
10
|
+
unsubscribeWebContentsId(closingWebContentsId: WebContentsId): void;
|
|
11
|
+
onIABSubscribe(event: IpcMainEvent, arg: IABSubscribe): void;
|
|
12
|
+
onIABUnsubscribe(event: IpcMainEvent, arg: IABUnsubscribe): void;
|
|
13
|
+
onIABPublish(event: IpcMainEvent, arg: IABPublish): void;
|
|
14
|
+
setupListeners(): void;
|
|
15
|
+
}
|
|
16
|
+
export declare const iab: IAB;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Manifest } from "../types/types";
|
|
2
|
+
import ws from "ws";
|
|
3
|
+
export declare type IACOptions = {
|
|
4
|
+
key?: string;
|
|
5
|
+
cert?: string;
|
|
6
|
+
ca?: string;
|
|
7
|
+
secure?: boolean;
|
|
8
|
+
};
|
|
9
|
+
interface ISocket {
|
|
10
|
+
name?: string;
|
|
11
|
+
send?: Function;
|
|
12
|
+
}
|
|
13
|
+
export declare type IAC_Socket = ISocket | null;
|
|
14
|
+
export declare class IAC {
|
|
15
|
+
wss: ws.Server | null;
|
|
16
|
+
port: number;
|
|
17
|
+
host: string;
|
|
18
|
+
options: IACOptions;
|
|
19
|
+
clientSocketMap: Record<string, IAC_Socket>;
|
|
20
|
+
blockedClientMap: Record<string, boolean>;
|
|
21
|
+
routerServerSocket: IAC_Socket;
|
|
22
|
+
constructor(port?: number, host?: string, options?: IACOptions);
|
|
23
|
+
setupClient(source: string, socket: IAC_Socket): IAC_Socket;
|
|
24
|
+
backwardsCompatabilitysetupClient(source: string, socket: IAC_Socket): IAC_Socket;
|
|
25
|
+
removeClient(socket: any): void;
|
|
26
|
+
sendMessageToRouterService(messageString: string): void;
|
|
27
|
+
sendMessageToClient(client: string, messageString: string): void;
|
|
28
|
+
isCorrectOriginatingRouterClientSocket(source: string, socket: IAC_Socket): boolean;
|
|
29
|
+
isCorrectOriginatingRouterServiceSocket(source: string, socket: IAC_Socket): boolean;
|
|
30
|
+
connect(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const startIAC: (manifest: Manifest) => IAC;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BusEventPayload, MainProcessBusEvent, WebContentsId } from "../types/types";
|
|
2
|
+
import { IpcMainEvent, WebContents } from "electron";
|
|
3
|
+
declare class MainBus {
|
|
4
|
+
localHandlers: {
|
|
5
|
+
[eventName: string]: ((event: MainProcessBusEvent) => void)[];
|
|
6
|
+
};
|
|
7
|
+
rendererHandlers: {
|
|
8
|
+
[eventName: string]: WebContents[];
|
|
9
|
+
};
|
|
10
|
+
constructor();
|
|
11
|
+
unsubscribeWebContentsId(closingWebContentsId: WebContentsId): void;
|
|
12
|
+
addHandler(eventName: string, handler: (event: MainProcessBusEvent) => void): () => void;
|
|
13
|
+
private handleRendererRequest;
|
|
14
|
+
sendEvent(eventTopic: string, data?: any): void;
|
|
15
|
+
private addRendererListener;
|
|
16
|
+
private removeRendererListener;
|
|
17
|
+
private setupIPCListeners;
|
|
18
|
+
buildRequestObject(event: IpcMainEvent, args: BusEventPayload, responseUUID: string): MainProcessBusEvent;
|
|
19
|
+
generateTopic(windowName: string, topic: string): string;
|
|
20
|
+
}
|
|
21
|
+
export declare const mainBus: MainBus;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import { ExternalApplicationManager } from "./ExternalApplicationManager";
|
|
4
|
+
import { Manifest, MainProcessBusEvent } from "../types/types";
|
|
5
|
+
import { ProtocolHandler } from "./protocolHandler";
|
|
6
|
+
import { Tray, App, NativeImage } from "electron";
|
|
7
|
+
export declare const openUrlWithBrowser: (eventObj: {
|
|
8
|
+
data: string;
|
|
9
|
+
respond: Function;
|
|
10
|
+
}, allowedProtocols?: never[]) => void;
|
|
11
|
+
export declare const showInFolder: (filepath: string) => void;
|
|
12
|
+
export declare class MainSystem extends EventEmitter {
|
|
13
|
+
app: App;
|
|
14
|
+
manifest: Manifest;
|
|
15
|
+
externalApplicationManager: ExternalApplicationManager;
|
|
16
|
+
tray: Tray | null;
|
|
17
|
+
mainApplicationStarted: boolean;
|
|
18
|
+
restarting: boolean;
|
|
19
|
+
startupApplicationHandshakeTimer: ReturnType<typeof setTimeout> | null;
|
|
20
|
+
updateDownloaded: boolean;
|
|
21
|
+
trayIcon: NativeImage | null;
|
|
22
|
+
applicationIcon: NativeImage | null;
|
|
23
|
+
protocolHandler: ProtocolHandler;
|
|
24
|
+
updateAvailable: boolean;
|
|
25
|
+
constructor(app: App, manifest: Manifest, externalApplicationManager: ExternalApplicationManager, protocolHandler: ProtocolHandler);
|
|
26
|
+
bind(): void;
|
|
27
|
+
exit(): void;
|
|
28
|
+
clearCache(eventObj: MainProcessBusEvent): Promise<void>;
|
|
29
|
+
getVersion(eventObj: MainProcessBusEvent): void;
|
|
30
|
+
getFEAInfo(eventObj: MainProcessBusEvent): void;
|
|
31
|
+
getUpdateAvailable(eventObj: MainProcessBusEvent): void;
|
|
32
|
+
setUpdateAvailable(isUpdateAvailable: boolean): void;
|
|
33
|
+
startupApplicationHandshake(): void;
|
|
34
|
+
openUrlWithBrowser(eventObj: MainProcessBusEvent): void;
|
|
35
|
+
deleteAssets(eventObj: MainProcessBusEvent): Promise<void>;
|
|
36
|
+
getSDServerInfo(eventObj: MainProcessBusEvent): Promise<void>;
|
|
37
|
+
getHostSpecs(eventObj: MainProcessBusEvent): void;
|
|
38
|
+
getMonitorInfo(eventObj: MainProcessBusEvent): void;
|
|
39
|
+
flushStorage(eventObj: MainProcessBusEvent): Promise<void>;
|
|
40
|
+
getMousePosition(eventObj: MainProcessBusEvent): void;
|
|
41
|
+
launchExternalProcess(eventObj: MainProcessBusEvent): Promise<void>;
|
|
42
|
+
restartAndUpdateRequested(): void;
|
|
43
|
+
restartApplication(): Promise<void>;
|
|
44
|
+
getProcessList(eventObj: {
|
|
45
|
+
respond: Function;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
toast(notification: any, { devModeOnly }?: {
|
|
48
|
+
devModeOnly?: boolean | undefined;
|
|
49
|
+
}): void;
|
|
50
|
+
notificationBusHandler(eventObj: {
|
|
51
|
+
data: {
|
|
52
|
+
title: string;
|
|
53
|
+
message?: any;
|
|
54
|
+
wait: boolean;
|
|
55
|
+
body?: any;
|
|
56
|
+
content?: any;
|
|
57
|
+
devModeOnly?: boolean;
|
|
58
|
+
};
|
|
59
|
+
}): void;
|
|
60
|
+
downloadApplicationIcon(): Promise<void>;
|
|
61
|
+
logToDisk(eventObj: MainProcessBusEvent): void;
|
|
62
|
+
setTrayIcon(eventObj: MainProcessBusEvent): Promise<void>;
|
|
63
|
+
setTrayIconDeprecated(eventObj: MainProcessBusEvent): Promise<void>;
|
|
64
|
+
removeTrayIcon(): void;
|
|
65
|
+
getEnvironmentVariable(eventObj: MainProcessBusEvent): void;
|
|
66
|
+
availableFormatsFromClipboard(eventObj: MainProcessBusEvent): void;
|
|
67
|
+
writeToClipboard(eventObj: MainProcessBusEvent): void;
|
|
68
|
+
writeTextToClipboard(eventObj: MainProcessBusEvent): void;
|
|
69
|
+
writeHTMLToClipboard(eventObj: MainProcessBusEvent): void;
|
|
70
|
+
writeRTFToClipboard(eventObj: MainProcessBusEvent): void;
|
|
71
|
+
readTextFromClipboard(eventObj: MainProcessBusEvent): void;
|
|
72
|
+
readHTMLFromClipboard(eventObj: MainProcessBusEvent): Promise<void>;
|
|
73
|
+
readRTFFRomClipboard(eventObj: MainProcessBusEvent): Promise<void>;
|
|
74
|
+
registerGlobalShortcut(eventObj: MainProcessBusEvent): Promise<void>;
|
|
75
|
+
isRegisteredGlobalShortcut(eventObj: MainProcessBusEvent): Promise<void>;
|
|
76
|
+
unregisterGlobalShortcut(eventObj: MainProcessBusEvent): Promise<void>;
|
|
77
|
+
getCommandLineArguments(eventObj: MainProcessBusEvent): void;
|
|
78
|
+
checkPermission(eventObj: MainProcessBusEvent): void;
|
|
79
|
+
getProtocolString(eventObj: MainProcessBusEvent): void;
|
|
80
|
+
closeExternalApps(): void;
|
|
81
|
+
setMainApplicationStarted(): void;
|
|
82
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { BrowserViews } from "./BrowserViews";
|
|
4
|
+
import { Manifest, Preload, WebContentsRecord, AnnotatedBrowserWindowOptions, StandardPromise, WebContentsId, SpawnResponseFSA, ErrorResponseFSA, MainProcessBusEvent } from "../types/types";
|
|
5
|
+
import { BrowserWindow, BrowserWindowConstructorOptions, WebContents, DidCreateWindowDetails, HandlerDetails } from "electron";
|
|
6
|
+
import { EventEmitter } from "events";
|
|
7
|
+
import * as electron from "electron";
|
|
8
|
+
export declare const launchDevtools: (displayName: string, webContents: WebContents, onClosed: Function) => BrowserWindow | null;
|
|
9
|
+
export declare const createWindow: (params: AnnotatedBrowserWindowOptions, manifest: Manifest) => StandardPromise<MainWindow>;
|
|
10
|
+
export declare const createWindowRequest: (data: any, manifest: Manifest) => Promise<SpawnResponseFSA | ErrorResponseFSA>;
|
|
11
|
+
export declare const downloadPreloadFile: (url: string, remoteModuleFolderPath: string) => StandardPromise<string>;
|
|
12
|
+
export declare const registerNewWebContents: (webContents: WebContents, webContentsRecord: WebContentsRecord, browserWindowOptions: AnnotatedBrowserWindowOptions) => void;
|
|
13
|
+
export declare const onSetWindowOpenHandler: (parentWebContents: WebContents, details: HandlerDetails) => {
|
|
14
|
+
action: "deny";
|
|
15
|
+
} | {
|
|
16
|
+
action: "allow";
|
|
17
|
+
overrideBrowserWindowOptions?: BrowserWindowConstructorOptions;
|
|
18
|
+
};
|
|
19
|
+
export declare const onDidCreateWindow: (parentWebContents: WebContents, manifest: Manifest, bw: BrowserWindow, details: DidCreateWindowDetails) => void;
|
|
20
|
+
export declare const getURLFromOptions: (browserWindowOptions: AnnotatedBrowserWindowOptions) => any;
|
|
21
|
+
export declare class MainWindow extends EventEmitter {
|
|
22
|
+
windowName: string;
|
|
23
|
+
webContentsName: string;
|
|
24
|
+
apiUnsubscribes: (() => void)[];
|
|
25
|
+
movable: boolean;
|
|
26
|
+
isMoving: boolean;
|
|
27
|
+
closeRequested: boolean;
|
|
28
|
+
url: string;
|
|
29
|
+
lastMove: number;
|
|
30
|
+
customData: any;
|
|
31
|
+
permissions: any;
|
|
32
|
+
finsembleDomain: string;
|
|
33
|
+
trustedPreloads: string[];
|
|
34
|
+
affinity: string | boolean;
|
|
35
|
+
originalParams: any;
|
|
36
|
+
partialShapeSet: boolean;
|
|
37
|
+
wasClosedByRender: boolean;
|
|
38
|
+
useDOMMovement: boolean;
|
|
39
|
+
domReady: boolean;
|
|
40
|
+
myOpts: AnnotatedBrowserWindowOptions;
|
|
41
|
+
isWindowShowing: boolean;
|
|
42
|
+
win: BrowserWindow;
|
|
43
|
+
zoomInterval: ReturnType<typeof setTimeout> | undefined;
|
|
44
|
+
webContentsId: WebContentsId;
|
|
45
|
+
static hookWindowMessageDisplayed: any;
|
|
46
|
+
isRestoring: boolean;
|
|
47
|
+
isResizing: boolean;
|
|
48
|
+
setBoundsCalled: boolean;
|
|
49
|
+
titleBarHeight: number;
|
|
50
|
+
location: any;
|
|
51
|
+
movingObj: any;
|
|
52
|
+
lastResizeTime: number | undefined;
|
|
53
|
+
lastSizeMoveLoc: {
|
|
54
|
+
left: any;
|
|
55
|
+
top: any;
|
|
56
|
+
height: any;
|
|
57
|
+
width: any;
|
|
58
|
+
changeType: number;
|
|
59
|
+
} | undefined;
|
|
60
|
+
startMoveWindowLocation: any;
|
|
61
|
+
startMoveMouseLocation: any;
|
|
62
|
+
details: AnnotatedBrowserWindowOptions;
|
|
63
|
+
devtools: BrowserWindow | null;
|
|
64
|
+
dontRedirectDevToolsOnce: boolean;
|
|
65
|
+
destroyWindowTimer: ReturnType<typeof setTimeout> | undefined;
|
|
66
|
+
normalBounds: any;
|
|
67
|
+
resizeEventTimeout: ReturnType<typeof setTimeout> | undefined;
|
|
68
|
+
hasView: boolean;
|
|
69
|
+
preloadList: Preload[];
|
|
70
|
+
manifest: Manifest;
|
|
71
|
+
browserViews: BrowserViews;
|
|
72
|
+
isTitlebarWindow: boolean;
|
|
73
|
+
isAffinitySurrogate: boolean;
|
|
74
|
+
defaultAlwaysOnTopLevel: string | null;
|
|
75
|
+
constructor(params: AnnotatedBrowserWindowOptions, manifest: Manifest);
|
|
76
|
+
initialize(): StandardPromise<void>;
|
|
77
|
+
finishBrowserWindowAssignment(bw: BrowserWindow, webContents: WebContents, webContentsRecord: WebContentsRecord, browserWindowOptions: AnnotatedBrowserWindowOptions): void;
|
|
78
|
+
bindFunctions(): void;
|
|
79
|
+
removeAPIHandlers(): void;
|
|
80
|
+
handleWillResizeWithoutDOMMovement(event: electron.Event, newBounds: electron.Rectangle): void;
|
|
81
|
+
handleResizeEvent(event: electron.Event): void;
|
|
82
|
+
setupListeners(): void;
|
|
83
|
+
closeRequestedAdd(): void;
|
|
84
|
+
closeRequestedRemove(): void;
|
|
85
|
+
sendEventToWindows(event: string, data: any): void;
|
|
86
|
+
maybeDisableZoom(webContents: WebContents): void;
|
|
87
|
+
getBoundsEventInfo(): {
|
|
88
|
+
left: number;
|
|
89
|
+
top: number;
|
|
90
|
+
width: number;
|
|
91
|
+
height: number;
|
|
92
|
+
right: number;
|
|
93
|
+
bottom: number;
|
|
94
|
+
changeType: number;
|
|
95
|
+
name: string;
|
|
96
|
+
} | undefined;
|
|
97
|
+
debounce(func: any, delay: number): () => void;
|
|
98
|
+
resizeEventOsx(event: any, newBounds: any): void;
|
|
99
|
+
userResizeEvent(event: any, newBounds: any): void;
|
|
100
|
+
moveOrResizeEvent(event: any, changeType?: number): void;
|
|
101
|
+
userMoveEvent(event: any, newBounds: any): void;
|
|
102
|
+
mouseDown(): void;
|
|
103
|
+
windowMouseDown(): void;
|
|
104
|
+
windowMoving(event: any): void;
|
|
105
|
+
windowMoved(): void;
|
|
106
|
+
mouseUp(): void;
|
|
107
|
+
updateOptions(eventObj: MainProcessBusEvent): void;
|
|
108
|
+
getDetails(eventObj: MainProcessBusEvent): void;
|
|
109
|
+
getSnapshot(eventObj: MainProcessBusEvent): Promise<void>;
|
|
110
|
+
reload(eventObj: any): void;
|
|
111
|
+
showDeveloperTools(eventObj: MainProcessBusEvent): void;
|
|
112
|
+
onDevToolsOpened(): void;
|
|
113
|
+
setIgnoreMouseEvents(eventObj: MainProcessBusEvent): void;
|
|
114
|
+
setMinimumSize(eventObj: MainProcessBusEvent): number[];
|
|
115
|
+
setMaximumSize(eventObj: MainProcessBusEvent): number[];
|
|
116
|
+
setBounds(eventObj: MainProcessBusEvent): any;
|
|
117
|
+
setViewBounds(eventObj: any): void;
|
|
118
|
+
bringViewToFront(eventObj: any): void;
|
|
119
|
+
setShape(eventObj: any): void;
|
|
120
|
+
setResizable(eventObj: any): void;
|
|
121
|
+
setWindowIcon(url: string): Promise<void>;
|
|
122
|
+
setTaskbarIcon(eventObj: any): Promise<void>;
|
|
123
|
+
setTaskbarIconOverlay(eventObj: any): Promise<void>;
|
|
124
|
+
showNativeOpenDialog(eventObj: any): Promise<void>;
|
|
125
|
+
getBoundsFromSystem(eventObj: MainProcessBusEvent): {
|
|
126
|
+
left: number;
|
|
127
|
+
top: number;
|
|
128
|
+
height: number;
|
|
129
|
+
width: number;
|
|
130
|
+
bottom: number;
|
|
131
|
+
right: number;
|
|
132
|
+
};
|
|
133
|
+
getBounds(eventObj?: MainProcessBusEvent): any;
|
|
134
|
+
showAt(eventObj: MainProcessBusEvent): void;
|
|
135
|
+
isShowing(eventObj: MainProcessBusEvent): void;
|
|
136
|
+
show(eventObj: MainProcessBusEvent): void;
|
|
137
|
+
hide(eventObj: MainProcessBusEvent): void;
|
|
138
|
+
focus(eventObj: MainProcessBusEvent): void;
|
|
139
|
+
blur(eventObj: MainProcessBusEvent): void;
|
|
140
|
+
close(eventObj?: MainProcessBusEvent): Promise<void>;
|
|
141
|
+
destroyWindow(duration: number, cb?: Function): NodeJS.Timeout;
|
|
142
|
+
maximize(eventObj: MainProcessBusEvent): void;
|
|
143
|
+
minimize(eventObj: MainProcessBusEvent): void;
|
|
144
|
+
onWindowClosed(): void;
|
|
145
|
+
closeCleanup(): void;
|
|
146
|
+
logLifecycleStatus(lifecycleMoment: any, message: any): void;
|
|
147
|
+
lifecycleLogPreface(lifecycleMoment: any): string;
|
|
148
|
+
bringToFront(eventObj: MainProcessBusEvent): void;
|
|
149
|
+
restore(eventObj: MainProcessBusEvent): void;
|
|
150
|
+
disableFrame(eventObj: MainProcessBusEvent): void;
|
|
151
|
+
enableFrame(eventObj: MainProcessBusEvent): void;
|
|
152
|
+
removeBrowserView(eventObj: MainProcessBusEvent): Promise<void>;
|
|
153
|
+
addBrowserView(eventObj: MainProcessBusEvent): Promise<void>;
|
|
154
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DownloadOptions } from "./download";
|
|
2
|
+
import { Manifest } from "../types/types";
|
|
3
|
+
declare const resolveToAbsoluteURL: (baseURL: string, urlString: string) => string;
|
|
4
|
+
export declare const normalizeManifest: (manifest: Manifest, manifestURL: string, appendImports: Array<string>, appName: string) => void;
|
|
5
|
+
declare type GetManifestParams = {
|
|
6
|
+
manifestURL?: string | null;
|
|
7
|
+
options?: DownloadOptions;
|
|
8
|
+
appendImports: Array<string>;
|
|
9
|
+
appName: string;
|
|
10
|
+
};
|
|
11
|
+
declare const getManifest: ({ manifestURL, options, appendImports, appName }: GetManifestParams) => Promise<object>;
|
|
12
|
+
declare const getGlobalManifest: () => {};
|
|
13
|
+
export { getManifest, getGlobalManifest as manifest, resolveToAbsoluteURL };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MainWindow } from "./MainWindow";
|
|
2
|
+
import { MainProcessBusEvent } from "../types/types";
|
|
3
|
+
declare class PermissionsManager {
|
|
4
|
+
systemPermissions: any;
|
|
5
|
+
constructor();
|
|
6
|
+
reconcilePermissions(currentPermissions: any, requestedPermissions: any): any;
|
|
7
|
+
setDefaultPermissions(manifestPermissions: any): void;
|
|
8
|
+
checkPermission(mainWindow: MainWindow | undefined, permission: string): any;
|
|
9
|
+
addRestrictedListener(eventName: string, handler: (event: MainProcessBusEvent) => void, permission?: string | null): () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const permissionsManager: PermissionsManager;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MainProcessBusEvent } from "../types/types";
|
|
2
|
+
export declare type ScreenCaptureSource = Electron.DesktopCapturerSource & {
|
|
3
|
+
thumbnail: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class ScreenCapture {
|
|
6
|
+
static getScreenShareSources(eventObj: MainProcessBusEvent): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Manifest, MainProcessBusEvent } from "../types/types";
|
|
2
|
+
export declare class SplashScreen {
|
|
3
|
+
splashScreenWindow: Electron.BrowserWindow | null;
|
|
4
|
+
constructor();
|
|
5
|
+
loadSplashScreen(url: string): Promise<{
|
|
6
|
+
filePath: string;
|
|
7
|
+
}>;
|
|
8
|
+
showSplashScreenFromBus(eventObj: MainProcessBusEvent): Promise<void>;
|
|
9
|
+
hideSplashScreen(): Promise<void>;
|
|
10
|
+
hideSplashScreenFromBus(eventObj: MainProcessBusEvent): Promise<void>;
|
|
11
|
+
showSplashScreen(imageURL: string): Promise<void>;
|
|
12
|
+
maybeShowSplashScreen(manifest: Manifest): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const setAppDataFolderName: (newFolderName: string) => void;
|
|
2
|
+
export declare const appDataFolderName: () => string;
|
|
3
|
+
export declare const appDataFolderPath: () => string;
|
|
4
|
+
export declare const appDataLogsPath: () => string;
|
|
5
|
+
export declare const appDataReleasesPath: () => string;
|
|
6
|
+
export declare const appDataCachePath: () => string;
|
|
7
|
+
export declare const appDataPreloadsPath: () => string;
|
|
8
|
+
export declare const appDataAssetsPath: () => string;
|
|
9
|
+
export declare const appDataIconsPath: () => string;
|