File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -387,9 +387,16 @@ const { ABSOLUTE_PATH_REGEXP } = require("../util/identifier");
387387 * @typedef {(pathLike: PathLike, callback: NoParamCallback) => void } Unlink
388388 */
389389
390+ /**
391+ * @typedef {NonNullable<Exclude<Parameters<typeof import("fs").createReadStream>[1], BufferEncoding | undefined>["fs"]> } NodeReadStreamFSImplementation
392+ */
393+
390394/**
391395 * Defines the create read stream fs implementation type used by this module.
392- * @typedef {import("fs").CreateReadStreamFSImplementation } CreateReadStreamFSImplementation
396+ * @typedef {object } CreateReadStreamFSImplementation
397+ * @property {NodeReadStreamFSImplementation["open"]= } open
398+ * @property {NodeReadStreamFSImplementation["close"]= } close
399+ * @property {NodeReadStreamFSImplementation["read"] } read
393400 */
394401
395402/**
@@ -471,9 +478,17 @@ const { ABSOLUTE_PATH_REGEXP } = require("../util/identifier");
471478 * @typedef {import("fs").FSImplementation } FSImplementation
472479 */
473480
481+ /**
482+ * @typedef {NonNullable<Exclude<Parameters<typeof import("fs").createWriteStream>[1], BufferEncoding | undefined>["fs"]> } NodeWriteStreamFSImplementation
483+ */
484+
474485/**
475486 * Defines the create write stream fs implementation type used by this module.
476- * @typedef {import("fs").CreateWriteStreamFSImplementation } CreateWriteStreamFSImplementation
487+ * @typedef {object } CreateWriteStreamFSImplementation
488+ * @property {NodeWriteStreamFSImplementation["open"]= } open
489+ * @property {NodeWriteStreamFSImplementation["close"]= } close
490+ * @property {NodeWriteStreamFSImplementation["write"] } write
491+ * @property {NodeWriteStreamFSImplementation["writev"]= } writev
477492 */
478493
479494/**
Original file line number Diff line number Diff line change @@ -91,10 +91,6 @@ import {
9191 WithStatement,
9292 YieldExpression
9393} from "estree";
94- import {
95- CreateReadStreamFSImplementation,
96- CreateWriteStreamFSImplementation
97- } from "fs";
9894import { FileHandle } from "fs/promises";
9995import {
10096 Server as ServerImportHttp,
@@ -5963,8 +5959,27 @@ declare interface CopyTransformCacheKeys {
59635959 [index: string]: any;
59645960}
59655961type CreateData = NormalModuleCreateData & { settings: ModuleSettings };
5962+
5963+ /**
5964+ * Defines the create read stream fs implementation type used by this module.
5965+ */
5966+ declare interface CreateReadStreamFSImplementation {
5967+ open?: (...args: any[]) => any;
5968+ close?: (...args: any[]) => any;
5969+ read: (...args: any[]) => any;
5970+ }
59665971type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
59675972 Record<string, any>;
5973+
5974+ /**
5975+ * Defines the create write stream fs implementation type used by this module.
5976+ */
5977+ declare interface CreateWriteStreamFSImplementation {
5978+ open?: (...args: any[]) => any;
5979+ close?: (...args: any[]) => any;
5980+ write: (...args: any[]) => any;
5981+ writev?: (...args: any[]) => any;
5982+ }
59685983type CreatedObject<T, F> = T extends ChunkGroupInfoWithName[]
59695984 ? Record<string, StatsChunkGroup>
59705985 : T extends (infer V)[]
You can’t perform that action at this time.
0 commit comments