UNPKG

844 BTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { Path, PathFragment } from '../path';
9import { FileBuffer, FileBufferLike, Host, Stats } from './interface';
10export 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}
21export declare function createSyncHost<StatsT extends object = {}>(handler: SyncHostHandler<StatsT>): Host<StatsT>;