UNPKG

2.08 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 */
8/// <reference types="node" />
9/// <reference types="@types/node/fs" />
10/// <reference types="@types/node/ts4.8/fs" />
11import { Stats } from 'node:fs';
12import { Observable } from 'rxjs';
13import { Path, PathFragment, virtualFs } from '../src';
14/**
15 * An implementation of the Virtual FS using Node as the background. There are two versions; one
16 * synchronous and one asynchronous.
17 */
18export declare class NodeJsAsyncHost implements virtualFs.Host<Stats> {
19 get capabilities(): virtualFs.HostCapabilities;
20 write(path: Path, content: virtualFs.FileBuffer): Observable<void>;
21 read(path: Path): Observable<virtualFs.FileBuffer>;
22 delete(path: Path): Observable<void>;
23 rename(from: Path, to: Path): Observable<void>;
24 list(path: Path): Observable<PathFragment[]>;
25 exists(path: Path): Observable<boolean>;
26 isDirectory(path: Path): Observable<boolean>;
27 isFile(path: Path): Observable<boolean>;
28 stat(path: Path): Observable<virtualFs.Stats<Stats>>;
29 watch(path: Path, _options?: virtualFs.HostWatchOptions): Observable<virtualFs.HostWatchEvent> | null;
30}
31/**
32 * An implementation of the Virtual FS using Node as the backend, synchronously.
33 */
34export declare class NodeJsSyncHost implements virtualFs.Host<Stats> {
35 get capabilities(): virtualFs.HostCapabilities;
36 write(path: Path, content: virtualFs.FileBuffer): Observable<void>;
37 read(path: Path): Observable<virtualFs.FileBuffer>;
38 delete(path: Path): Observable<void>;
39 rename(from: Path, to: Path): Observable<void>;
40 list(path: Path): Observable<PathFragment[]>;
41 exists(path: Path): Observable<boolean>;
42 isDirectory(path: Path): Observable<boolean>;
43 isFile(path: Path): Observable<boolean>;
44 stat(path: Path): Observable<virtualFs.Stats<Stats>>;
45 watch(path: Path, _options?: virtualFs.HostWatchOptions): Observable<virtualFs.HostWatchEvent> | null;
46}