Files
gulp-haxetool/src/@types/vinyl.d.ts
T
shmyga 428f9d100e
test / test (push) Failing after 6m5s
refactor(types): improve vinyl types
2026-10-27 19:24:54 +03:00

47 lines
1.0 KiB
TypeScript

declare module "vinyl" {
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;
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;
}