1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Path, PathFragment } from '../path';
|
9 | import { FileBuffer, FileBufferLike, Host, Stats } from './interface';
|
10 | export interface SyncHostHandler<StatsT extends object = {}> {
|
11 | read(path: Path): FileBuffer;
|
12 | list(path: Path): PathFragment[];
|
13 | exists(path: Path): boolean;
|
14 | isDirectory(path: Path): boolean;
|
15 | isFile(path: Path): boolean;
|
16 | stat(path: Path): Stats<StatsT> | null;
|
17 | write(path: Path, content: FileBufferLike): void;
|
18 | delete(path: Path): void;
|
19 | rename(from: Path, to: Path): void;
|
20 | }
|
21 | export declare function createSyncHost<StatsT extends object = {}>(handler: SyncHostHandler<StatsT>): Host<StatsT>;
|