2019-02-06 21:27:20 +03:00
|
|
|
declare namespace NodeJS {
|
|
|
|
interface FeaturesBinding {
|
|
|
|
isDesktopCapturerEnabled(): boolean;
|
|
|
|
isOffscreenRenderingEnabled(): boolean;
|
|
|
|
isPDFViewerEnabled(): boolean;
|
|
|
|
isRunAsNodeEnabled(): boolean;
|
|
|
|
isFakeLocationProviderEnabled(): boolean;
|
|
|
|
isViewApiEnabled(): boolean;
|
|
|
|
isTtsEnabled(): boolean;
|
|
|
|
isPrintingEnabled(): boolean;
|
2019-03-30 03:32:52 +03:00
|
|
|
isComponentBuild(): boolean;
|
2019-02-06 21:27:20 +03:00
|
|
|
}
|
2019-02-12 17:22:33 +03:00
|
|
|
|
|
|
|
interface V8UtilBinding {
|
|
|
|
getHiddenValue<T>(obj: any, key: string): T;
|
|
|
|
setHiddenValue<T>(obj: any, key: string, value: T): void;
|
2019-03-11 01:38:44 +03:00
|
|
|
requestGarbageCollectionForTesting(): void;
|
2019-02-12 17:22:33 +03:00
|
|
|
}
|
2019-02-06 21:27:20 +03:00
|
|
|
interface Process {
|
2019-02-12 17:22:33 +03:00
|
|
|
/**
|
2019-03-18 22:37:06 +03:00
|
|
|
* DO NOT USE DIRECTLY, USE process.electronBinding
|
2019-02-12 17:22:33 +03:00
|
|
|
*/
|
2019-03-08 21:29:52 +03:00
|
|
|
_linkedBinding(name: string): any;
|
2019-03-18 22:37:06 +03:00
|
|
|
electronBinding(name: string): any;
|
|
|
|
electronBinding(name: 'features'): FeaturesBinding;
|
|
|
|
electronBinding(name: 'v8_util'): V8UtilBinding;
|
|
|
|
electronBinding(name: 'app'): { app: Electron.App, App: Function };
|
|
|
|
electronBinding(name: 'command_line'): Electron.CommandLine;
|
2019-02-06 21:27:20 +03:00
|
|
|
log: NodeJS.WriteStream['write'];
|
2019-02-12 17:22:33 +03:00
|
|
|
activateUvLoop(): void;
|
2019-02-18 15:47:07 +03:00
|
|
|
|
|
|
|
// Additional methods
|
|
|
|
getRenderProcessPreferences(): Array<Electron.RendererProcessPreference> | null;
|
|
|
|
|
|
|
|
// Additional events
|
|
|
|
once(event: 'document-start', listener: () => any): this;
|
|
|
|
once(event: 'document-end', listener: () => any): this;
|
2019-02-06 21:27:20 +03:00
|
|
|
}
|
|
|
|
}
|
2019-02-17 04:06:30 +03:00
|
|
|
|
2019-02-19 20:05:14 +03:00
|
|
|
declare module NodeJS {
|
|
|
|
interface Global {
|
|
|
|
require: NodeRequire;
|
|
|
|
module: NodeModule;
|
|
|
|
__filename: string;
|
|
|
|
__dirname: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-17 04:06:30 +03:00
|
|
|
declare interface Window {
|
2019-02-19 20:05:14 +03:00
|
|
|
ELECTRON_DISABLE_SECURITY_WARNINGS?: boolean;
|
|
|
|
ELECTRON_ENABLE_SECURITY_WARNINGS?: boolean;
|
2019-02-26 05:10:26 +03:00
|
|
|
InspectorFrontendHost?: {
|
|
|
|
showContextMenuAtPoint: (x: number, y: number, items: any[]) => void
|
|
|
|
};
|
|
|
|
DevToolsAPI?: {
|
|
|
|
contextMenuItemSelected: (id: number) => void;
|
|
|
|
contextMenuCleared: () => void
|
|
|
|
};
|
|
|
|
UI?: {
|
|
|
|
createFileSelectorElement: (callback: () => void) => HTMLSpanElement
|
|
|
|
};
|
|
|
|
Persistence?: {
|
|
|
|
FileSystemWorkspaceBinding: {
|
|
|
|
completeURL: (project: string, path: string) => string;
|
|
|
|
}
|
2019-03-08 02:26:23 +03:00
|
|
|
};
|
|
|
|
ResizeObserver: ResizeObserver;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The ResizeObserver interface is used to observe changes to Element's content
|
|
|
|
* rect.
|
|
|
|
*
|
|
|
|
* It is modeled after MutationObserver and IntersectionObserver.
|
|
|
|
*/
|
|
|
|
declare class ResizeObserver {
|
|
|
|
constructor (callback: ResizeObserverCallback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds target to the list of observed elements.
|
|
|
|
*/
|
|
|
|
observe: (target: Element) => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes target from the list of observed elements.
|
|
|
|
*/
|
|
|
|
unobserve: (target: Element) => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears both the observationTargets and activeTargets lists.
|
|
|
|
*/
|
|
|
|
disconnect: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This callback delivers ResizeObserver's notifications. It is invoked by a
|
|
|
|
* broadcast active observations algorithm.
|
|
|
|
*/
|
|
|
|
interface ResizeObserverCallback {
|
|
|
|
(entries: ResizeObserverEntry[], observer: ResizeObserver): void;
|
2019-02-17 04:06:30 +03:00
|
|
|
}
|
2019-03-08 02:26:23 +03:00
|
|
|
|
|
|
|
interface ResizeObserverEntry {
|
|
|
|
/**
|
|
|
|
* @param target The Element whose size has changed.
|
|
|
|
*/
|
|
|
|
new (target: Element): ResizeObserverEntry;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Element whose size has changed.
|
|
|
|
*/
|
|
|
|
readonly target: Element;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Element's content rect when ResizeObserverCallback is invoked.
|
|
|
|
*/
|
|
|
|
readonly contentRect: DOMRectReadOnly;
|
|
|
|
}
|