UNPKG

1.8 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" />
9import { JsonValue, Path, PathFragment } from '@angular-devkit/core';
10import { Action } from './action';
11import { DirEntry, FileEntry, FileVisitor, MergeStrategy, Tree, UpdateRecorder } from './interface';
12declare class ScopedDirEntry implements DirEntry {
13 private _base;
14 readonly scope: Path;
15 constructor(_base: DirEntry, scope: Path);
16 get parent(): DirEntry | null;
17 get path(): Path;
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}
24export declare class ScopedTree implements Tree {
25 private _base;
26 readonly _root: ScopedDirEntry;
27 constructor(_base: Tree, scope: string);
28 get root(): DirEntry;
29 branch(): Tree;
30 merge(other: Tree, strategy?: MergeStrategy): void;
31 read(path: string): Buffer | null;
32 readText(path: string): string;
33 readJson(path: string): JsonValue;
34 exists(path: string): boolean;
35 get(path: string): FileEntry | null;
36 getDir(path: string): DirEntry;
37 visit(visitor: FileVisitor): void;
38 overwrite(path: string, content: Buffer | string): void;
39 beginUpdate(path: string): UpdateRecorder;
40 commitUpdate(record: UpdateRecorder): void;
41 create(path: string, content: Buffer | string): void;
42 delete(path: string): void;
43 rename(from: string, to: string): void;
44 apply(action: Action, strategy?: MergeStrategy): void;
45 get actions(): Action[];
46 private _fullPath;
47 private _fullPathAction;
48}
49export {};