refactor(types): improve vinyl types
test / test (push) Failing after 6m5s

This commit is contained in:
2026-10-27 19:24:54 +03:00
parent fc7f97b520
commit 428f9d100e
5 changed files with 58 additions and 13 deletions
+39 -7
View File
@@ -1,14 +1,46 @@
declare module "vinyl" {
export class File {
path: string;
import { type Stats } from "fs";
import type Stream from "stream";
export type Contents = Stream | Buffer | null;
export interface Options<C extends Contents = Contents> {
contents?: C;
cwd?: string;
base?: string;
path?: string;
stat?: Stats;
history?: string[];
}
export class File<C extends Contents = Contents> {
contents: C;
cwd: string;
base: string;
contents: any;
stat: any;
history: any[];
constructor(params: any);
clone(options?: any);
relative: string;
dirname: string;
basename: string;
stem: string;
extname: string;
path: string;
symlink: string;
stat: Stats;
history: string[];
constructor(options?: Options<C>);
isBuffer(): boolean;
isStream(): boolean;
isNull(): boolean;
isDirectory(): boolean;
isSymbolic(): boolean;
clone(options?: Options<C>);
static isCustomProp(key: string): boolean;
static isVinyl(file: File | any): boolean;
}
export type StreamFile = File<Stream>;
export type BufferFile = File<Buffer>;
export default File;
}