refactor: Port content-scripts-injector to TypeScript (#17012)
This commit is contained in:
parent
35c3a7e130
commit
eaa0e28396
4 changed files with 46 additions and 13 deletions
19
typings/internal-electron.d.ts
vendored
19
typings/internal-electron.d.ts
vendored
|
@ -27,6 +27,25 @@ declare namespace Electron {
|
|||
__ELECTRON_SERIALIZED_ERROR__: true
|
||||
}
|
||||
|
||||
interface InjectionBase {
|
||||
url: string;
|
||||
code: string
|
||||
}
|
||||
|
||||
interface ContentScript {
|
||||
js: Array<InjectionBase>;
|
||||
css: Array<InjectionBase>;
|
||||
runAt: string;
|
||||
matches: {
|
||||
some: (input: (pattern: string) => boolean | RegExpMatchArray | null) => boolean;
|
||||
}
|
||||
}
|
||||
|
||||
interface RendererProcessPreference {
|
||||
contentScripts: Array<ContentScript>
|
||||
extensionId: string;
|
||||
}
|
||||
|
||||
interface IpcRendererInternal extends Electron.IpcRenderer {
|
||||
sendToAll(webContentsId: number, channel: string, ...args: any[]): void
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue