UNPKG

1.35 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.dev/license
7 */
8import { Observable } from 'rxjs';
9import { BaseException } from '../../exception';
10import { Path, PathFragment } from '../path';
11import { FileBuffer, FileBufferLike, Host, HostCapabilities, HostWatchEvent, HostWatchOptions, Stats } from './interface';
12export declare class SynchronousDelegateExpectedException extends BaseException {
13 constructor();
14}
15/**
16 * Implement a synchronous-only host interface (remove the Observable parts).
17 */
18export declare class SyncDelegateHost<T extends object = {}> {
19 protected _delegate: Host<T>;
20 constructor(_delegate: Host<T>);
21 protected _doSyncCall<ResultT>(observable: Observable<ResultT>): ResultT;
22 get capabilities(): HostCapabilities;
23 get delegate(): Host<T>;
24 write(path: Path, content: FileBufferLike): void;
25 read(path: Path): FileBuffer;
26 delete(path: Path): void;
27 rename(from: Path, to: Path): void;
28 list(path: Path): PathFragment[];
29 exists(path: Path): boolean;
30 isDirectory(path: Path): boolean;
31 isFile(path: Path): boolean;
32 stat(path: Path): Stats<T> | null;
33 watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null;
34}