1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import { BaseException, Path } from '@angular-devkit/core';
|
10 | export declare class UnknownActionException extends BaseException {
|
11 | constructor(action: Action);
|
12 | }
|
13 | export declare type Action = CreateFileAction | OverwriteFileAction | RenameFileAction | DeleteFileAction;
|
14 | export interface ActionBase {
|
15 | readonly id: number;
|
16 | readonly parent: number;
|
17 | readonly path: Path;
|
18 | }
|
19 | export declare class ActionList implements Iterable<Action> {
|
20 | private _actions;
|
21 | protected _action(action: Partial<Action>): void;
|
22 | create(path: Path, content: Buffer): void;
|
23 | overwrite(path: Path, content: Buffer): void;
|
24 | rename(path: Path, to: Path): void;
|
25 | delete(path: Path): void;
|
26 | optimize(): void;
|
27 | push(action: Action): void;
|
28 | get(i: number): Action;
|
29 | has(action: Action): boolean;
|
30 | find(predicate: (value: Action) => boolean): Action | null;
|
31 | forEach(fn: (value: Action, index: number, array: Action[]) => void, thisArg?: {}): void;
|
32 | get length(): number;
|
33 | [Symbol.iterator](): IterableIterator<Action>;
|
34 | }
|
35 | export declare function isContentAction(action: Action): action is CreateFileAction | OverwriteFileAction;
|
36 | export interface CreateFileAction extends ActionBase {
|
37 | readonly kind: 'c';
|
38 | readonly content: Buffer;
|
39 | }
|
40 | export interface OverwriteFileAction extends ActionBase {
|
41 | readonly kind: 'o';
|
42 | readonly content: Buffer;
|
43 | }
|
44 | export interface RenameFileAction extends ActionBase {
|
45 | readonly kind: 'r';
|
46 | readonly to: Path;
|
47 | }
|
48 | export interface DeleteFileAction extends ActionBase {
|
49 | readonly kind: 'd';
|
50 | }
|