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