build: convert touch-bar to typescript (#24511)
This commit is contained in:
parent
3f37ff87d2
commit
4c3da359fc
7 changed files with 491 additions and 366 deletions
15
typings/internal-electron.d.ts
vendored
15
typings/internal-electron.d.ts
vendored
|
@ -19,6 +19,17 @@ declare namespace Electron {
|
|||
setAppPath(path: string | null): void;
|
||||
}
|
||||
|
||||
type TouchBarItemType = NonNullable<Electron.TouchBarConstructorOptions['items']>[0];
|
||||
|
||||
interface BrowserWindow {
|
||||
_touchBar: Electron.TouchBar | null;
|
||||
_setTouchBarItems: (items: TouchBarItemType[]) => void;
|
||||
_setEscapeTouchBarItem: (item: TouchBarItemType | {}) => void;
|
||||
_refreshTouchBarItem: (itemID: string) => void;
|
||||
on(event: '-touch-bar-interaction', listener: (event: Event, itemID: string, details: any) => void): this;
|
||||
removeListener(event: '-touch-bar-interaction', listener: (event: Event, itemID: string, details: any) => void): this;
|
||||
}
|
||||
|
||||
interface ContextBridge {
|
||||
internalContextBridge: {
|
||||
contextIsolationEnabled: boolean;
|
||||
|
@ -29,6 +40,10 @@ declare namespace Electron {
|
|||
}
|
||||
}
|
||||
|
||||
interface TouchBar {
|
||||
_removeFromWindow: (win: BrowserWindow) => void;
|
||||
}
|
||||
|
||||
interface WebContents {
|
||||
_getURL(): string;
|
||||
_loadURL(url: string, options: Electron.LoadURLOptions): void;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue