@@ -2338,6 +2338,11 @@ public protocol LoroDocProtocol : AnyObject {
2338
2338
*/
2339
2339
func checkoutToLatest( )
2340
2340
2341
+ /**
2342
+ * Clear the options of the next commit.
2343
+ */
2344
+ func clearNextCommitOptions( )
2345
+
2341
2346
/**
2342
2347
* Compare the frontiers with the current OpLog's version.
2343
2348
*
@@ -2372,6 +2377,18 @@ public protocol LoroDocProtocol : AnyObject {
2372
2377
*/
2373
2378
func config( ) -> Configure
2374
2379
2380
+ /**
2381
+ * Configures the default text style for the document.
2382
+ *
2383
+ * This method sets the default text style configuration for the document when using LoroText.
2384
+ * If `None` is provided, the default style is reset.
2385
+ *
2386
+ * # Parameters
2387
+ *
2388
+ * - `text_style`: The style configuration to set as the default. `None` to reset.
2389
+ */
2390
+ func configDefaultTextStyle( textStyle: StyleConfig ? )
2391
+
2375
2392
/**
2376
2393
* Set the rich text format configuration of the document.
2377
2394
*
@@ -2637,6 +2654,14 @@ public protocol LoroDocProtocol : AnyObject {
2637
2654
*/
2638
2655
func getValue( ) -> LoroValue
2639
2656
2657
+ /**
2658
+ * Check if the doc contains the target container.
2659
+ *
2660
+ * A root container always exists, while a normal container exists
2661
+ * if it has ever been created on the doc.
2662
+ */
2663
+ func hasContainer( id: ContainerId ) -> Bool
2664
+
2640
2665
func hasHistoryCache( ) -> Bool
2641
2666
2642
2667
/**
@@ -2767,6 +2792,28 @@ public protocol LoroDocProtocol : AnyObject {
2767
2792
*/
2768
2793
func setNextCommitMessage( msg: String )
2769
2794
2795
+ /**
2796
+ * Set the options of the next commit.
2797
+ *
2798
+ * It will be used when the next commit is performed.
2799
+ */
2800
+ func setNextCommitOptions( options: CommitOptions )
2801
+
2802
+ /**
2803
+ * Set `origin` for the current uncommitted changes, it can be used to track the source of changes in an event.
2804
+ *
2805
+ * It will NOT be persisted.
2806
+ */
2807
+ func setNextCommitOrigin( origin: String )
2808
+
2809
+ /**
2810
+ * Set the timestamp of the next commit.
2811
+ *
2812
+ * It will be persisted and stored in the `OpLog`.
2813
+ * You can get the timestamp from the [`Change`] type.
2814
+ */
2815
+ func setNextCommitTimestamp( timestamp: Int64 )
2816
+
2770
2817
/**
2771
2818
* Change the PeerID
2772
2819
*
@@ -2990,6 +3037,15 @@ open func checkoutToLatest() {try! rustCall() {
2990
3037
uniffi_loro_fn_method_lorodoc_checkout_to_latest ( self . uniffiClonePointer ( ) , $0
2991
3038
)
2992
3039
}
3040
+ }
3041
+
3042
+ /**
3043
+ * Clear the options of the next commit.
3044
+ */
3045
+ open func clearNextCommitOptions( ) { try ! rustCall ( ) {
3046
+ uniffi_loro_fn_method_lorodoc_clear_next_commit_options ( self . uniffiClonePointer ( ) , $0
3047
+ )
3048
+ }
2993
3049
}
2994
3050
2995
3051
/**
@@ -3048,6 +3104,23 @@ open func config() -> Configure {
3048
3104
uniffi_loro_fn_method_lorodoc_config ( self . uniffiClonePointer ( ) , $0
3049
3105
)
3050
3106
} )
3107
+ }
3108
+
3109
+ /**
3110
+ * Configures the default text style for the document.
3111
+ *
3112
+ * This method sets the default text style configuration for the document when using LoroText.
3113
+ * If `None` is provided, the default style is reset.
3114
+ *
3115
+ * # Parameters
3116
+ *
3117
+ * - `text_style`: The style configuration to set as the default. `None` to reset.
3118
+ */
3119
+ open func configDefaultTextStyle( textStyle: StyleConfig ? ) { try ! rustCall ( ) {
3120
+ uniffi_loro_fn_method_lorodoc_config_default_text_style ( self . uniffiClonePointer ( ) ,
3121
+ FfiConverterOptionTypeStyleConfig . lower ( textStyle) , $0
3122
+ )
3123
+ }
3051
3124
}
3052
3125
3053
3126
/**
@@ -3509,6 +3582,20 @@ open func getValue() -> LoroValue {
3509
3582
uniffi_loro_fn_method_lorodoc_get_value ( self . uniffiClonePointer ( ) , $0
3510
3583
)
3511
3584
} )
3585
+ }
3586
+
3587
+ /**
3588
+ * Check if the doc contains the target container.
3589
+ *
3590
+ * A root container always exists, while a normal container exists
3591
+ * if it has ever been created on the doc.
3592
+ */
3593
+ open func hasContainer( id: ContainerId ) -> Bool {
3594
+ return try ! FfiConverterBool . lift ( try ! rustCall ( ) {
3595
+ uniffi_loro_fn_method_lorodoc_has_container ( self . uniffiClonePointer ( ) ,
3596
+ FfiConverterTypeContainerID . lower ( id) , $0
3597
+ )
3598
+ } )
3512
3599
}
3513
3600
3514
3601
open func hasHistoryCache( ) -> Bool {
@@ -3735,6 +3822,43 @@ open func setNextCommitMessage(msg: String) {try! rustCall() {
3735
3822
FfiConverterString . lower ( msg) , $0
3736
3823
)
3737
3824
}
3825
+ }
3826
+
3827
+ /**
3828
+ * Set the options of the next commit.
3829
+ *
3830
+ * It will be used when the next commit is performed.
3831
+ */
3832
+ open func setNextCommitOptions( options: CommitOptions ) { try ! rustCall ( ) {
3833
+ uniffi_loro_fn_method_lorodoc_set_next_commit_options ( self . uniffiClonePointer ( ) ,
3834
+ FfiConverterTypeCommitOptions . lower ( options) , $0
3835
+ )
3836
+ }
3837
+ }
3838
+
3839
+ /**
3840
+ * Set `origin` for the current uncommitted changes, it can be used to track the source of changes in an event.
3841
+ *
3842
+ * It will NOT be persisted.
3843
+ */
3844
+ open func setNextCommitOrigin( origin: String ) { try ! rustCall ( ) {
3845
+ uniffi_loro_fn_method_lorodoc_set_next_commit_origin ( self . uniffiClonePointer ( ) ,
3846
+ FfiConverterString . lower ( origin) , $0
3847
+ )
3848
+ }
3849
+ }
3850
+
3851
+ /**
3852
+ * Set the timestamp of the next commit.
3853
+ *
3854
+ * It will be persisted and stored in the `OpLog`.
3855
+ * You can get the timestamp from the [`Change`] type.
3856
+ */
3857
+ open func setNextCommitTimestamp( timestamp: Int64 ) { try ! rustCall ( ) {
3858
+ uniffi_loro_fn_method_lorodoc_set_next_commit_timestamp ( self . uniffiClonePointer ( ) ,
3859
+ FfiConverterInt64 . lower ( timestamp) , $0
3860
+ )
3861
+ }
3738
3862
}
3739
3863
3740
3864
/**
@@ -13818,6 +13942,12 @@ public func decodeImportBlobMeta(bytes: Data, checkChecksum: Bool)throws -> Imp
13818
13942
)
13819
13943
} )
13820
13944
}
13945
+ public func getVersion( ) -> String {
13946
+ return try ! FfiConverterString . lift ( try ! rustCall ( ) {
13947
+ uniffi_loro_fn_func_get_version ( $0
13948
+ )
13949
+ } )
13950
+ }
13821
13951
13822
13952
private enum InitializationResult {
13823
13953
case ok
@@ -13837,6 +13967,9 @@ private var initializationResult: InitializationResult = {
13837
13967
if ( uniffi_loro_checksum_func_decode_import_blob_meta ( ) != 2769 ) {
13838
13968
return InitializationResult . apiChecksumMismatch
13839
13969
}
13970
+ if ( uniffi_loro_checksum_func_get_version ( ) != 3250 ) {
13971
+ return InitializationResult . apiChecksumMismatch
13972
+ }
13840
13973
if ( uniffi_loro_checksum_method_awareness_apply ( ) != 41900 ) {
13841
13974
return InitializationResult . apiChecksumMismatch
13842
13975
}
@@ -13942,6 +14075,9 @@ private var initializationResult: InitializationResult = {
13942
14075
if ( uniffi_loro_checksum_method_lorodoc_checkout_to_latest ( ) != 2349 ) {
13943
14076
return InitializationResult . apiChecksumMismatch
13944
14077
}
14078
+ if ( uniffi_loro_checksum_method_lorodoc_clear_next_commit_options ( ) != 45217 ) {
14079
+ return InitializationResult . apiChecksumMismatch
14080
+ }
13945
14081
if ( uniffi_loro_checksum_method_lorodoc_cmp_with_frontiers ( ) != 31942 ) {
13946
14082
return InitializationResult . apiChecksumMismatch
13947
14083
}
@@ -13957,6 +14093,9 @@ private var initializationResult: InitializationResult = {
13957
14093
if ( uniffi_loro_checksum_method_lorodoc_config ( ) != 3400 ) {
13958
14094
return InitializationResult . apiChecksumMismatch
13959
14095
}
14096
+ if ( uniffi_loro_checksum_method_lorodoc_config_default_text_style ( ) != 15083 ) {
14097
+ return InitializationResult . apiChecksumMismatch
14098
+ }
13960
14099
if ( uniffi_loro_checksum_method_lorodoc_config_text_style ( ) != 52393 ) {
13961
14100
return InitializationResult . apiChecksumMismatch
13962
14101
}
@@ -14059,6 +14198,9 @@ private var initializationResult: InitializationResult = {
14059
14198
if ( uniffi_loro_checksum_method_lorodoc_get_value ( ) != 29857 ) {
14060
14199
return InitializationResult . apiChecksumMismatch
14061
14200
}
14201
+ if ( uniffi_loro_checksum_method_lorodoc_has_container ( ) != 41856 ) {
14202
+ return InitializationResult . apiChecksumMismatch
14203
+ }
14062
14204
if ( uniffi_loro_checksum_method_lorodoc_has_history_cache ( ) != 53741 ) {
14063
14205
return InitializationResult . apiChecksumMismatch
14064
14206
}
@@ -14113,6 +14255,15 @@ private var initializationResult: InitializationResult = {
14113
14255
if ( uniffi_loro_checksum_method_lorodoc_set_next_commit_message ( ) != 18940 ) {
14114
14256
return InitializationResult . apiChecksumMismatch
14115
14257
}
14258
+ if ( uniffi_loro_checksum_method_lorodoc_set_next_commit_options ( ) != 13250 ) {
14259
+ return InitializationResult . apiChecksumMismatch
14260
+ }
14261
+ if ( uniffi_loro_checksum_method_lorodoc_set_next_commit_origin ( ) != 27549 ) {
14262
+ return InitializationResult . apiChecksumMismatch
14263
+ }
14264
+ if ( uniffi_loro_checksum_method_lorodoc_set_next_commit_timestamp ( ) != 30492 ) {
14265
+ return InitializationResult . apiChecksumMismatch
14266
+ }
14116
14267
if ( uniffi_loro_checksum_method_lorodoc_set_peer_id ( ) != 29379 ) {
14117
14268
return InitializationResult . apiChecksumMismatch
14118
14269
}
0 commit comments