Skip to content

Commit 2547446

Browse files
committed
chore: release 1.4.3 -> loro-rs 1.4.6
1 parent a513a08 commit 2547446

File tree

4 files changed

+198
-11
lines changed

4 files changed

+198
-11
lines changed

Sources/Loro/LoroFFI.swift

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,11 @@ public protocol LoroDocProtocol : AnyObject {
23382338
*/
23392339
func checkoutToLatest()
23402340

2341+
/**
2342+
* Clear the options of the next commit.
2343+
*/
2344+
func clearNextCommitOptions()
2345+
23412346
/**
23422347
* Compare the frontiers with the current OpLog's version.
23432348
*
@@ -2372,6 +2377,18 @@ public protocol LoroDocProtocol : AnyObject {
23722377
*/
23732378
func config() -> Configure
23742379

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+
23752392
/**
23762393
* Set the rich text format configuration of the document.
23772394
*
@@ -2637,6 +2654,14 @@ public protocol LoroDocProtocol : AnyObject {
26372654
*/
26382655
func getValue() -> LoroValue
26392656

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+
26402665
func hasHistoryCache() -> Bool
26412666

26422667
/**
@@ -2767,6 +2792,28 @@ public protocol LoroDocProtocol : AnyObject {
27672792
*/
27682793
func setNextCommitMessage(msg: String)
27692794

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+
27702817
/**
27712818
* Change the PeerID
27722819
*
@@ -2990,6 +3037,15 @@ open func checkoutToLatest() {try! rustCall() {
29903037
uniffi_loro_fn_method_lorodoc_checkout_to_latest(self.uniffiClonePointer(),$0
29913038
)
29923039
}
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+
}
29933049
}
29943050

29953051
/**
@@ -3048,6 +3104,23 @@ open func config() -> Configure {
30483104
uniffi_loro_fn_method_lorodoc_config(self.uniffiClonePointer(),$0
30493105
)
30503106
})
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+
}
30513124
}
30523125

30533126
/**
@@ -3509,6 +3582,20 @@ open func getValue() -> LoroValue {
35093582
uniffi_loro_fn_method_lorodoc_get_value(self.uniffiClonePointer(),$0
35103583
)
35113584
})
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+
})
35123599
}
35133600

35143601
open func hasHistoryCache() -> Bool {
@@ -3735,6 +3822,43 @@ open func setNextCommitMessage(msg: String) {try! rustCall() {
37353822
FfiConverterString.lower(msg),$0
37363823
)
37373824
}
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+
}
37383862
}
37393863

37403864
/**
@@ -13818,6 +13942,12 @@ public func decodeImportBlobMeta(bytes: Data, checkChecksum: Bool)throws -> Imp
1381813942
)
1381913943
})
1382013944
}
13945+
public func getVersion() -> String {
13946+
return try! FfiConverterString.lift(try! rustCall() {
13947+
uniffi_loro_fn_func_get_version($0
13948+
)
13949+
})
13950+
}
1382113951

1382213952
private enum InitializationResult {
1382313953
case ok
@@ -13837,6 +13967,9 @@ private var initializationResult: InitializationResult = {
1383713967
if (uniffi_loro_checksum_func_decode_import_blob_meta() != 2769) {
1383813968
return InitializationResult.apiChecksumMismatch
1383913969
}
13970+
if (uniffi_loro_checksum_func_get_version() != 3250) {
13971+
return InitializationResult.apiChecksumMismatch
13972+
}
1384013973
if (uniffi_loro_checksum_method_awareness_apply() != 41900) {
1384113974
return InitializationResult.apiChecksumMismatch
1384213975
}
@@ -13942,6 +14075,9 @@ private var initializationResult: InitializationResult = {
1394214075
if (uniffi_loro_checksum_method_lorodoc_checkout_to_latest() != 2349) {
1394314076
return InitializationResult.apiChecksumMismatch
1394414077
}
14078+
if (uniffi_loro_checksum_method_lorodoc_clear_next_commit_options() != 45217) {
14079+
return InitializationResult.apiChecksumMismatch
14080+
}
1394514081
if (uniffi_loro_checksum_method_lorodoc_cmp_with_frontiers() != 31942) {
1394614082
return InitializationResult.apiChecksumMismatch
1394714083
}
@@ -13957,6 +14093,9 @@ private var initializationResult: InitializationResult = {
1395714093
if (uniffi_loro_checksum_method_lorodoc_config() != 3400) {
1395814094
return InitializationResult.apiChecksumMismatch
1395914095
}
14096+
if (uniffi_loro_checksum_method_lorodoc_config_default_text_style() != 15083) {
14097+
return InitializationResult.apiChecksumMismatch
14098+
}
1396014099
if (uniffi_loro_checksum_method_lorodoc_config_text_style() != 52393) {
1396114100
return InitializationResult.apiChecksumMismatch
1396214101
}
@@ -14059,6 +14198,9 @@ private var initializationResult: InitializationResult = {
1405914198
if (uniffi_loro_checksum_method_lorodoc_get_value() != 29857) {
1406014199
return InitializationResult.apiChecksumMismatch
1406114200
}
14201+
if (uniffi_loro_checksum_method_lorodoc_has_container() != 41856) {
14202+
return InitializationResult.apiChecksumMismatch
14203+
}
1406214204
if (uniffi_loro_checksum_method_lorodoc_has_history_cache() != 53741) {
1406314205
return InitializationResult.apiChecksumMismatch
1406414206
}
@@ -14113,6 +14255,15 @@ private var initializationResult: InitializationResult = {
1411314255
if (uniffi_loro_checksum_method_lorodoc_set_next_commit_message() != 18940) {
1411414256
return InitializationResult.apiChecksumMismatch
1411514257
}
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+
}
1411614267
if (uniffi_loro_checksum_method_lorodoc_set_peer_id() != 29379) {
1411714268
return InitializationResult.apiChecksumMismatch
1411814269
}

loro-rs/Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loro-rs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "loro-swift"
3-
version = "1.4.1"
3+
version = "1.4.6"
44
edition = "2021"
55

66
[lib]
@@ -14,7 +14,7 @@ path = "src/uniffi-bindgen.rs"
1414

1515

1616
[dependencies]
17-
loro-ffi = { git = "https://github.com/loro-dev/loro.git", tag = "loro-ffi@1.4.0" }
17+
loro-ffi = { git = "https://github.com/loro-dev/loro.git", tag = "loro-ffi@1.4.6" }
1818
# loro-ffi = { path = "../../loro/crates/loro-ffi" }
1919
uniffi = { version = "0.28.3" }
2020

0 commit comments

Comments
 (0)