@@ -2344,7 +2344,7 @@ public protocol LoroDocProtocol : AnyObject {
2344
2344
*
2345
2345
* The data can be in arbitrary order. The import result will be the same.
2346
2346
*/
2347
- func importBatch( bytes: [ Data ] ) throws
2347
+ func importBatch( bytes: [ Data ] ) throws -> ImportStatus
2348
2348
2349
2349
func importJsonUpdates( json: String ) throws -> ImportStatus
2350
2350
@@ -3092,11 +3092,12 @@ open func `import`(bytes: Data)throws -> ImportStatus {
3092
3092
*
3093
3093
* The data can be in arbitrary order. The import result will be the same.
3094
3094
*/
3095
- open func importBatch( bytes: [ Data ] ) throws { try rustCallWithError ( FfiConverterTypeLoroError . lift) {
3095
+ open func importBatch( bytes: [ Data ] ) throws -> ImportStatus {
3096
+ return try FfiConverterTypeImportStatus . lift ( try rustCallWithError ( FfiConverterTypeLoroError . lift) {
3096
3097
uniffi_loro_fn_method_lorodoc_import_batch ( self . uniffiClonePointer ( ) ,
3097
3098
FfiConverterSequenceData . lower ( bytes) , $0
3098
3099
)
3099
- }
3100
+ } )
3100
3101
}
3101
3102
3102
3103
open func importJsonUpdates( json: String ) throws -> ImportStatus {
@@ -6520,7 +6521,7 @@ public func FfiConverterTypeOnPop_lower(_ value: OnPop) -> UnsafeMutableRawPoint
6520
6521
6521
6522
public protocol OnPush : AnyObject {
6522
6523
6523
- func onPush( undoOrRedo: UndoOrRedo , span: CounterSpan ) -> UndoItemMeta
6524
+ func onPush( undoOrRedo: UndoOrRedo , span: CounterSpan , diffEvent : DiffEvent ? ) -> UndoItemMeta
6524
6525
6525
6526
}
6526
6527
@@ -6574,11 +6575,12 @@ open class OnPushImpl:
6574
6575
6575
6576
6576
6577
6577
- open func onPush( undoOrRedo: UndoOrRedo , span: CounterSpan ) -> UndoItemMeta {
6578
+ open func onPush( undoOrRedo: UndoOrRedo , span: CounterSpan , diffEvent : DiffEvent ? ) -> UndoItemMeta {
6578
6579
return try ! FfiConverterTypeUndoItemMeta . lift ( try ! rustCall ( ) {
6579
6580
uniffi_loro_fn_method_onpush_on_push ( self . uniffiClonePointer ( ) ,
6580
6581
FfiConverterTypeUndoOrRedo . lower ( undoOrRedo) ,
6581
- FfiConverterTypeCounterSpan . lower ( span) , $0
6582
+ FfiConverterTypeCounterSpan . lower ( span) ,
6583
+ FfiConverterOptionTypeDiffEvent . lower ( diffEvent) , $0
6582
6584
)
6583
6585
} )
6584
6586
}
@@ -6597,6 +6599,7 @@ fileprivate struct UniffiCallbackInterfaceOnPush {
6597
6599
uniffiHandle: UInt64 ,
6598
6600
undoOrRedo: RustBuffer ,
6599
6601
span: RustBuffer ,
6602
+ diffEvent: RustBuffer ,
6600
6603
uniffiOutReturn: UnsafeMutablePointer < RustBuffer > ,
6601
6604
uniffiCallStatus: UnsafeMutablePointer < RustCallStatus >
6602
6605
) in
@@ -6607,7 +6610,8 @@ fileprivate struct UniffiCallbackInterfaceOnPush {
6607
6610
}
6608
6611
return uniffiObj. onPush (
6609
6612
undoOrRedo: try FfiConverterTypeUndoOrRedo . lift ( undoOrRedo) ,
6610
- span: try FfiConverterTypeCounterSpan . lift ( span)
6613
+ span: try FfiConverterTypeCounterSpan . lift ( span) ,
6614
+ diffEvent: try FfiConverterOptionTypeDiffEvent . lift ( diffEvent)
6611
6615
)
6612
6616
}
6613
6617
@@ -12113,6 +12117,30 @@ fileprivate struct FfiConverterOptionTypeCounterSpan: FfiConverterRustBuffer {
12113
12117
}
12114
12118
}
12115
12119
12120
+ #if swift(>=5.8)
12121
+ @_documentation ( visibility: private)
12122
+ #endif
12123
+ fileprivate struct FfiConverterOptionTypeDiffEvent : FfiConverterRustBuffer {
12124
+ typealias SwiftType = DiffEvent ?
12125
+
12126
+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
12127
+ guard let value = value else {
12128
+ writeInt ( & buf, Int8 ( 0 ) )
12129
+ return
12130
+ }
12131
+ writeInt ( & buf, Int8 ( 1 ) )
12132
+ FfiConverterTypeDiffEvent . write ( value, into: & buf)
12133
+ }
12134
+
12135
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
12136
+ switch try readInt ( & buf) as Int8 {
12137
+ case 0 : return nil
12138
+ case 1 : return try FfiConverterTypeDiffEvent . read ( from: & buf)
12139
+ default : throw UniffiInternalError . unexpectedOptionalTag
12140
+ }
12141
+ }
12142
+ }
12143
+
12116
12144
#if swift(>=5.8)
12117
12145
@_documentation ( visibility: private)
12118
12146
#endif
@@ -13085,7 +13113,7 @@ private var initializationResult: InitializationResult = {
13085
13113
if ( uniffi_loro_checksum_method_lorodoc_import ( ) != 11528 ) {
13086
13114
return InitializationResult . apiChecksumMismatch
13087
13115
}
13088
- if ( uniffi_loro_checksum_method_lorodoc_import_batch ( ) != 60062 ) {
13116
+ if ( uniffi_loro_checksum_method_lorodoc_import_batch ( ) != 34010 ) {
13089
13117
return InitializationResult . apiChecksumMismatch
13090
13118
}
13091
13119
if ( uniffi_loro_checksum_method_lorodoc_import_json_updates ( ) != 57379 ) {
@@ -13532,7 +13560,7 @@ private var initializationResult: InitializationResult = {
13532
13560
if ( uniffi_loro_checksum_method_onpop_on_pop ( ) != 39438 ) {
13533
13561
return InitializationResult . apiChecksumMismatch
13534
13562
}
13535
- if ( uniffi_loro_checksum_method_onpush_on_push ( ) != 4043 ) {
13563
+ if ( uniffi_loro_checksum_method_onpush_on_push ( ) != 46111 ) {
13536
13564
return InitializationResult . apiChecksumMismatch
13537
13565
}
13538
13566
if ( uniffi_loro_checksum_method_styleconfigmap_get ( ) != 25442 ) {
0 commit comments