7f007109c3
* refactor: Port inspector to TypeScript * refactor: Add another type to inspector * refactor: Use correct paths * Update lib/renderer/inspector.ts Co-Authored-By: felixrieseberg <felix@felixrieseberg.com> * refactor: Implement feedback <3 * refactor: Don't define blob at all * fix: Correct type
66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
declare namespace NodeJS {
|
|
interface FeaturesBinding {
|
|
isDesktopCapturerEnabled(): boolean;
|
|
isOffscreenRenderingEnabled(): boolean;
|
|
isPDFViewerEnabled(): boolean;
|
|
isRunAsNodeEnabled(): boolean;
|
|
isFakeLocationProviderEnabled(): boolean;
|
|
isViewApiEnabled(): boolean;
|
|
isTtsEnabled(): boolean;
|
|
isPrintingEnabled(): boolean;
|
|
}
|
|
|
|
interface V8UtilBinding {
|
|
getHiddenValue<T>(obj: any, key: string): T;
|
|
setHiddenValue<T>(obj: any, key: string, value: T): void;
|
|
}
|
|
interface Process {
|
|
/**
|
|
* DO NOT USE DIRECTLY, USE process.atomBinding
|
|
*/
|
|
binding(name: string): any;
|
|
atomBinding(name: string): any;
|
|
atomBinding(name: 'features'): FeaturesBinding;
|
|
atomBinding(name: 'v8_util'): V8UtilBinding;
|
|
atomBinding(name: 'app'): { app: Electron.App, App: Function };
|
|
atomBinding(name: 'command_line'): Electron.CommandLine;
|
|
log: NodeJS.WriteStream['write'];
|
|
activateUvLoop(): void;
|
|
|
|
// Additional methods
|
|
getRenderProcessPreferences(): Array<Electron.RendererProcessPreference> | null;
|
|
|
|
// Additional events
|
|
once(event: 'document-start', listener: () => any): this;
|
|
once(event: 'document-end', listener: () => any): this;
|
|
}
|
|
}
|
|
|
|
declare module NodeJS {
|
|
interface Global {
|
|
require: NodeRequire;
|
|
module: NodeModule;
|
|
__filename: string;
|
|
__dirname: string;
|
|
}
|
|
}
|
|
|
|
declare interface Window {
|
|
ELECTRON_DISABLE_SECURITY_WARNINGS?: boolean;
|
|
ELECTRON_ENABLE_SECURITY_WARNINGS?: boolean;
|
|
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;
|
|
}
|
|
}
|
|
}
|