mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 21:28:40 -09:00
Move electron type augmentation to separate dts file
This commit is contained in:
parent
3dc172daf7
commit
507ff2ee9e
2 changed files with 22 additions and 22 deletions
22
app/extend-electron.d.ts
vendored
Normal file
22
app/extend-electron.d.ts
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import type {Server} from './rpc';
|
||||||
|
|
||||||
|
declare module 'electron' {
|
||||||
|
interface App {
|
||||||
|
config: typeof import('./config');
|
||||||
|
plugins: typeof import('./plugins');
|
||||||
|
getWindows: () => Set<BrowserWindow>;
|
||||||
|
getLastFocusedWindow: () => BrowserWindow | null;
|
||||||
|
windowCallback: (win: BrowserWindow) => void;
|
||||||
|
createWindow: (fn?: (win: BrowserWindow) => void, options?: Record<string, any>) => BrowserWindow;
|
||||||
|
setVersion: (version: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
// type Server = import('./rpc').Server;
|
||||||
|
interface BrowserWindow {
|
||||||
|
uid: string;
|
||||||
|
sessions: Map<any, any>;
|
||||||
|
focusTime: number;
|
||||||
|
clean: () => void;
|
||||||
|
rpc: Server;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
app/index.ts
22
app/index.ts
|
|
@ -47,28 +47,6 @@ import {gitDescribe} from 'git-describe';
|
||||||
import isDev from 'electron-is-dev';
|
import isDev from 'electron-is-dev';
|
||||||
import * as config from './config';
|
import * as config from './config';
|
||||||
|
|
||||||
// Hack - this declararion doesn't work when put into ./ext-modules.d.ts for some reason so it's in this file for the time being
|
|
||||||
declare module 'electron' {
|
|
||||||
interface App {
|
|
||||||
config: typeof import('./config');
|
|
||||||
plugins: typeof import('./plugins');
|
|
||||||
getWindows: () => Set<BrowserWindow>;
|
|
||||||
getLastFocusedWindow: () => BrowserWindow | null;
|
|
||||||
windowCallback: (win: BrowserWindow) => void;
|
|
||||||
createWindow: (fn?: (win: BrowserWindow) => void, options?: Record<string, any>) => BrowserWindow;
|
|
||||||
setVersion: (version: string) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Server = import('./rpc').Server;
|
|
||||||
interface BrowserWindow {
|
|
||||||
uid: string;
|
|
||||||
sessions: Map<any, any>;
|
|
||||||
focusTime: number;
|
|
||||||
clean: () => void;
|
|
||||||
rpc: Server;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up config
|
// set up config
|
||||||
config.setup();
|
config.setup();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue