UNPKG

1.03 kBTypeScriptView Raw
1import { IMinimatch } from 'minimatch';
2declare namespace fixturify {
3 /**
4 A recursive JSON representation of a directory. This representation includes
5 both files, their contents and directories which can contain both files and
6 directories.
7
8 ```ts
9 const files : DirJSON = {
10 'index.js': 'content',
11 'foo.txt': 'content',
12 'folder': {
13 'index.js': 'content',
14 'apple.js': 'content',
15 'other-folder': { }
16 },
17 }
18 ```
19 */
20 interface DirJSON {
21 [filename: string]: DirJSON | string | null;
22 }
23 interface Options {
24 include?: (IMinimatch | string)[];
25 exclude?: (IMinimatch | string)[];
26 ignoreEmptyDirs?: boolean;
27 globs?: (string | IMinimatch)[];
28 ignore?: (string | IMinimatch)[];
29 directories?: boolean;
30 }
31 function readSync(dir: string, options?: Options, _relativeRoot?: string): DirJSON;
32 function writeSync(dir: string, obj: DirJSON): void;
33}
34export = fixturify;