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