UNPKG

1.6 kBTypeScriptView Raw
1/// <reference types="node" />
2/// <reference types="node" />
3/// <reference types="node" />
4import { Dirent } from 'fs';
5import { IFS } from './fs';
6import { Readable, Writable } from 'stream';
7export interface IUnionFsError extends Error {
8 prev?: IUnionFsError | null;
9}
10type readdirEntry = string | Buffer | Dirent;
11/**
12 * Union object represents a stack of filesystems
13 */
14export declare class Union {
15 private fss;
16 ReadStream: typeof Readable | (new (...args: any[]) => Readable);
17 WriteStream: typeof Writable | (new (...args: any[]) => Writable);
18 private promises;
19 constructor();
20 unwatchFile: (...args: any[]) => void;
21 watch: (...args: any[]) => {};
22 watchFile: (...args: any[]) => void;
23 existsSync: (path: string) => boolean;
24 readdir: (...args: any[]) => void;
25 readdirSync: (...args: any[]) => Array<readdirEntry>;
26 readdirPromise: (...args: any[]) => Promise<Array<readdirEntry>>;
27 private pathFromReaddirEntry;
28 private sortedArrayFromReaddirResult;
29 createReadStream: (path: string) => import("fs").ReadStream;
30 createWriteStream: (path: string) => import("fs").WriteStream;
31 /**
32 * Adds a filesystem to the list of filesystems in the union
33 * The new filesystem object is added as the last filesystem used
34 * when searching for a file.
35 *
36 * @param fs the filesystem interface to be added to the queue of FS's
37 * @returns this instance of a unionFS
38 */
39 use(fs: IFS): this;
40 private syncMethod;
41 private asyncMethod;
42 promiseMethod(method: string, args: any[]): Promise<any>;
43}
44export {};