Skip to content

Commit 224607e

Browse files
committed
fix: movable list get value
1 parent 641d392 commit 224607e

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ let FFIbinaryTarget: PackageDescription.Target
99
if ProcessInfo.processInfo.environment["LOCAL_BUILD"] != nil {
1010
FFIbinaryTarget = .binaryTarget(name: "LoroFFI", path: "./loroFFI.xcframework.zip")
1111
}else {
12-
FFIbinaryTarget = .binaryTarget(
13-
name: "LoroFFI",
14-
url: "https://github.com/loro-dev/loro-swift/releases/download/0.16.2-alpha.0/loroFFI.xcframework.zip",
15-
checksum: "a98119540ba962f1896243b27cc1e9f94629db831c9477a7fec388359d438c0c"
16-
)
12+
FFIbinaryTarget = .binaryTarget(
13+
name: "LoroFFI",
14+
url: "https://github.com/loro-dev/loro-swift/releases/download/0.16.2-alpha.0/loroFFI.xcframework.zip",
15+
checksum: "a98119540ba962f1896243b27cc1e9f94629db831c9477a7fec388359d438c0c"
16+
)
1717
}
1818

1919
let package = Package(

Sources/Loro/LoroFFI.swift

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,6 +2651,18 @@ public protocol LoroMovableListProtocol : AnyObject {
26512651
*/
26522652
func getCursor(pos: UInt32, side: Side) -> Cursor?
26532653

2654+
/**
2655+
* Get the deep value of the container.
2656+
*/
2657+
func getDeepValue() -> LoroValue
2658+
2659+
/**
2660+
* Get the shallow value of the container.
2661+
*
2662+
* This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].
2663+
*/
2664+
func getValue() -> LoroValue
2665+
26542666
/**
26552667
* Get the container id.
26562668
*/
@@ -2806,6 +2818,28 @@ open func getCursor(pos: UInt32, side: Side) -> Cursor? {
28062818
FfiConverterTypeSide.lower(side),$0
28072819
)
28082820
})
2821+
}
2822+
2823+
/**
2824+
* Get the deep value of the container.
2825+
*/
2826+
open func getDeepValue() -> LoroValue {
2827+
return try! FfiConverterTypeLoroValue.lift(try! rustCall() {
2828+
uniffi_loro_fn_method_loromovablelist_get_deep_value(self.uniffiClonePointer(),$0
2829+
)
2830+
})
2831+
}
2832+
2833+
/**
2834+
* Get the shallow value of the container.
2835+
*
2836+
* This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].
2837+
*/
2838+
open func getValue() -> LoroValue {
2839+
return try! FfiConverterTypeLoroValue.lift(try! rustCall() {
2840+
uniffi_loro_fn_method_loromovablelist_get_value(self.uniffiClonePointer(),$0
2841+
)
2842+
})
28092843
}
28102844

28112845
/**
@@ -7881,6 +7915,12 @@ private var initializationResult: InitializationResult = {
78817915
if (uniffi_loro_checksum_method_loromovablelist_get_cursor() != 118) {
78827916
return InitializationResult.apiChecksumMismatch
78837917
}
7918+
if (uniffi_loro_checksum_method_loromovablelist_get_deep_value() != 18542) {
7919+
return InitializationResult.apiChecksumMismatch
7920+
}
7921+
if (uniffi_loro_checksum_method_loromovablelist_get_value() != 50843) {
7922+
return InitializationResult.apiChecksumMismatch
7923+
}
78847924
if (uniffi_loro_checksum_method_loromovablelist_id() != 9803) {
78857925
return InitializationResult.apiChecksumMismatch
78867926
}

loro-rs/src/loro.udl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,14 @@ interface LoroMovableList{
613613
u32 len();
614614

615615
boolean is_empty();
616+
617+
/// Get the deep value of the container.
618+
LoroValue get_deep_value();
619+
620+
/// Get the shallow value of the container.
621+
///
622+
/// This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].
623+
LoroValue get_value();
616624

617625
/// Pop the last element of the list.
618626
[Throws=LoroError]

0 commit comments

Comments
 (0)