forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock-fs.d.ts
57 lines (45 loc) · 1.35 KB
/
mock-fs.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Type definitions for mock-fs 3.6.0
// Project: https://github.com/tschaub/mock-fs
// Definitions by: Wim Looman <https://github.com/Nemo157>, Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "mock-fs" {
import fs = require("fs");
function mock(config?: mock.Config, options?: mock.Options): void;
namespace mock {
function file(config: FileConfig): File;
function directory(config: DirectoryConfig): Directory;
function symlink(config: SymlinkConfig): Symlink;
function restore(): void;
function fs(config?: Config, options?: Options): typeof fs;
interface Config {
[path: string]: string | Buffer | File | Directory | Symlink | Config;
}
interface Options {
createCwd?: boolean;
createTmp?: boolean;
}
interface CommonConfig {
mode?: number;
uid?: number;
git?: number;
atime?: Date;
ctime?: Date;
mtime?: Date;
birthtime?: Date;
}
interface FileConfig extends CommonConfig {
content: string | Buffer;
}
interface DirectoryConfig extends CommonConfig {
items: Config;
}
interface SymlinkConfig extends CommonConfig {
path: string;
}
class File { private _file: any; }
class Directory { private _directory: any; }
class Symlink { private _symlink: any; }
}
export = mock;
}