1
Fork 0
defiler/types/index.d.ts

33 lines
589 B
TypeScript

import * as fs from 'fs';
export class Defiler {
paths: Set<string>;
files: Map<string, File>;
constructor(...args: any[]);
exec(): Promise<void>;
get(path: string): Promise<File>;
get(paths: string[]): Promise<File[]>;
get(filter: Filter): Promise<File[]>;
add(file: FileData): void;
resolve(path: string): string;
}
export class File {
stats: fs.Stats;
path: string;
dir: string;
filename: string;
ext: string;
enc: string;
bytes: Buffer;
text: string;
}
interface Filter {
(path: string): boolean;
}
interface FileData {
path: string;
[propName: string]: any;
}