UNPKG

1.07 kBTypeScriptView 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 { Observable } from 'rxjs';
9import { Path, PathFragment } from '../path';
10import { FileBuffer, HostCapabilities, ReadonlyHost, Stats } from './interface';
11/**
12 * A Host that filters out errors. The only exception is `read()` which will still error out if
13 * the delegate returned an error (e.g. NodeJS will error out if the file doesn't exist).
14 */
15export declare class SafeReadonlyHost<StatsT extends object = {}> implements ReadonlyHost<StatsT> {
16 private _delegate;
17 constructor(_delegate: ReadonlyHost<StatsT>);
18 get capabilities(): HostCapabilities;
19 read(path: Path): Observable<FileBuffer>;
20 list(path: Path): Observable<PathFragment[]>;
21 exists(path: Path): Observable<boolean>;
22 isDirectory(path: Path): Observable<boolean>;
23 isFile(path: Path): Observable<boolean>;
24 stat(path: Path): Observable<Stats<StatsT> | null> | null;
25}