@@ -27,28 +27,28 @@ let _id = 1;
2727export class ActionList implements Iterable < Action > {
2828 private _actions : Action [ ] = [ ] ;
2929
30- protected _action ( action : Partial < Action > ) {
30+ protected _action ( action : Partial < Action > ) : void {
3131 this . _actions . push ( {
3232 ...( action as Action ) ,
3333 id : _id ++ ,
3434 parent : this . _actions [ this . _actions . length - 1 ] ?. id ?? 0 ,
3535 } ) ;
3636 }
3737
38- create ( path : Path , content : Buffer ) {
38+ create ( path : Path , content : Buffer ) : void {
3939 this . _action ( { kind : 'c' , path, content } ) ;
4040 }
41- overwrite ( path : Path , content : Buffer ) {
41+ overwrite ( path : Path , content : Buffer ) : void {
4242 this . _action ( { kind : 'o' , path, content } ) ;
4343 }
44- rename ( path : Path , to : Path ) {
44+ rename ( path : Path , to : Path ) : void {
4545 this . _action ( { kind : 'r' , path, to } ) ;
4646 }
47- delete ( path : Path ) {
47+ delete ( path : Path ) : void {
4848 this . _action ( { kind : 'd' , path } ) ;
4949 }
5050
51- optimize ( ) {
51+ optimize ( ) : void {
5252 const toCreate = new Map < Path , Buffer > ( ) ;
5353 const toRename = new Map < Path , Path > ( ) ;
5454 const toOverwrite = new Map < Path , Buffer > ( ) ;
@@ -122,13 +122,13 @@ export class ActionList implements Iterable<Action> {
122122 } ) ;
123123 }
124124
125- push ( action : Action ) {
125+ push ( action : Action ) : void {
126126 this . _actions . push ( action ) ;
127127 }
128- get ( i : number ) {
128+ get ( i : number ) : Action {
129129 return this . _actions [ i ] ;
130130 }
131- has ( action : Action ) {
131+ has ( action : Action ) : boolean {
132132 for ( let i = 0 ; i < this . _actions . length ; i ++ ) {
133133 const a = this . _actions [ i ] ;
134134 if ( a . id == action . id ) {
@@ -144,10 +144,10 @@ export class ActionList implements Iterable<Action> {
144144 find ( predicate : ( value : Action ) => boolean ) : Action | null {
145145 return this . _actions . find ( predicate ) || null ;
146146 }
147- forEach ( fn : ( value : Action , index : number , array : Action [ ] ) => void , thisArg ?: { } ) {
147+ forEach ( fn : ( value : Action , index : number , array : Action [ ] ) => void , thisArg ?: { } ) : void {
148148 this . _actions . forEach ( fn , thisArg ) ;
149149 }
150- get length ( ) {
150+ get length ( ) : number {
151151 return this . _actions . length ;
152152 }
153153 [ Symbol . iterator ] ( ) : IterableIterator < Action > {
0 commit comments