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 | import { Path, PathFragment, virtualFs } from '@angular-devkit/core';
|
---|
10 | import { Action } from './action';
|
---|
11 | import { DirEntry, FileEntry, FilePredicate, FileVisitor, MergeStrategy, Tree, UpdateRecorder } from './interface';
|
---|
12 | export declare class HostDirEntry implements DirEntry {
|
---|
13 | readonly parent: DirEntry | null;
|
---|
14 | readonly path: Path;
|
---|
15 | protected _host: virtualFs.SyncDelegateHost;
|
---|
16 | protected _tree: Tree;
|
---|
17 | constructor(parent: DirEntry | null, path: Path, _host: virtualFs.SyncDelegateHost, _tree: Tree);
|
---|
18 | get subdirs(): PathFragment[];
|
---|
19 | get subfiles(): PathFragment[];
|
---|
20 | dir(name: PathFragment): DirEntry;
|
---|
21 | file(name: PathFragment): FileEntry | null;
|
---|
22 | visit(visitor: FileVisitor): void;
|
---|
23 | private getSubfilesRecursively;
|
---|
24 | }
|
---|
25 | export declare class HostTree implements Tree {
|
---|
26 | protected _backend: virtualFs.ReadonlyHost<{}>;
|
---|
27 | private readonly _id;
|
---|
28 | private _record;
|
---|
29 | private _recordSync;
|
---|
30 | private _ancestry;
|
---|
31 | private _dirCache;
|
---|
32 | static isHostTree(tree: Tree): tree is HostTree;
|
---|
33 | constructor(_backend?: virtualFs.ReadonlyHost<{}>);
|
---|
34 | protected _normalizePath(path: string): Path;
|
---|
35 | protected _willCreate(path: Path): boolean;
|
---|
36 | protected _willOverwrite(path: Path): boolean;
|
---|
37 | protected _willDelete(path: Path): boolean;
|
---|
38 | protected _willRename(path: Path): boolean;
|
---|
39 | branch(): Tree;
|
---|
40 | private isAncestorOf;
|
---|
41 | merge(other: Tree, strategy?: MergeStrategy): void;
|
---|
42 | get root(): DirEntry;
|
---|
43 | read(path: string): Buffer | null;
|
---|
44 | exists(path: string): boolean;
|
---|
45 | get(path: string): FileEntry | null;
|
---|
46 | getDir(path: string): DirEntry;
|
---|
47 | visit(visitor: FileVisitor): void;
|
---|
48 | overwrite(path: string, content: Buffer | string): void;
|
---|
49 | beginUpdate(path: string): UpdateRecorder;
|
---|
50 | commitUpdate(record: UpdateRecorder): void;
|
---|
51 | create(path: string, content: Buffer | string): void;
|
---|
52 | delete(path: string): void;
|
---|
53 | rename(from: string, to: string): void;
|
---|
54 | apply(action: Action, strategy?: MergeStrategy): void;
|
---|
55 | private generateActions;
|
---|
56 | get actions(): Action[];
|
---|
57 | }
|
---|
58 | export declare class HostCreateTree extends HostTree {
|
---|
59 | constructor(host: virtualFs.ReadonlyHost);
|
---|
60 | }
|
---|
61 | export declare class FilterHostTree extends HostTree {
|
---|
62 | constructor(tree: HostTree, filter?: FilePredicate<boolean>);
|
---|
63 | }
|
---|