refactor: Port content-scripts-injector to TypeScript (#17012)

This commit is contained in:
Felix Rieseberg 2019-02-18 12:47:07 +00:00 committed by Samuel Attard
parent 35c3a7e130
commit eaa0e28396
4 changed files with 46 additions and 13 deletions

View file

@ -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
}