11import type { CallerToMethods , TypedRpcClient } from '../../reactive-rpc/common' ;
22import type { JsonJoyDemoRpcCaller } from '../../server' ;
3- import type { RemoteHistory , RemoteModel , RemotePatch } from " ./types" ;
3+ import type { RemoteHistory , RemoteModel , RemotePatch } from ' ./types' ;
44
55type Methods = CallerToMethods < JsonJoyDemoRpcCaller > ;
66
@@ -17,7 +17,7 @@ export interface RemoteServerPatch extends RemotePatch {
1717}
1818
1919export class RemoteHistoryDemoServer implements RemoteHistory < Cursor , RemoteServerModel , RemoteServerPatch > {
20- constructor ( protected readonly client : TypedRpcClient < Methods > ) { }
20+ constructor ( protected readonly client : TypedRpcClient < Methods > ) { }
2121
2222 public async create ( id : string , patches : RemotePatch [ ] ) : Promise < void > {
2323 await this . client . call ( 'block.new' , {
@@ -35,7 +35,7 @@ export class RemoteHistoryDemoServer implements RemoteHistory<Cursor, RemoteServ
3535 * Load latest state of the model, and any unmerged "tip" of patches
3636 * it might have.
3737 */
38- public async read ( id : string ) : Promise < { cursor : Cursor , model : RemoteServerModel , patches : RemoteServerPatch [ ] } > {
38+ public async read ( id : string ) : Promise < { cursor : Cursor ; model : RemoteServerModel ; patches : RemoteServerPatch [ ] } > {
3939 const { block, patches} = await this . client . call ( 'block.get' , { id} ) ;
4040 return {
4141 cursor : block . seq ,
@@ -44,7 +44,7 @@ export class RemoteHistoryDemoServer implements RemoteHistory<Cursor, RemoteServ
4444 } ;
4545 }
4646
47- public async scanFwd ( id : string , cursor : Cursor ) : Promise < { cursor : Cursor , patches : RemoteServerPatch [ ] } > {
47+ public async scanFwd ( id : string , cursor : Cursor ) : Promise < { cursor : Cursor ; patches : RemoteServerPatch [ ] } > {
4848 const limit = 100 ;
4949 const res = await this . client . call ( 'block.scan' , {
5050 id,
@@ -63,12 +63,18 @@ export class RemoteHistoryDemoServer implements RemoteHistory<Cursor, RemoteServ
6363 } ;
6464 }
6565
66- public async scanBwd ( id : string , cursor : Cursor ) : Promise < { cursor : Cursor , model : RemoteServerModel , patches : RemoteServerPatch [ ] } > {
66+ public async scanBwd (
67+ id : string ,
68+ cursor : Cursor ,
69+ ) : Promise < { cursor : Cursor ; model : RemoteServerModel ; patches : RemoteServerPatch [ ] } > {
6770 throw new Error ( 'The "blocks.history" should be able to return starting model.' ) ;
6871 }
6972
70- public async update ( id : string , cursor : Cursor , patches : RemotePatch [ ] ) : Promise < { cursor : Cursor , patches : RemoteServerPatch [ ] } > {
71-
73+ public async update (
74+ id : string ,
75+ cursor : Cursor ,
76+ patches : RemotePatch [ ] ,
77+ ) : Promise < { cursor : Cursor ; patches : RemoteServerPatch [ ] } > {
7278 const res = await this . client . call ( 'block.upd' , {
7379 id,
7480 patches : patches . map ( ( patch , seq ) => ( {
0 commit comments