build: tsify asar and move to webpack js2c pipeline (#24495)

* build: tsify asar and move to webpack js2c pipeline

* build: use the webpack provider for fs-wrapper
This commit is contained in:
Samuel Attard 2020-07-16 11:38:31 -07:00 committed by GitHub
parent 4c3da359fc
commit f649e604be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 889 additions and 814 deletions

View file

@ -46,6 +46,42 @@ declare namespace NodeJS {
addRemoteObjectRef(contextId: string, id: number): void;
}
type AsarFileInfo = {
size: number;
unpacked: boolean;
offset: number;
};
type AsarFileStat = {
size: number;
offset: number;
isFile: boolean;
isDirectory: boolean;
isLink: boolean;
}
interface AsarArchive {
readonly path: string;
getFileInfo(path: string): AsarFileInfo | false;
stat(path: string): AsarFileStat | false;
readdir(path: string): string[] | false;
realpath(path: string): string | false;
copyFileOut(path: string): string | false;
getFd(): number | -1;
}
interface AsarBinding {
createArchive(path: string): AsarArchive;
splitPath(path: string): {
isAsar: false;
} | {
isAsar: true;
asarPath: string;
filePath: string;
};
initAsarSupport(require: NodeJS.Require): void;
}
type DataPipe = {
write: (buf: Uint8Array) => Promise<void>;
done: () => void;
@ -108,6 +144,7 @@ declare namespace NodeJS {
net: any;
createURLLoader(options: CreateURLLoaderOptions): URLLoader;
};
_linkedBinding(name: 'electron_common_asar'): AsarBinding;
log: NodeJS.WriteStream['write'];
activateUvLoop(): void;