UNPKG

1.67 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 { BaseException, JsonValue, Path, PathFragment } from '@angular-devkit/core';
10import { Action } from './action';
11import { DirEntry, MergeStrategy, Tree, UpdateRecorder } from './interface';
12export declare class CannotCreateFileException extends BaseException {
13 constructor(path: string);
14}
15export declare class NullTreeDirEntry implements DirEntry {
16 readonly path: Path;
17 get parent(): DirEntry | null;
18 constructor(path: Path);
19 readonly subdirs: PathFragment[];
20 readonly subfiles: PathFragment[];
21 dir(name: PathFragment): DirEntry;
22 file(_name: PathFragment): null;
23 visit(): void;
24}
25export declare class NullTree implements Tree {
26 branch(): Tree;
27 merge(_other: Tree, _strategy?: MergeStrategy): void;
28 readonly root: DirEntry;
29 exists(_path: string): boolean;
30 read(_path: string): null;
31 readText(path: string): string;
32 readJson(path: string): JsonValue;
33 get(_path: string): null;
34 getDir(path: string): NullTreeDirEntry;
35 visit(): void;
36 beginUpdate(path: string): never;
37 commitUpdate(record: UpdateRecorder): never;
38 copy(path: string, _to: string): never;
39 delete(path: string): never;
40 create(path: string, _content: Buffer | string): never;
41 rename(path: string, _to: string): never;
42 overwrite(path: string, _content: Buffer | string): never;
43 apply(_action: Action, _strategy?: MergeStrategy): void;
44 get actions(): Action[];
45}