@@ -44,26 +44,25 @@ export const BlockPatchRef = t.Ref<typeof BlockPatch>('BlockPatch');
4444
4545// ------------------------------------------------------------------- Snapshot
4646
47- export const BlockSnapshot = t . Object (
48- t . prop ( 'blob' , t . bin )
49- . options ( {
47+ export const BlockSnapshot = t
48+ . Object (
49+ t . prop ( 'blob' , t . bin ) . options ( {
5050 title : 'Snapshot Blob' ,
5151 description : 'A serialized JSON CRDT model.' ,
5252 } ) ,
53- t . prop ( 'cur' , BlockCurRef )
54- . options ( {
53+ t . prop ( 'cur' , BlockCurRef ) . options ( {
5554 title : 'Snapshot Cursor' ,
5655 description : 'The cursor of the snapshot, representing the position in the history.' ,
5756 } ) ,
58- t . prop ( 'ts' , t . num . options ( { format : 'u' } ) )
59- . options ( {
57+ t . prop ( 'ts' , t . num . options ( { format : 'u' } ) ) . options ( {
6058 title : 'Snapshot Creation Time' ,
6159 description : 'The time when the snapshot was created, in milliseconds since the Unix epoch.' ,
6260 } ) ,
63- ) . options ( {
64- title : 'Block Snapshot' ,
65- description : 'A snapshot of the block\'s state at a certain point in time.' ,
66- } ) ;
61+ )
62+ . options ( {
63+ title : 'Block Snapshot' ,
64+ description : "A snapshot of the block's state at a certain point in time." ,
65+ } ) ;
6766export const BlockSnapshotRef = t . Ref < typeof BlockSnapshot > ( 'BlockSnapshot' ) ;
6867
6968export const NewBlockSnapshotResponse = BlockSnapshot . omit ( 'blob' ) ;
@@ -78,32 +77,32 @@ export const BlockNew = t.Object(
7877) ;
7978export const BlockNewRef = t . Ref < typeof BlockNew > ( 'BlockNew' ) ;
8079
81- export const Block = BlockNew . extend ( t . Object (
82- t . prop ( 'snapshot' , BlockSnapshotRef ) ,
83- t . prop ( 'tip' , t . Array ( BlockPatchRef ) ) ,
84- ) ) ;
80+ export const Block = BlockNew . extend (
81+ t . Object ( t . prop ( 'snapshot' , BlockSnapshotRef ) , t . prop ( 'tip' , t . Array ( BlockPatchRef ) ) ) ,
82+ ) ;
8583export const BlockRef = t . Ref < typeof Block > ( 'Block' ) ;
8684
8785// --------------------------------------------------------------------- Events
8886
89- export const BlockDeleteEvent = t . Tuple (
90- t . Const ( < const > 'del' ) . options ( { title : 'Event Type' } ) ,
91- ) . options ( { title : 'Delete Event' } ) ;
92-
93- export const BlockUpdateEvent = t . Tuple (
94- t . Const ( < const > 'upd' ) . options ( { title : 'Event Type' } ) ,
95- t . Object (
96- t . prop ( 'patches' , t . Array ( BlockPatchRef ) ) . options ( {
97- title : 'Latest Patches' ,
98- description : 'Patches that have been applied to the block.' ,
99- } ) ,
100- ) . options ( { title : 'Event Data' } ) ,
101- ) . options ( { title : 'Update Event' } ) ;
102-
103- export const BlockEvent = t . Or (
104- BlockUpdateEvent ,
105- BlockDeleteEvent ,
106- ) . options ( {
87+ export const BlockDeleteEvent = t
88+ . Tuple ( t . Const ( < const > 'del' ) . options ( { title : 'Event Type' } ) )
89+ . options ( { title : 'Delete Event' } ) ;
90+
91+ export const BlockUpdateEvent = t
92+ . Tuple (
93+ t . Const ( < const > 'upd' ) . options ( { title : 'Event Type' } ) ,
94+ t
95+ . Object (
96+ t . prop ( 'patches' , t . Array ( BlockPatchRef ) ) . options ( {
97+ title : 'Latest Patches' ,
98+ description : 'Patches that have been applied to the block.' ,
99+ } ) ,
100+ )
101+ . options ( { title : 'Event Data' } ) ,
102+ )
103+ . options ( { title : 'Update Event' } ) ;
104+
105+ export const BlockEvent = t . Or ( BlockUpdateEvent , BlockDeleteEvent ) . options ( {
107106 title : 'Block Event' ,
108107 description : 'A collection of possible events that can happen to a block.' ,
109108} ) ;
0 commit comments