UNPKG

1.6 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.dev/license
7 */
8import { virtualFs } from '@angular-devkit/core';
9import { Observable, Subject } from 'rxjs';
10import { HostSink } from './host';
11export interface DryRunErrorEvent {
12 kind: 'error';
13 description: 'alreadyExist' | 'doesNotExist';
14 path: string;
15}
16export interface DryRunDeleteEvent {
17 kind: 'delete';
18 path: string;
19}
20export interface DryRunCreateEvent {
21 kind: 'create';
22 path: string;
23 content: Buffer;
24}
25export interface DryRunUpdateEvent {
26 kind: 'update';
27 path: string;
28 content: Buffer;
29}
30export interface DryRunRenameEvent {
31 kind: 'rename';
32 path: string;
33 to: string;
34}
35export type DryRunEvent = DryRunErrorEvent | DryRunDeleteEvent | DryRunCreateEvent | DryRunUpdateEvent | DryRunRenameEvent;
36export declare class DryRunSink extends HostSink {
37 protected _subject: Subject<DryRunEvent>;
38 protected _fileDoesNotExistExceptionSet: Set<string>;
39 protected _fileAlreadyExistExceptionSet: Set<string>;
40 readonly reporter: Observable<DryRunEvent>;
41 /**
42 * @param {host} dir The host to use to output. This should be scoped.
43 * @param {boolean} force Whether to force overwriting files that already exist.
44 */
45 constructor(host: virtualFs.Host, force?: boolean);
46 protected _fileAlreadyExistException(path: string): void;
47 protected _fileDoesNotExistException(path: string): void;
48 _done(): Observable<void>;
49}