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