UNPKG

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