47 lines
1.0 KiB
TypeScript
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;
|
|
}
|