1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Observable } from 'rxjs';
|
9 | import { Path, PathFragment } from '../path';
|
10 | import { FileBuffer, HostWatchEvent, HostWatchOptions, Stats } from './interface';
|
11 | import { SimpleMemoryHost, SimpleMemoryHostStats } from './memory';
|
12 | import { SyncDelegateHost } from './sync';
|
13 | export type TestLogRecord = {
|
14 | kind: 'write' | 'read' | 'delete' | 'list' | 'exists' | 'isDirectory' | 'isFile' | 'stat' | 'watch';
|
15 | path: Path;
|
16 | } | {
|
17 | kind: 'rename';
|
18 | from: Path;
|
19 | to: Path;
|
20 | };
|
21 | export declare class TestHost extends SimpleMemoryHost {
|
22 | protected _records: TestLogRecord[];
|
23 | protected _sync: SyncDelegateHost<{}> | null;
|
24 | constructor(map?: {
|
25 | [path: string]: string;
|
26 | });
|
27 | get records(): TestLogRecord[];
|
28 | clearRecords(): void;
|
29 | get files(): Path[];
|
30 | get sync(): SyncDelegateHost<{}>;
|
31 | clone(): TestHost;
|
32 | protected _write(path: Path, content: FileBuffer): void;
|
33 | protected _read(path: Path): ArrayBuffer;
|
34 | protected _delete(path: Path): void;
|
35 | protected _rename(from: Path, to: Path): void;
|
36 | protected _list(path: Path): PathFragment[];
|
37 | protected _exists(path: Path): boolean;
|
38 | protected _isDirectory(path: Path): boolean;
|
39 | protected _isFile(path: Path): boolean;
|
40 | protected _stat(path: Path): Stats<SimpleMemoryHostStats> | null;
|
41 | protected _watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent>;
|
42 | $write(path: string, content: string): void;
|
43 | $read(path: string): string;
|
44 | $list(path: string): PathFragment[];
|
45 | $exists(path: string): boolean;
|
46 | $isDirectory(path: string): boolean;
|
47 | $isFile(path: string): boolean;
|
48 | }
|