forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock-fs.d.ts
51 lines (40 loc) · 1.17 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
// Type definitions for mock-fs 2.5.0
// Project: https://github.com/tschaub/mock-fs
// Definitions by: Wim Looman <https://github.com/Nemo157>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "mock-fs" {
import fs = require("fs");
function mock(config?: mock.Config): void;
module mock {
function file(config: FileConfig): File;
function directory(config: DirectoryConfig): Directory;
function symlink(config: SymlinkConfig): Symlink;
function restore(): void;
function fs(config?: Config): typeof fs;
interface Config {
[path: string]: string | Buffer | File | Directory | Symlink | Config;
}
interface CommonConfig {
mode?: number;
uid?: number;
git?: number;
atime?: Date;
ctime?: Date;
mtime?: 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;
}