@@ -18,7 +18,7 @@ export class SharedDelta extends SharedOT<Delta, Delta> {
1818 return runtime . createChannel ( id , DeltaFactory . Type ) as SharedDelta ;
1919 }
2020
21- public static getFactory ( ) {
21+ public static getFactory ( ) : DeltaFactory {
2222 return new DeltaFactory ( ) ;
2323 }
2424
@@ -30,14 +30,14 @@ export class SharedDelta extends SharedOT<Delta, Delta> {
3030 return this . state ;
3131 }
3232
33- public get text ( ) {
33+ public get text ( ) : string {
3434 return this . state . reduce ( ( s , delta ) => {
3535 // eslint-disable-next-line @typescript-eslint/no-base-to-string
3636 return `${ s } ${ delta . insert ?. toString ( ) } ` ;
3737 } , "" ) ;
3838 }
3939
40- public get length ( ) {
40+ public get length ( ) : number {
4141 return this . text . length ;
4242 }
4343
@@ -49,11 +49,11 @@ export class SharedDelta extends SharedOT<Delta, Delta> {
4949 return state . compose ( op ) ;
5050 }
5151
52- public insert ( position : number , text : string ) {
52+ public insert ( position : number , text : string ) : void {
5353 this . apply ( new Delta ( ) . retain ( position ) . insert ( text ) ) ;
5454 }
5555
56- public delete ( start : number , end : number ) {
56+ public delete ( start : number , end : number ) : void {
5757 this . apply ( new Delta ( ) . retain ( start ) . delete ( end - start ) ) ;
5858 }
5959}
@@ -67,10 +67,10 @@ export class DeltaFactory implements IChannelFactory {
6767 packageVersion : "test" ,
6868 } ;
6969
70- public get type ( ) {
70+ public get type ( ) : string {
7171 return DeltaFactory . Type ;
7272 }
73- public get attributes ( ) {
73+ public get attributes ( ) : IChannelAttributes {
7474 return DeltaFactory . Attributes ;
7575 }
7676
@@ -82,13 +82,13 @@ export class DeltaFactory implements IChannelFactory {
8282 id : string ,
8383 services : IChannelServices ,
8484 attributes : IChannelAttributes ,
85- ) {
85+ ) : Promise < SharedDelta > {
8686 const instance = new SharedDelta ( id , runtime , attributes ) ;
8787 await instance . load ( services ) ;
8888 return instance ;
8989 }
9090
91- public create ( runtime : IFluidDataStoreRuntime , id : string ) {
91+ public create ( runtime : IFluidDataStoreRuntime , id : string ) : SharedDelta {
9292 const instance = new SharedDelta ( id , runtime , this . attributes ) ;
9393 instance . initializeLocal ( ) ;
9494 return instance ;
0 commit comments