Skip to content

Commit bb52bfc

Browse files
fix: types
1 parent 576ef3b commit bb52bfc

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

lib/Resolver.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const {
1717

1818
/** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */
1919

20-
/** @typedef {Error & {details?: string}} ErrorWithDetail */
20+
/** @typedef {Error & { details?: string }} ErrorWithDetail */
2121

22-
/** @typedef {(err: ErrorWithDetail|null, res?: string|false, req?: ResolveRequest) => void} ResolveCallback */
22+
/** @typedef {(err: ErrorWithDetail | null, res?: string | false, req?: ResolveRequest) => void} ResolveCallback */
2323

2424
/**
2525
* @typedef {Object} FileSystemStats
@@ -65,7 +65,7 @@ const {
6565
* @property {(function(string, FileSystemCallback<Buffer | string>): void) & function(string, object, FileSystemCallback<Buffer | string>): void} readlink
6666
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<Buffer | string>): void=} lstat
6767
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<Buffer | string>): void} stat
68-
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<Buffer | string>): void} realpath
68+
* @property {(function(string, FileSystemCallback<Buffer | string>): void) & function(string, object, FileSystemCallback<Buffer | string>): void=} realpath
6969
*/
7070

7171
/**
@@ -76,7 +76,7 @@ const {
7676
* @property {function(string, object=): Buffer | string} readlinkSync
7777
* @property {function(string, object=): FileSystemStats=} lstatSync
7878
* @property {function(string, object=): FileSystemStats} statSync
79-
* @property {function(string, object=): string | Buffer} realpathSync
79+
* @property {function(string, object=): string | Buffer=} realpathSync
8080
*/
8181

8282
/**

types.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ declare class CachedInputFileSystem {
104104
): void;
105105
};
106106
readlinkSync: (arg0: string, arg1?: object) => string | Buffer;
107+
realpath?: {
108+
(arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
109+
(
110+
arg0: string,
111+
arg1: object,
112+
arg2: FileSystemCallback<string | Buffer>
113+
): void;
114+
};
115+
realpathSync?: (arg0: string, arg1?: object) => string | Buffer;
107116
purge(what?: string | Set<string> | string[]): void;
108117
}
109118
declare class CloneBasenamePlugin {
@@ -206,6 +215,14 @@ declare interface FileSystem {
206215
arg2: FileSystemCallback<string | Buffer>
207216
): void;
208217
};
218+
realpath?: {
219+
(arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
220+
(
221+
arg0: string,
222+
arg1: object,
223+
arg2: FileSystemCallback<string | Buffer>
224+
): void;
225+
};
209226
}
210227
declare interface FileSystemCallback<T> {
211228
(err?: null | (PossibleFileSystemError & Error), result?: T): any;

0 commit comments

Comments
 (0)