Skip to content

Commit

Permalink
introduce the new types from enhanced-resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarkInn committed Apr 19, 2023
1 parent 8bc34bc commit 58396f5
Showing 1 changed file with 42 additions and 17 deletions.
59 changes: 42 additions & 17 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4191,17 +4191,31 @@ declare interface FileSystem {
arg2: FileSystemCallback<string | Buffer>
): void;
};
readdir: {
(
arg0: string,
arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
): void;
(
arg0: string,
arg1: object,
arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
): void;
};
readdir: (
arg0: string,
arg1?:
| null
| "ascii"
| "utf8"
| "utf16le"
| "ucs2"
| "latin1"
| "binary"
| ((
arg0?: null | NodeJS.ErrnoException,
arg1?: any[] | (string | Buffer)[]
) => void)
| ReaddirOptions
| "utf-8"
| "ucs-2"
| "base64"
| "hex"
| "buffer",
arg2?: (
arg0?: null | NodeJS.ErrnoException,
arg1?: any[] | (string | Buffer)[]
) => void
) => void;
readJson?: {
(arg0: string, arg1: FileSystemCallback<object>): void;
(arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
Expand Down Expand Up @@ -4234,11 +4248,6 @@ declare interface FileSystem {
declare interface FileSystemCallback<T> {
(err?: null | (PossibleFileSystemError & Error), result?: T): any;
}
declare interface FileSystemDirent {
name: string | Buffer;
isDirectory: () => boolean;
isFile: () => boolean;
}
declare abstract class FileSystemInfo {
fs: InputFileSystem;
logger?: WebpackLogger;
Expand Down Expand Up @@ -4590,7 +4599,7 @@ declare interface HashedModuleIdsPluginOptions {
/**
* The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
*/
hashDigest?: "latin1" | "hex" | "base64";
hashDigest?: "latin1" | "base64" | "hex";

/**
* The prefix length of the hash digest to use, defaults to 4.
Expand Down Expand Up @@ -9411,6 +9420,22 @@ declare class ReadFileCompileWasmPlugin {
*/
apply(compiler: Compiler): void;
}
declare interface ReaddirOptions {
encoding?:
| null
| "ascii"
| "utf8"
| "utf16le"
| "ucs2"
| "latin1"
| "binary"
| "utf-8"
| "ucs-2"
| "base64"
| "hex"
| "buffer";
withFileTypes?: boolean;
}
declare class RealContentHashPlugin {
constructor(__0: { hashFunction: any; hashDigest: any });

Expand Down

0 comments on commit 58396f5

Please sign in to comment.