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

34 lines
589 B
TypeScript
Raw Normal View History

2018-11-13 06:03:13 -05:00
import * as fs from 'fs';
export class Defiler {
2019-01-06 16:55:27 -05:00
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;
2018-11-13 06:03:13 -05:00
}
export class File {
stats: fs.Stats;
path: string;
dir: string;
filename: string;
ext: string;
enc: string;
bytes: Buffer;
text: string;
}
interface Filter {
2019-01-06 16:55:27 -05:00
(path: string): boolean;
2018-11-13 06:03:13 -05:00
}
interface FileData {
2019-01-06 16:55:27 -05:00
path: string;
[propName: string]: any;
2018-11-13 06:03:13 -05:00
}