[6a3a178] | 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 { 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 | /**
|
---|
| 37 | * @deprecated since version 11.0. not used anymore can be removed in future version.
|
---|
| 38 | */
|
---|
| 39 | export declare function isAction(action: any): action is Action;
|
---|
| 40 | export interface CreateFileAction extends ActionBase {
|
---|
| 41 | readonly kind: 'c';
|
---|
| 42 | readonly content: Buffer;
|
---|
| 43 | }
|
---|
| 44 | export interface OverwriteFileAction extends ActionBase {
|
---|
| 45 | readonly kind: 'o';
|
---|
| 46 | readonly content: Buffer;
|
---|
| 47 | }
|
---|
| 48 | export interface RenameFileAction extends ActionBase {
|
---|
| 49 | readonly kind: 'r';
|
---|
| 50 | readonly to: Path;
|
---|
| 51 | }
|
---|
| 52 | export interface DeleteFileAction extends ActionBase {
|
---|
| 53 | readonly kind: 'd';
|
---|
| 54 | }
|
---|