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 { Observable } from 'rxjs';
|
---|
10 | import { Action, CreateFileAction, DeleteFileAction, OverwriteFileAction, RenameFileAction } from '../tree/action';
|
---|
11 | import { Tree } from '../tree/interface';
|
---|
12 | export interface Sink {
|
---|
13 | commit(tree: Tree): Observable<void>;
|
---|
14 | }
|
---|
15 | export declare abstract class SimpleSinkBase implements Sink {
|
---|
16 | preCommitAction: (action: Action) => void | Action | PromiseLike<Action> | Observable<Action>;
|
---|
17 | postCommitAction: (action: Action) => void | Observable<void>;
|
---|
18 | preCommit: () => void | Observable<void>;
|
---|
19 | postCommit: () => void | Observable<void>;
|
---|
20 | protected abstract _validateFileExists(p: string): Observable<boolean>;
|
---|
21 | protected abstract _overwriteFile(path: string, content: Buffer): Observable<void>;
|
---|
22 | protected abstract _createFile(path: string, content: Buffer): Observable<void>;
|
---|
23 | protected abstract _renameFile(path: string, to: string): Observable<void>;
|
---|
24 | protected abstract _deleteFile(path: string): Observable<void>;
|
---|
25 | protected abstract _done(): Observable<void>;
|
---|
26 | protected _fileAlreadyExistException(path: string): void;
|
---|
27 | protected _fileDoesNotExistException(path: string): void;
|
---|
28 | protected _validateOverwriteAction(action: OverwriteFileAction): Observable<void>;
|
---|
29 | protected _validateCreateAction(action: CreateFileAction): Observable<void>;
|
---|
30 | protected _validateRenameAction(action: RenameFileAction): Observable<void>;
|
---|
31 | protected _validateDeleteAction(action: DeleteFileAction): Observable<void>;
|
---|
32 | validateSingleAction(action: Action): Observable<void>;
|
---|
33 | commitSingleAction(action: Action): Observable<void>;
|
---|
34 | commit(tree: Tree): Observable<void>;
|
---|
35 | }
|
---|