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:
parent
4c3da359fc
commit
f649e604be
13 changed files with 889 additions and 814 deletions
37
typings/internal-ambient.d.ts
vendored
37
typings/internal-ambient.d.ts
vendored
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue