@@ -743,7 +743,7 @@ export class CollectionImpl<
743743 }
744744
745745 const items = Array . isArray ( data ) ? data : [ data ]
746- const mutations : Array < PendingMutation < T > > = [ ]
746+ const mutations : Array < PendingMutation < T , `insert` > > = [ ]
747747
748748 // Create mutations for each item
749749 items . forEach ( ( item ) => {
@@ -757,7 +757,7 @@ export class CollectionImpl<
757757 }
758758 const globalKey = this . generateGlobalKey ( key , item )
759759
760- const mutation : PendingMutation < T > = {
760+ const mutation : PendingMutation < T , `insert` > = {
761761 mutationId : crypto . randomUUID ( ) ,
762762 original : { } ,
763763 modified : validatedData ,
@@ -927,7 +927,7 @@ export class CollectionImpl<
927927 }
928928
929929 // Create mutations for each object that has changes
930- const mutations : Array < PendingMutation < T > > = keysArray
930+ const mutations : Array < PendingMutation < T , `update` > > = keysArray
931931 . map ( ( key , index ) => {
932932 const itemChanges = changesArray [ index ] // User-provided changes for this specific item
933933
@@ -981,7 +981,7 @@ export class CollectionImpl<
981981 collection : this ,
982982 }
983983 } )
984- . filter ( Boolean ) as Array < PendingMutation < T > >
984+ . filter ( Boolean ) as Array < PendingMutation < T , `update` > >
985985
986986 // If no changes were made, return an empty transaction early
987987 if ( mutations . length === 0 ) {
@@ -1057,7 +1057,7 @@ export class CollectionImpl<
10571057 }
10581058
10591059 const keysArray = Array . isArray ( keys ) ? keys : [ keys ]
1060- const mutations : Array < PendingMutation < T > > = [ ]
1060+ const mutations : Array < PendingMutation < T , `delete` > > = [ ]
10611061
10621062 for ( const key of keysArray ) {
10631063 if ( ! this . has ( key ) ) {
@@ -1066,7 +1066,7 @@ export class CollectionImpl<
10661066 )
10671067 }
10681068 const globalKey = this . generateGlobalKey ( key , this . get ( key ) ! )
1069- const mutation : PendingMutation < T > = {
1069+ const mutation : PendingMutation < T , `delete` > = {
10701070 mutationId : crypto . randomUUID ( ) ,
10711071 original : this . get ( key ) ! ,
10721072 modified : this . get ( key ) ! ,
0 commit comments