From 46a5af8e623b7051409a031365eb66431c657718 Mon Sep 17 00:00:00 2001 From: Leon Zhao Date: Wed, 13 May 2026 10:55:53 +0800 Subject: [PATCH 1/3] chore: upgrade react native binding to 1.12 --- android/CMakeLists.txt | 10 +- android/build.gradle | 1 + android/cpp-adapter.cpp | 32 +- example/ios/Podfile.lock | 10 +- loro-react-native.podspec | 4 +- loro-rs/Cargo.lock | 416 +- loro-rs/Cargo.toml | 8 +- package.json | 4 +- src/extension.ts | 74 +- src/generated/loro-ffi.ts | 578 ++- src/generated/loro.ts | 8351 +++++++++++++++++++++---------------- src/index.tsx | 7 + yarn.lock | 10 +- 13 files changed, 5374 insertions(+), 4131 deletions(-) diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 525cfb0..942636b 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -11,10 +11,9 @@ execute_process( OUTPUT_VARIABLE UNIFFI_BINDGEN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ) -string(REGEX - REPLACE "/package\\.json$" "" - UNIFFI_BINDGEN_PATH ${UNIFFI_BINDGEN_PATH} -) +# Get the directory; get_filename_component and cmake_path will normalize +# paths with Windows path separators. +get_filename_component(UNIFFI_BINDGEN_PATH "${UNIFFI_BINDGEN_PATH}" DIRECTORY) # Specifies a path to native header files. include_directories( @@ -38,6 +37,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +# Set linker flags for 16KB page size alignment (required for Android 15+) +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384") + cmake_path( SET MY_RUST_LIB ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libloro_rs.a diff --git a/android/build.gradle b/android/build.gradle index 3cbf39a..396b5f9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -67,6 +67,7 @@ android { minSdkVersion getExtOrIntegerDefault("minSdkVersion") targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() + consumerProguardFiles 'proguard-rules.pro' buildFeatures { prefab true diff --git a/android/cpp-adapter.cpp b/android/cpp-adapter.cpp index 735343c..8351388 100644 --- a/android/cpp-adapter.cpp +++ b/android/cpp-adapter.cpp @@ -24,34 +24,14 @@ Java_com_loro_lororeactnative_LoroReactNativeModule_nativeInstallRustCrate( jlong rtPtr, jobject callInvokerHolderJavaObj ) { - // https://github.com/realm/realm-js/blob/main/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.cpp#L122-L145 - // React Native uses the fbjni library for handling JNI, which has the concept of "hybrid objects", - // which are Java objects containing a pointer to a C++ object. The CallInvokerHolder, which has the - // invokeAsync method we want access to, is one such hybrid object. - // Rather than reworking our code to use fbjni throughout, this code unpacks the C++ object from the Java - // object `callInvokerHolderJavaObj` manually, based on reverse engineering the fbjni code. - - // 1. Get the Java object referred to by the mHybridData field of the Java holder object - auto callInvokerHolderClass = env->GetObjectClass(callInvokerHolderJavaObj); - auto hybridDataField = env->GetFieldID(callInvokerHolderClass, "mHybridData", "Lcom/facebook/jni/HybridData;"); - auto hybridDataObj = env->GetObjectField(callInvokerHolderJavaObj, hybridDataField); - - // 2. Get the destructor Java object referred to by the mDestructor field from the myHybridData Java object - auto hybridDataClass = env->FindClass("com/facebook/jni/HybridData"); - auto destructorField = - env->GetFieldID(hybridDataClass, "mDestructor", "Lcom/facebook/jni/HybridData$Destructor;"); - auto destructorObj = env->GetObjectField(hybridDataObj, destructorField); - - // 3. Get the mNativePointer field from the mDestructor Java object - auto destructorClass = env->FindClass("com/facebook/jni/HybridData$Destructor"); - auto nativePointerField = env->GetFieldID(destructorClass, "mNativePointer", "J"); - auto nativePointerValue = env->GetLongField(destructorObj, nativePointerField); - - // 4. Cast the mNativePointer back to its C++ type - auto nativePointer = reinterpret_cast(nativePointerValue); - auto jsCallInvoker = nativePointer->getCallInvoker(); + using JCallInvokerHolder = facebook::react::CallInvokerHolder; + auto holderLocal = facebook::jni::make_local(callInvokerHolderJavaObj); + auto holderRef = facebook::jni::static_ref_cast(holderLocal); + auto* holderCxx = holderRef->cthis(); + auto jsCallInvoker = holderCxx->getCallInvoker(); auto runtime = reinterpret_cast(rtPtr); + return lororeactnative::installRustCrate(*runtime, jsCallInvoker); } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index f16cb49..3ed5288 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -8,7 +8,7 @@ PODS: - hermes-engine (0.79.2): - hermes-engine/Pre-built (= 0.79.2) - hermes-engine/Pre-built (0.79.2) - - loro-react-native (1.10.3): + - loro-react-native (1.12.0): - DoubleConversion - glog - hermes-engine @@ -31,7 +31,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - uniffi-bindgen-react-native (= 0.28.3-5) + - uniffi-bindgen-react-native (= 0.31.0-2) - Yoga - RCT-Folly (2024.11.18.00): - boost @@ -1680,7 +1680,7 @@ PODS: - React-perflogger (= 0.79.2) - React-utils (= 0.79.2) - SocketRocket (0.7.1) - - uniffi-bindgen-react-native (0.28.3-5): + - uniffi-bindgen-react-native (0.31.0-2): - React-Core - Yoga (0.0.0) @@ -1917,7 +1917,7 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 hermes-engine: 314be5250afa5692b57b4dd1705959e1973a8ebe - loro-react-native: ef58f3d1b3bf19efb88e422080ed52552bf5c693 + loro-react-native: 2808df0cb6889cb4a64a5ba093907545873a39a4 RCT-Folly: 36fe2295e44b10d831836cc0d1daec5f8abcf809 RCTDeprecation: 83ffb90c23ee5cea353bd32008a7bca100908f8c RCTRequired: eb7c0aba998009f47a540bec9e9d69a54f68136e @@ -1981,7 +1981,7 @@ SPEC CHECKSUMS: ReactCodegen: b9c6802762046e8000655cee5ba22f6422620f03 ReactCommon: 4d0da92a5eb8da86c08e3ec34bd23ab439fb2461 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - uniffi-bindgen-react-native: 018090e6c342b31e1189eb4d098860e9d44caa86 + uniffi-bindgen-react-native: 205a15613d97a49fe17d5bda57f7fa46a7bbafd0 Yoga: c758bfb934100bb4bf9cbaccb52557cee35e8bdf PODFILE CHECKSUM: a5ca260180a96f18394d1d29176689cad6469ad8 diff --git a/loro-react-native.podspec b/loro-react-native.podspec index a650a75..44838b2 100644 --- a/loro-react-native.podspec +++ b/loro-react-native.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "cpp/generated/**/*.{hpp,cpp,c,h}" s.vendored_frameworks = "build/LoroFfiFramework.xcframework" - s.dependency "uniffi-bindgen-react-native", "0.28.3-5" + s.dependency "uniffi-bindgen-react-native", "0.31.0-2" # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. @@ -41,4 +41,4 @@ Pod::Spec.new do |s| s.dependency "ReactCommon/turbomodule/core" end end -end \ No newline at end of file +end diff --git a/loro-rs/Cargo.lock b/loro-rs/Cargo.lock index 0c8045c..c7d7d42 100644 --- a/loro-rs/Cargo.lock +++ b/loro-rs/Cargo.lock @@ -24,56 +24,12 @@ dependencies = [ "memchr", ] -[[package]] -name = "anstream" -version = "0.6.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstyle" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys", -] - [[package]] name = "anyhow" version = "1.0.98" @@ -109,43 +65,44 @@ checksum = "2ccd462b64c3c72f1be8305905a85d85403d768e8690c9b8bd3b9009a5761679" [[package]] name = "askama" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" dependencies = [ "askama_derive", - "askama_escape", + "itoa", + "percent-encoding", + "serde", + "serde_json", ] [[package]] name = "askama_derive" -version = "0.12.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" dependencies = [ "askama_parser", "basic-toml", - "mime", - "mime_guess", + "memchr", "proc-macro2", "quote", + "rustc-hash", "serde", + "serde_derive", "syn 2.0.103", ] -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - [[package]] name = "askama_parser" -version = "0.2.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" dependencies = [ - "nom", + "memchr", + "serde", + "serde_derive", + "winnow 0.7.15", ] [[package]] @@ -172,15 +129,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bitflags" version = "2.9.1" @@ -243,16 +191,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror", + "thiserror 2.0.18", ] [[package]] @@ -286,7 +234,6 @@ version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ - "anstream", "anstyle", "clap_lex", "strsim", @@ -316,12 +263,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - [[package]] name = "cpufeatures" version = "0.2.17" @@ -475,6 +416,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + [[package]] name = "fnv" version = "1.0.7" @@ -594,6 +551,12 @@ version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + [[package]] name = "heapless" version = "0.7.17" @@ -662,10 +625,16 @@ dependencies = [ ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" +name = "indexmap" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] [[package]] name = "itertools" @@ -719,6 +688,12 @@ version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + [[package]] name = "lock_api" version = "0.4.14" @@ -751,9 +726,9 @@ dependencies = [ [[package]] name = "loro" -version = "1.10.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75216d8f99725531a30f7b00901ee154a4f8a9b7f125bfe032e197d4c7ffb8c" +checksum = "adc16ee5fdda7bff6bbbd4ff276c31aa9747bc90ad1bdccf8f0da97cd2949c8a" dependencies = [ "enum-as-inner 0.6.1", "generic-btree", @@ -767,9 +742,9 @@ dependencies = [ [[package]] name = "loro-common" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70363ea05a9c507fd9d58b65dc414bf515f636d69d8ab53e50ecbe8d27eef90c" +checksum = "193e88dedf3bc07f3b25ec8bb609dd461349b26942e43933cb0f599bc09d9c5b" dependencies = [ "arbitrary", "enum-as-inner 0.6.1", @@ -780,7 +755,7 @@ dependencies = [ "serde", "serde_columnar", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -797,9 +772,9 @@ dependencies = [ [[package]] name = "loro-ffi" -version = "1.10.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f01c976985f63d06d6dcbc739b067c2880d8e59d6588783e78a9e56e5cba932f" +checksum = "212322ccd989eb5408b18c43764eef4872d3d17bc2d0fd910346ba0b9cf70ceb" dependencies = [ "loro", "serde_json", @@ -808,9 +783,9 @@ dependencies = [ [[package]] name = "loro-internal" -version = "1.10.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f447044ec3d3ba572623859add3334bd87b84340ee5fdf00315bfee0e3ad3e3f" +checksum = "8d42db22ea93c266d5b6ef09ba94af080b6a4d131942e9a28bfa6a218b312b5f" dependencies = [ "append-only-bytes", "arref", @@ -846,7 +821,7 @@ dependencies = [ "serde_columnar", "serde_json", "smallvec", - "thiserror", + "thiserror 1.0.69", "thread_local", "tracing", "wasm-bindgen", @@ -855,9 +830,9 @@ dependencies = [ [[package]] name = "loro-kv-store" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78beebc933a33c26495c9a98f05b38bc0a4c0a337ecfbd3146ce1f9437eec71f" +checksum = "18853eed186c39e0b9d541a1f847161ad05bcf366c412068c9d257d5d981a9b5" dependencies = [ "bytes", "ensure-cov", @@ -883,7 +858,7 @@ dependencies = [ [[package]] name = "loro-rs" -version = "1.10.3" +version = "1.12.0" dependencies = [ "loro-ffi", "uniffi", @@ -936,22 +911,6 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1063,12 +1022,6 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "once_cell_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" - [[package]] name = "overload" version = "0.1.1" @@ -1099,10 +1052,10 @@ dependencies = [ ] [[package]] -name = "paste" -version = "1.0.15" +name = "percent-encoding" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" @@ -1208,7 +1161,7 @@ checksum = "6b450dad8382b1b95061d5ca1eb792081fb082adf48c678791fe917509596d5f" dependencies = [ "ahash", "equivalent", - "hashbrown", + "hashbrown 0.15.4", "parking_lot", ] @@ -1334,6 +1287,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "rustversion" version = "1.0.21" @@ -1389,10 +1355,11 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -1406,7 +1373,7 @@ dependencies = [ "postcard", "serde", "serde_columnar_derive", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1421,11 +1388,20 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1444,6 +1420,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + [[package]] name = "sha2" version = "0.10.9" @@ -1472,9 +1457,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" [[package]] name = "sized-chunks" @@ -1550,6 +1535,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys", +] + [[package]] name = "textwrap" version = "0.16.2" @@ -1565,7 +1563,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", ] [[package]] @@ -1579,6 +1586,17 @@ dependencies = [ "syn 2.0.103", ] +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "thread_local" version = "1.1.9" @@ -1590,13 +1608,43 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ - "serde", + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", ] +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.2", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + [[package]] name = "tracing" version = "0.1.41" @@ -1676,12 +1724,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" -[[package]] -name = "unicase" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" - [[package]] name = "unicode-ident" version = "1.0.18" @@ -1690,9 +1732,9 @@ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "uniffi" -version = "0.28.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cb08c58c7ed7033150132febe696bef553f891b1ede57424b40d87a89e3c170" +checksum = "dc5f2297ee5b893405bed1a6929faec4713a061df158ecf5198089f23910d470" dependencies = [ "anyhow", "camino", @@ -1702,13 +1744,14 @@ dependencies = [ "uniffi_build", "uniffi_core", "uniffi_macros", + "uniffi_pipeline", ] [[package]] name = "uniffi_bindgen" -version = "0.28.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cade167af943e189a55020eda2c314681e223f1e42aca7c4e52614c2b627698f" +checksum = "8bc0c60a9607e7ab77a2ad47ec5530178015014839db25af7512447d2238016c" dependencies = [ "anyhow", "askama", @@ -1718,20 +1761,23 @@ dependencies = [ "glob", "goblin", "heck 0.5.0", + "indexmap", "once_cell", - "paste", "serde", + "tempfile", "textwrap", "toml", + "uniffi_internal_macros", "uniffi_meta", + "uniffi_pipeline", "uniffi_udl", ] [[package]] name = "uniffi_build" -version = "0.28.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7cf32576e08104b7dc2a6a5d815f37616e66c6866c2a639fe16e6d2286b75b" +checksum = "4c39413c43b955e4aa8a4e2b34bbd1b6b5ff6bd85532b52f9eb92fbe88c14458" dependencies = [ "anyhow", "camino", @@ -1739,36 +1785,36 @@ dependencies = [ ] [[package]] -name = "uniffi_checksum_derive" -version = "0.28.3" +name = "uniffi_core" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" +checksum = "77baf5d539fe2e1ad6805e942dbc5dbdeb2b83eb5f2b3a6535d422ca4b02a12f" dependencies = [ - "quote", - "syn 2.0.103", + "anyhow", + "bytes", + "once_cell", + "static_assertions", ] [[package]] -name = "uniffi_core" -version = "0.28.3" +name = "uniffi_internal_macros" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7687007d2546c454d8ae609b105daceb88175477dac280707ad6d95bcd6f1f" +checksum = "b4b42137524f4be6400fcaca9d02c1d4ecb6ad917e4013c0b93235526d8396e5" dependencies = [ "anyhow", - "bytes", - "log", - "once_cell", - "paste", - "static_assertions", + "indexmap", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "uniffi_macros" -version = "0.28.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12c65a5b12ec544ef136693af8759fb9d11aefce740fb76916721e876639033b" +checksum = "d9273ec45330d8fe9a3701b7b983cea7a4e218503359831967cb95d26b873561" dependencies = [ - "bincode", "camino", "fs-err", "once_cell", @@ -1782,48 +1828,41 @@ dependencies = [ [[package]] name = "uniffi_meta" -version = "0.28.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a74ed96c26882dac1ca9b93ca23c827e284bacbd7ec23c6f0b0372f747d59e4" +checksum = "431d2f443e7828a6c29d188de98b6771a6491ee98bba2d4372643bf93f988a18" dependencies = [ "anyhow", - "bytes", "siphasher", - "uniffi_checksum_derive", + "uniffi_internal_macros", + "uniffi_pipeline", ] [[package]] -name = "uniffi_testing" -version = "0.28.3" +name = "uniffi_pipeline" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6f984f0781f892cc864a62c3a5c60361b1ccbd68e538e6c9fbced5d82268ac" +checksum = "761ef74f6175e15603d0424cc5f98854c5baccfe7bf4ccb08e5816f9ab8af689" dependencies = [ "anyhow", - "camino", - "cargo_metadata", - "fs-err", - "once_cell", + "heck 0.5.0", + "indexmap", + "tempfile", + "uniffi_internal_macros", ] [[package]] name = "uniffi_udl" -version = "0.28.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037820a4cfc4422db1eaa82f291a3863c92c7d1789dc513489c36223f9b4cdfc" +checksum = "68773ec0e1c067b6505a73bbf6a5782f31a7f9209333a0df97b87565c46bf370" dependencies = [ "anyhow", "textwrap", "uniffi_meta", - "uniffi_testing", "weedle2", ] -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "valuable" version = "0.1.1" @@ -2130,6 +2169,21 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" + [[package]] name = "wit-bindgen-rt" version = "0.39.0" diff --git a/loro-rs/Cargo.toml b/loro-rs/Cargo.toml index ba537b5..633fb76 100644 --- a/loro-rs/Cargo.toml +++ b/loro-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loro-rs" -version = "1.10.3" +version = "1.12.0" edition = "2021" [lib] @@ -11,11 +11,11 @@ name = "uniffi-bindgen" path = "src/uniffi-bindgen.rs" [dependencies] -loro-ffi = { version = "1.10.3" } -uniffi = { version = "0.28.3" } +loro-ffi = { version = "1.12.0" } +uniffi = { version = "0.31.1" } [build-dependencies] -uniffi = { version = "0.28.3", features = ["build"] } +uniffi = { version = "0.31.1", features = ["build"] } [features] cli = ["uniffi/cli"] diff --git a/package.json b/package.json index 6d194dd..d73ed80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loro-react-native", - "version": "1.10.3", + "version": "1.12.0", "description": "React native binding for Loro", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", @@ -172,6 +172,6 @@ "version": "0.48.5" }, "dependencies": { - "uniffi-bindgen-react-native": "0.28.3-5" + "uniffi-bindgen-react-native": "0.31.0-2" } } diff --git a/src/extension.ts b/src/extension.ts index ee68d14..4e5199e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -32,6 +32,12 @@ declare module "./generated/loro" { getMap(id: ContainerId | string): LoroMap; getTree(id: ContainerId | string): LoroTree; getMovableList(id: ContainerId | string): LoroMovableList; + tryGetText(id: ContainerId | string): LoroText | undefined; + tryGetCounter(id: ContainerId | string): LoroCounter | undefined; + tryGetList(id: ContainerId | string): LoroList | undefined; + tryGetMap(id: ContainerId | string): LoroMap | undefined; + tryGetTree(id: ContainerId | string): LoroTree | undefined; + tryGetMovableList(id: ContainerId | string): LoroMovableList | undefined; travelChangeAncestors(ids: Array, travel: (change: ChangeMeta) => boolean): void; subscribeRoot(cb: (diff: DiffEvent) => void): SubscriptionInterface; subscribe(containerId: ContainerId, cb: (diff: DiffEvent) => void): SubscriptionInterface; @@ -172,7 +178,7 @@ LoroDoc.prototype.export = function (mode: ExportMode): ArrayBuffer { const _subscribeJsonpathRaw = LoroDoc.prototype.subscribeJsonpath; LoroDoc.prototype.subscribeJsonpath = function (path: string, cb: () => void): SubscriptionInterface { const listener: JsonPathSubscriber = { - onJsonpathMaybeChanged: cb, + onJsonpathChanged: cb, }; return _subscribeJsonpathRaw.call(this, path, listener); }; @@ -242,6 +248,72 @@ LoroDoc.prototype.getMovableList = function (id: ContainerId | string): LoroMova return originalGetMovableList.call(this, id); } +const originalTryGetText = LoroDoc.prototype.tryGetText; +LoroDoc.prototype.tryGetText = function (id: ContainerId | string): LoroText | undefined { + if (typeof id === 'string') { + id = new ContainerId.Root({ + name: id, + containerType: new ContainerType.Text(), + }); + } + return originalTryGetText.call(this, id); +} + +const originalTryGetCounter = LoroDoc.prototype.tryGetCounter; +LoroDoc.prototype.tryGetCounter = function (id: ContainerId | string): LoroCounter | undefined { + if (typeof id === 'string') { + id = new ContainerId.Root({ + name: id, + containerType: new ContainerType.Counter(), + }); + } + return originalTryGetCounter.call(this, id); +} + +const originalTryGetList = LoroDoc.prototype.tryGetList; +LoroDoc.prototype.tryGetList = function (id: ContainerId | string): LoroList | undefined { + if (typeof id === 'string') { + id = new ContainerId.Root({ + name: id, + containerType: new ContainerType.List(), + }); + } + return originalTryGetList.call(this, id); +} + +const originalTryGetMap = LoroDoc.prototype.tryGetMap; +LoroDoc.prototype.tryGetMap = function (id: ContainerId | string): LoroMap | undefined { + if (typeof id === 'string') { + id = new ContainerId.Root({ + name: id, + containerType: new ContainerType.Map(), + }); + } + return originalTryGetMap.call(this, id); +} + +const originalTryGetTree = LoroDoc.prototype.tryGetTree; +LoroDoc.prototype.tryGetTree = function (id: ContainerId | string): LoroTree | undefined { + if (typeof id === 'string') { + id = new ContainerId.Root({ + name: id, + containerType: new ContainerType.Tree(), + }); + } + return originalTryGetTree.call(this, id); +} + +const originalTryGetMovableList = LoroDoc.prototype.tryGetMovableList; +LoroDoc.prototype.tryGetMovableList = function (id: ContainerId | string): LoroMovableList | undefined { + if (typeof id === 'string') { + id = new ContainerId.Root({ + name: id, + containerType: new ContainerType.MovableList(), + }); + } + return originalTryGetMovableList.call(this, id); +} + const originalTravelChangeAncestors = LoroDoc.prototype.travelChangeAncestors; LoroDoc.prototype.travelChangeAncestors = function ( diff --git a/src/generated/loro-ffi.ts b/src/generated/loro-ffi.ts index 6d2b9bb..48073ba 100644 --- a/src/generated/loro-ffi.ts +++ b/src/generated/loro-ffi.ts @@ -1,11 +1,15 @@ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate. // Trust me, you don't want to mess with it! +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + import { type StructuralEquality as UniffiStructuralEquality, type UniffiForeignFuture as RuntimeUniffiForeignFuture, type UniffiRustCallStatus, - type UniffiRustArcPtr, + type UniffiGcObject, type UniffiRustFutureContinuationCallback as RuntimeUniffiRustFutureContinuationCallback, type UniffiResult, } from 'uniffi-bindgen-react-native'; @@ -24,11 +28,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): string; ubrn_uniffi_loro_ffi_fn_clone_awareness( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_awareness( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_awareness_new( @@ -72,24 +76,27 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_changeancestorstraveler( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_changeancestorstraveler( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_changeancestorstraveler( + vtable: UniffiVTableCallbackInterfaceChangeAncestorsTraveler + ): void; ubrn_uniffi_loro_ffi_fn_method_changeancestorstraveler_travel( ptr: bigint, change: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): number; ubrn_uniffi_loro_ffi_fn_clone_changemodifier( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_changemodifier( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_method_changemodifier_set_message( @@ -103,11 +110,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_configure( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_configure( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_method_configure_fork( @@ -137,24 +144,27 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_clone_containeridlike( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_containeridlike( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_containeridlike( + vtable: UniffiVTableCallbackInterfaceContainerIdLike + ): void; ubrn_uniffi_loro_ffi_fn_method_containeridlike_as_container_id( ptr: bigint, ty: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_cursor( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_cursor( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_cursor_decode( @@ -173,11 +183,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_diffbatch( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_diffbatch( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_diffbatch_new( @@ -194,11 +204,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_ephemeralstore( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_ephemeralstore( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_ephemeralstore_new( @@ -258,37 +268,43 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_clone_ephemeralsubscriber( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_ephemeralsubscriber( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_ephemeralsubscriber( + vtable: UniffiVTableCallbackInterfaceEphemeralSubscriber + ): void; ubrn_uniffi_loro_ffi_fn_method_ephemeralsubscriber_on_ephemeral_event( ptr: bigint, event: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_firstcommitfrompeercallback( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_firstcommitfrompeercallback( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_firstcommitfrompeercallback( + vtable: UniffiVTableCallbackInterfaceFirstCommitFromPeerCallback + ): void; ubrn_uniffi_loro_ffi_fn_method_firstcommitfrompeercallback_on_first_commit_from_peer( ptr: bigint, payload: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_fractionalindex( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_fractionalindex( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_fractionalindex_from_bytes( @@ -299,16 +315,16 @@ interface NativeModuleInterface { str: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): bigint; - ubrn_uniffi_loro_ffi_fn_method_fractionalindex_to_string( + ubrn_uniffi_loro_ffi_fn_method_fractionalindex_uniffi_trait_display( ptr: bigint, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_frontiers( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_frontiers( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_frontiers_decode( @@ -343,38 +359,59 @@ interface NativeModuleInterface { ptr: bigint, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; - ubrn_uniffi_loro_ffi_fn_clone_localephemerallistener( + ubrn_uniffi_loro_ffi_fn_clone_jsonpathsubscriber( + handle: bigint, + uniffi_out_err: UniffiRustCallStatus + ): bigint; + ubrn_uniffi_loro_ffi_fn_free_jsonpathsubscriber( + handle: bigint, + uniffi_out_err: UniffiRustCallStatus + ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_jsonpathsubscriber( + vtable: UniffiVTableCallbackInterfaceJsonPathSubscriber + ): void; + ubrn_uniffi_loro_ffi_fn_method_jsonpathsubscriber_on_jsonpath_changed( ptr: bigint, uniffi_out_err: UniffiRustCallStatus + ): void; + ubrn_uniffi_loro_ffi_fn_clone_localephemerallistener( + handle: bigint, + uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_localephemerallistener( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_localephemerallistener( + vtable: UniffiVTableCallbackInterfaceLocalEphemeralListener + ): void; ubrn_uniffi_loro_ffi_fn_method_localephemerallistener_on_ephemeral_update( ptr: bigint, update: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_localupdatecallback( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_localupdatecallback( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_localupdatecallback( + vtable: UniffiVTableCallbackInterfaceLocalUpdateCallback + ): void; ubrn_uniffi_loro_ffi_fn_method_localupdatecallback_on_local_update( ptr: bigint, update: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_lorocounter( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorocounter( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_lorocounter_new( @@ -420,11 +457,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_lorodoc( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorodoc( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_lorodoc_new( @@ -503,6 +540,11 @@ interface NativeModuleInterface { b: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_export( + ptr: bigint, + mode: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; ubrn_uniffi_loro_ffi_fn_method_lorodoc_export_json_in_id_span( ptr: bigint, idSpan: Uint8Array, @@ -598,6 +640,11 @@ interface NativeModuleInterface { len: number, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_get_container( + ptr: bigint, + id: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; ubrn_uniffi_loro_ffi_fn_method_lorodoc_get_counter( ptr: bigint, id: bigint, @@ -796,6 +843,12 @@ interface NativeModuleInterface { callback: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_jsonpath( + ptr: bigint, + path: Uint8Array, + callback: bigint, + uniffi_out_err: UniffiRustCallStatus + ): bigint; ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_local_update( ptr: bigint, callback: bigint, @@ -817,17 +870,47 @@ interface NativeModuleInterface { f: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_counter( + ptr: bigint, + id: bigint, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_list( + ptr: bigint, + id: bigint, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_map( + ptr: bigint, + id: bigint, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_movable_list( + ptr: bigint, + id: bigint, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_text( + ptr: bigint, + id: bigint, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_tree( + ptr: bigint, + id: bigint, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; ubrn_uniffi_loro_ffi_fn_method_lorodoc_vv_to_frontiers( ptr: bigint, vv: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_clone_lorolist( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorolist( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_lorolist_new( @@ -956,11 +1039,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_loromap( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_loromap( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_loromap_new( @@ -1113,11 +1196,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_loromovablelist( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_loromovablelist( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_loromovablelist_new( @@ -1304,11 +1387,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_lorotext( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorotext( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_lorotext_new( @@ -1324,12 +1407,25 @@ interface NativeModuleInterface { pos: number, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorotext_convert_pos( + ptr: bigint, + index: number, + from: Uint8Array, + to: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; ubrn_uniffi_loro_ffi_fn_method_lorotext_delete( ptr: bigint, pos: number, len: number, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_method_lorotext_delete_utf16( + ptr: bigint, + pos: number, + len: number, + uniffi_out_err: UniffiRustCallStatus + ): void; ubrn_uniffi_loro_ffi_fn_method_lorotext_delete_utf8( ptr: bigint, pos: number, @@ -1369,6 +1465,12 @@ interface NativeModuleInterface { s: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_method_lorotext_insert_utf16( + ptr: bigint, + pos: number, + s: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): void; ubrn_uniffi_loro_ffi_fn_method_lorotext_insert_utf8( ptr: bigint, pos: number, @@ -1407,6 +1509,22 @@ interface NativeModuleInterface { value: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_method_lorotext_mark_utf16( + ptr: bigint, + from: number, + to: number, + key: Uint8Array, + value: bigint, + uniffi_out_err: UniffiRustCallStatus + ): void; + ubrn_uniffi_loro_ffi_fn_method_lorotext_mark_utf8( + ptr: bigint, + from: number, + to: number, + key: Uint8Array, + value: bigint, + uniffi_out_err: UniffiRustCallStatus + ): void; ubrn_uniffi_loro_ffi_fn_method_lorotext_push_str( ptr: bigint, s: Uint8Array, @@ -1418,6 +1536,19 @@ interface NativeModuleInterface { endIndex: number, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorotext_slice_delta( + ptr: bigint, + startIndex: number, + endIndex: number, + posType: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorotext_slice_utf16( + ptr: bigint, + startIndex: number, + endIndex: number, + uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; ubrn_uniffi_loro_ffi_fn_method_lorotext_splice( ptr: bigint, pos: number, @@ -1425,6 +1556,13 @@ interface NativeModuleInterface { s: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_lorotext_splice_utf16( + ptr: bigint, + pos: number, + len: number, + s: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): void; ubrn_uniffi_loro_ffi_fn_method_lorotext_subscribe( ptr: bigint, subscriber: bigint, @@ -1434,11 +1572,14 @@ interface NativeModuleInterface { ptr: bigint, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; - ubrn_uniffi_loro_ffi_fn_method_lorotext_to_string( + ubrn_uniffi_loro_ffi_fn_method_lorotext_unmark( ptr: bigint, + from: number, + to: number, + key: Uint8Array, uniffi_out_err: UniffiRustCallStatus - ): Uint8Array; - ubrn_uniffi_loro_ffi_fn_method_lorotext_unmark( + ): void; + ubrn_uniffi_loro_ffi_fn_method_lorotext_unmark_utf16( ptr: bigint, from: number, to: number, @@ -1457,12 +1598,16 @@ interface NativeModuleInterface { options: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; - ubrn_uniffi_loro_ffi_fn_clone_lorotree( + ubrn_uniffi_loro_ffi_fn_method_lorotext_uniffi_trait_display( ptr: bigint, uniffi_out_err: UniffiRustCallStatus + ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_clone_lorotree( + handle: bigint, + uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorotree( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_lorotree_new( @@ -1604,11 +1749,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_lorounknown( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorounknown( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_method_lorounknown_id( @@ -1616,25 +1761,31 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_lorovaluelike( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_lorovaluelike( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_lorovaluelike( + vtable: UniffiVTableCallbackInterfaceLoroValueLike + ): void; ubrn_uniffi_loro_ffi_fn_method_lorovaluelike_as_loro_value( ptr: bigint, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_onpop( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_onpop( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_onpop( + vtable: UniffiVTableCallbackInterfaceOnPop + ): void; ubrn_uniffi_loro_ffi_fn_method_onpop_on_pop( ptr: bigint, undoOrRedo: Uint8Array, @@ -1643,13 +1794,16 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_onpush( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_onpush( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_onpush( + vtable: UniffiVTableCallbackInterfaceOnPush + ): void; ubrn_uniffi_loro_ffi_fn_method_onpush_on_push( ptr: bigint, undoOrRedo: Uint8Array, @@ -1658,24 +1812,27 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): Uint8Array; ubrn_uniffi_loro_ffi_fn_clone_precommitcallback( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_precommitcallback( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_precommitcallback( + vtable: UniffiVTableCallbackInterfacePreCommitCallback + ): void; ubrn_uniffi_loro_ffi_fn_method_precommitcallback_on_pre_commit( ptr: bigint, payload: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_styleconfigmap( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_styleconfigmap( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_styleconfigmap_default_rich_text_config( @@ -1696,24 +1853,27 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_subscriber( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_subscriber( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_subscriber( + vtable: UniffiVTableCallbackInterfaceSubscriber + ): void; ubrn_uniffi_loro_ffi_fn_method_subscriber_on_diff( ptr: bigint, diff: Uint8Array, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_subscription( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_subscription( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_method_subscription_detach( @@ -1725,11 +1885,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_undomanager( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_undomanager( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_undomanager_new( @@ -1818,23 +1978,26 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): number; ubrn_uniffi_loro_ffi_fn_clone_unsubscriber( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_unsubscriber( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; + ubrn_uniffi_loro_ffi_fn_init_callback_vtable_unsubscriber( + vtable: UniffiVTableCallbackInterfaceUnsubscriber + ): void; ubrn_uniffi_loro_ffi_fn_method_unsubscriber_on_unsubscribe( ptr: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_clone_valueorcontainer( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_valueorcontainer( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_container( @@ -1886,11 +2049,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): number; ubrn_uniffi_loro_ffi_fn_clone_versionrange( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_versionrange( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_versionrange_from_vv( @@ -1955,11 +2118,11 @@ interface NativeModuleInterface { uniffi_out_err: UniffiRustCallStatus ): number; ubrn_uniffi_loro_ffi_fn_clone_versionvector( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): bigint; ubrn_uniffi_loro_ffi_fn_free_versionvector( - ptr: bigint, + handle: bigint, uniffi_out_err: UniffiRustCallStatus ): void; ubrn_uniffi_loro_ffi_fn_constructor_versionvector_decode( @@ -2086,11 +2249,11 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_subscribe_local_update(): number; ubrn_uniffi_loro_ffi_checksum_method_ephemeralsubscriber_on_ephemeral_event(): number; ubrn_uniffi_loro_ffi_checksum_method_firstcommitfrompeercallback_on_first_commit_from_peer(): number; - ubrn_uniffi_loro_ffi_checksum_method_fractionalindex_to_string(): number; ubrn_uniffi_loro_ffi_checksum_method_frontiers_encode(): number; ubrn_uniffi_loro_ffi_checksum_method_frontiers_eq(): number; ubrn_uniffi_loro_ffi_checksum_method_frontiers_is_empty(): number; ubrn_uniffi_loro_ffi_checksum_method_frontiers_to_vec(): number; + ubrn_uniffi_loro_ffi_checksum_method_jsonpathsubscriber_on_jsonpath_changed(): number; ubrn_uniffi_loro_ffi_checksum_method_localephemerallistener_on_ephemeral_update(): number; ubrn_uniffi_loro_ffi_checksum_method_localupdatecallback_on_local_update(): number; ubrn_uniffi_loro_ffi_checksum_method_lorocounter_decrement(): number; @@ -2118,6 +2281,7 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_lorodoc_delete_root_container(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_detach(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_diff(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_json_in_id_span(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_json_updates(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_json_updates_without_peer_compression(): number; @@ -2137,6 +2301,7 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_by_str_path(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_change(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_changed_containers_in(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_container(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_counter(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_cursor_pos(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_deep_value(): number; @@ -2179,10 +2344,17 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_lorodoc_state_vv(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_first_commit_from_peer(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_jsonpath(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_local_update(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_pre_commit(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_root(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_travel_change_ancestors(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_counter(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_list(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_map(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_movable_list(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_text(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_tree(): number; ubrn_uniffi_loro_ffi_checksum_method_lorodoc_vv_to_frontiers(): number; ubrn_uniffi_loro_ffi_checksum_method_lorolist_clear(): number; ubrn_uniffi_loro_ffi_checksum_method_lorolist_delete(): number; @@ -2275,7 +2447,9 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_to_vec(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_apply_delta(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_char_at(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_convert_pos(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_delete(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_delete_utf16(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_delete_utf8(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_doc(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_get_attached(): number; @@ -2284,6 +2458,7 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_lorotext_get_richtext_value(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_id(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_insert(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_insert_utf16(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_insert_utf8(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_is_attached(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_is_deleted(): number; @@ -2292,13 +2467,18 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_lorotext_len_utf16(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_len_utf8(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_mark(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_mark_utf16(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_mark_utf8(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_push_str(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_slice(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_slice_delta(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_slice_utf16(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_splice(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_splice_utf16(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_subscribe(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_to_delta(): number; - ubrn_uniffi_loro_ffi_checksum_method_lorotext_to_string(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_unmark(): number; + ubrn_uniffi_loro_ffi_checksum_method_lorotext_unmark_utf16(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_update(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotext_update_by_line(): number; ubrn_uniffi_loro_ffi_checksum_method_lorotree_children(): number; @@ -2423,178 +2603,146 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_constructor_versionvector_decode(): number; ubrn_uniffi_loro_ffi_checksum_constructor_versionvector_new(): number; ubrn_ffi_loro_ffi_uniffi_contract_version(): number; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_changeancestorstraveler( - vtable: UniffiVTableCallbackInterfaceChangeAncestorsTraveler - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_containeridlike( - vtable: UniffiVTableCallbackInterfaceContainerIdLike - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_ephemeralsubscriber( - vtable: UniffiVTableCallbackInterfaceEphemeralSubscriber - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_firstcommitfrompeercallback( - vtable: UniffiVTableCallbackInterfaceFirstCommitFromPeerCallback - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_localephemerallistener( - vtable: UniffiVTableCallbackInterfaceLocalEphemeralListener - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_localupdatecallback( - vtable: UniffiVTableCallbackInterfaceLocalUpdateCallback - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_lorovaluelike( - vtable: UniffiVTableCallbackInterfaceLoroValueLike - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_onpop( - vtable: UniffiVTableCallbackInterfaceOnPop - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_onpush( - vtable: UniffiVTableCallbackInterfaceOnPush - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_precommitcallback( - vtable: UniffiVTableCallbackInterfacePreCommitCallback - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_subscriber( - vtable: UniffiVTableCallbackInterfaceSubscriber - ): void; - ubrn_uniffi_loro_ffi_fn_init_callback_vtable_unsubscriber( - vtable: UniffiVTableCallbackInterfaceUnsubscriber - ): void; ubrn_uniffi_internal_fn_method_awareness_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_changeancestorstraveler_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_changemodifier_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_configure_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_containeridlike_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_cursor_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_diffbatch_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_ephemeralstore_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_ephemeralsubscriber_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_firstcommitfrompeercallback_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_fractionalindex_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_frontiers_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; + ubrn_uniffi_internal_fn_method_jsonpathsubscriber_ffi__bless_pointer( + pointer: bigint, + uniffi_out_err: UniffiRustCallStatus + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_localephemerallistener_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_localupdatecallback_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorocounter_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorodoc_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorolist_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_loromap_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_loromovablelist_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorotext_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorotree_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorounknown_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_lorovaluelike_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_onpop_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_onpush_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_precommitcallback_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_styleconfigmap_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_subscriber_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_subscription_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_undomanager_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_unsubscriber_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_valueorcontainer_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_versionrange_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; ubrn_uniffi_internal_fn_method_versionvector_ffi__bless_pointer( pointer: bigint, uniffi_out_err: UniffiRustCallStatus - ): UniffiRustArcPtr; + ): UniffiGcObject; } // Casting globalThis to any allows us to look for `NativeLoro` @@ -2611,123 +2759,116 @@ export type UniffiRustFutureContinuationCallback = ( data: bigint, pollResult: number ) => void; -type UniffiForeignFutureFree = (handle: bigint) => void; +export type UniffiForeignFutureDroppedCallback = (handle: bigint) => void; type UniffiCallbackInterfaceFree = (handle: bigint) => void; -export type UniffiForeignFuture = { +type UniffiCallbackInterfaceClone = (handle: bigint) => UniffiResult; +export type UniffiForeignFutureDroppedCallbackStruct = { handle: bigint; - free: UniffiForeignFutureFree; + free: UniffiForeignFutureDroppedCallback; }; -export type UniffiForeignFutureStructU8 = { +export type UniffiForeignFutureResultU8 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteU8 = ( callbackData: bigint, - result: UniffiForeignFutureStructU8 + result: UniffiForeignFutureResultU8 ) => void; -export type UniffiForeignFutureStructI8 = { +export type UniffiForeignFutureResultI8 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteI8 = ( callbackData: bigint, - result: UniffiForeignFutureStructI8 + result: UniffiForeignFutureResultI8 ) => void; -export type UniffiForeignFutureStructU16 = { +export type UniffiForeignFutureResultU16 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteU16 = ( callbackData: bigint, - result: UniffiForeignFutureStructU16 + result: UniffiForeignFutureResultU16 ) => void; -export type UniffiForeignFutureStructI16 = { +export type UniffiForeignFutureResultI16 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteI16 = ( callbackData: bigint, - result: UniffiForeignFutureStructI16 + result: UniffiForeignFutureResultI16 ) => void; -export type UniffiForeignFutureStructU32 = { +export type UniffiForeignFutureResultU32 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteU32 = ( callbackData: bigint, - result: UniffiForeignFutureStructU32 + result: UniffiForeignFutureResultU32 ) => void; -export type UniffiForeignFutureStructI32 = { +export type UniffiForeignFutureResultI32 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteI32 = ( callbackData: bigint, - result: UniffiForeignFutureStructI32 + result: UniffiForeignFutureResultI32 ) => void; -export type UniffiForeignFutureStructU64 = { +export type UniffiForeignFutureResultU64 = { returnValue: bigint; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteU64 = ( callbackData: bigint, - result: UniffiForeignFutureStructU64 + result: UniffiForeignFutureResultU64 ) => void; -export type UniffiForeignFutureStructI64 = { +export type UniffiForeignFutureResultI64 = { returnValue: bigint; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteI64 = ( callbackData: bigint, - result: UniffiForeignFutureStructI64 + result: UniffiForeignFutureResultI64 ) => void; -export type UniffiForeignFutureStructF32 = { +export type UniffiForeignFutureResultF32 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteF32 = ( callbackData: bigint, - result: UniffiForeignFutureStructF32 + result: UniffiForeignFutureResultF32 ) => void; -export type UniffiForeignFutureStructF64 = { +export type UniffiForeignFutureResultF64 = { returnValue: number; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteF64 = ( callbackData: bigint, - result: UniffiForeignFutureStructF64 + result: UniffiForeignFutureResultF64 ) => void; -export type UniffiForeignFutureStructPointer = { - returnValue: bigint; - callStatus: UniffiRustCallStatus; -}; -export type UniffiForeignFutureCompletePointer = ( - callbackData: bigint, - result: UniffiForeignFutureStructPointer -) => void; -export type UniffiForeignFutureStructRustBuffer = { +export type UniffiForeignFutureResultRustBuffer = { returnValue: Uint8Array; callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteRustBuffer = ( callbackData: bigint, - result: UniffiForeignFutureStructRustBuffer + result: UniffiForeignFutureResultRustBuffer ) => void; -export type UniffiForeignFutureStructVoid = { +export type UniffiForeignFutureResultVoid = { callStatus: UniffiRustCallStatus; }; export type UniffiForeignFutureCompleteVoid = ( callbackData: bigint, - result: UniffiForeignFutureStructVoid + result: UniffiForeignFutureResultVoid ) => void; type UniffiCallbackInterfaceChangeAncestorsTravelerMethod0 = ( uniffiHandle: bigint, change: Uint8Array -) => UniffiResult; +) => number; type UniffiCallbackInterfaceContainerIdLikeMethod0 = ( uniffiHandle: bigint, ty: Uint8Array -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceEphemeralSubscriberMethod0 = ( uniffiHandle: bigint, event: Uint8Array @@ -2736,6 +2877,9 @@ type UniffiCallbackInterfaceFirstCommitFromPeerCallbackMethod0 = ( uniffiHandle: bigint, payload: Uint8Array ) => UniffiResult; +type UniffiCallbackInterfaceJsonPathSubscriberMethod0 = ( + uniffiHandle: bigint +) => UniffiResult; type UniffiCallbackInterfaceLocalEphemeralListenerMethod0 = ( uniffiHandle: bigint, update: Uint8Array @@ -2746,7 +2890,7 @@ type UniffiCallbackInterfaceLocalUpdateCallbackMethod0 = ( ) => UniffiResult; type UniffiCallbackInterfaceLoroValueLikeMethod0 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceOnPopMethod0 = ( uniffiHandle: bigint, undoOrRedo: Uint8Array, @@ -2758,7 +2902,7 @@ type UniffiCallbackInterfaceOnPushMethod0 = ( undoOrRedo: Uint8Array, span: Uint8Array, diffEvent: Uint8Array -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfacePreCommitCallbackMethod0 = ( uniffiHandle: bigint, payload: Uint8Array @@ -2772,89 +2916,108 @@ type UniffiCallbackInterfaceUnsubscriberMethod0 = ( ) => UniffiResult; type UniffiCallbackInterfaceValueOrContainerMethod0 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod1 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod2 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod3 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod4 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod5 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod6 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod7 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod8 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod9 = ( uniffiHandle: bigint -) => UniffiResult; +) => Uint8Array; type UniffiCallbackInterfaceValueOrContainerMethod10 = ( uniffiHandle: bigint -) => UniffiResult; +) => number; type UniffiCallbackInterfaceValueOrContainerMethod11 = ( uniffiHandle: bigint -) => UniffiResult; +) => number; export type UniffiVTableCallbackInterfaceChangeAncestorsTraveler = { - travel: UniffiCallbackInterfaceChangeAncestorsTravelerMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + travel: UniffiCallbackInterfaceChangeAncestorsTravelerMethod0; }; export type UniffiVTableCallbackInterfaceContainerIdLike = { - asContainerId: UniffiCallbackInterfaceContainerIdLikeMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + asContainerId: UniffiCallbackInterfaceContainerIdLikeMethod0; }; export type UniffiVTableCallbackInterfaceEphemeralSubscriber = { - onEphemeralEvent: UniffiCallbackInterfaceEphemeralSubscriberMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onEphemeralEvent: UniffiCallbackInterfaceEphemeralSubscriberMethod0; }; export type UniffiVTableCallbackInterfaceFirstCommitFromPeerCallback = { + uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; onFirstCommitFromPeer: UniffiCallbackInterfaceFirstCommitFromPeerCallbackMethod0; +}; +export type UniffiVTableCallbackInterfaceJsonPathSubscriber = { uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onJsonpathChanged: UniffiCallbackInterfaceJsonPathSubscriberMethod0; }; export type UniffiVTableCallbackInterfaceLocalEphemeralListener = { - onEphemeralUpdate: UniffiCallbackInterfaceLocalEphemeralListenerMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onEphemeralUpdate: UniffiCallbackInterfaceLocalEphemeralListenerMethod0; }; export type UniffiVTableCallbackInterfaceLocalUpdateCallback = { - onLocalUpdate: UniffiCallbackInterfaceLocalUpdateCallbackMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onLocalUpdate: UniffiCallbackInterfaceLocalUpdateCallbackMethod0; }; export type UniffiVTableCallbackInterfaceLoroValueLike = { - asLoroValue: UniffiCallbackInterfaceLoroValueLikeMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + asLoroValue: UniffiCallbackInterfaceLoroValueLikeMethod0; }; export type UniffiVTableCallbackInterfaceOnPop = { - onPop: UniffiCallbackInterfaceOnPopMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onPop: UniffiCallbackInterfaceOnPopMethod0; }; export type UniffiVTableCallbackInterfaceOnPush = { - onPush: UniffiCallbackInterfaceOnPushMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onPush: UniffiCallbackInterfaceOnPushMethod0; }; export type UniffiVTableCallbackInterfacePreCommitCallback = { - onPreCommit: UniffiCallbackInterfacePreCommitCallbackMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onPreCommit: UniffiCallbackInterfacePreCommitCallbackMethod0; }; export type UniffiVTableCallbackInterfaceSubscriber = { - onDiff: UniffiCallbackInterfaceSubscriberMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onDiff: UniffiCallbackInterfaceSubscriberMethod0; }; export type UniffiVTableCallbackInterfaceUnsubscriber = { - onUnsubscribe: UniffiCallbackInterfaceUnsubscriberMethod0; uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; + onUnsubscribe: UniffiCallbackInterfaceUnsubscriberMethod0; }; export type UniffiVTableCallbackInterfaceValueOrContainer = { + uniffiFree: UniffiCallbackInterfaceFree; + uniffiClone: UniffiCallbackInterfaceClone; asContainer: UniffiCallbackInterfaceValueOrContainerMethod0; asLoroCounter: UniffiCallbackInterfaceValueOrContainerMethod1; asLoroList: UniffiCallbackInterfaceValueOrContainerMethod2; @@ -2867,7 +3030,6 @@ export type UniffiVTableCallbackInterfaceValueOrContainer = { containerType: UniffiCallbackInterfaceValueOrContainerMethod9; isContainer: UniffiCallbackInterfaceValueOrContainerMethod10; isValue: UniffiCallbackInterfaceValueOrContainerMethod11; - uniffiFree: UniffiCallbackInterfaceFree; }; // UniffiRustFutureContinuationCallback is generated as part of the component interface's diff --git a/src/generated/loro.ts b/src/generated/loro.ts index 9ed4d1f..262fde1 100644 --- a/src/generated/loro.ts +++ b/src/generated/loro.ts @@ -1,38 +1,42 @@ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate. // Trust me, you don't want to mess with it! + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck import nativeModule, { type UniffiRustFutureContinuationCallback, - type UniffiForeignFuture, - type UniffiForeignFutureStructU8, + type UniffiForeignFutureDroppedCallback, + type UniffiForeignFutureDroppedCallbackStruct, + type UniffiForeignFutureResultU8, type UniffiForeignFutureCompleteU8, - type UniffiForeignFutureStructI8, + type UniffiForeignFutureResultI8, type UniffiForeignFutureCompleteI8, - type UniffiForeignFutureStructU16, + type UniffiForeignFutureResultU16, type UniffiForeignFutureCompleteU16, - type UniffiForeignFutureStructI16, + type UniffiForeignFutureResultI16, type UniffiForeignFutureCompleteI16, - type UniffiForeignFutureStructU32, + type UniffiForeignFutureResultU32, type UniffiForeignFutureCompleteU32, - type UniffiForeignFutureStructI32, + type UniffiForeignFutureResultI32, type UniffiForeignFutureCompleteI32, - type UniffiForeignFutureStructU64, + type UniffiForeignFutureResultU64, type UniffiForeignFutureCompleteU64, - type UniffiForeignFutureStructI64, + type UniffiForeignFutureResultI64, type UniffiForeignFutureCompleteI64, - type UniffiForeignFutureStructF32, + type UniffiForeignFutureResultF32, type UniffiForeignFutureCompleteF32, - type UniffiForeignFutureStructF64, + type UniffiForeignFutureResultF64, type UniffiForeignFutureCompleteF64, - type UniffiForeignFutureStructPointer, - type UniffiForeignFutureCompletePointer, - type UniffiForeignFutureStructRustBuffer, + type UniffiForeignFutureResultRustBuffer, type UniffiForeignFutureCompleteRustBuffer, - type UniffiForeignFutureStructVoid, + type UniffiForeignFutureResultVoid, type UniffiForeignFutureCompleteVoid, type UniffiVTableCallbackInterfaceChangeAncestorsTraveler, type UniffiVTableCallbackInterfaceContainerIdLike, type UniffiVTableCallbackInterfaceEphemeralSubscriber, type UniffiVTableCallbackInterfaceFirstCommitFromPeerCallback, + type UniffiVTableCallbackInterfaceJsonPathSubscriber, type UniffiVTableCallbackInterfaceLocalEphemeralListener, type UniffiVTableCallbackInterfaceLocalUpdateCallback, type UniffiVTableCallbackInterfaceLoroValueLike, @@ -46,12 +50,11 @@ import nativeModule, { import { type FfiConverter, type UniffiByteArray, + type UniffiGcObject, type UniffiHandle, type UniffiObjectFactory, type UniffiReferenceHolder, - type UniffiRustArcPtr, type UniffiRustCallStatus, - type UnsafeMutableRawPointer, AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, @@ -83,7 +86,7 @@ import { } from 'uniffi-bindgen-react-native'; // Get converters from the other files, if any. -const uniffiCaller = new UniffiRustCaller(); +const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 })); const uniffiIsDebug = // @ts-ignore -- The process global might not be defined @@ -145,21 +148,8 @@ export const AbsolutePosition = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link AbsolutePosition}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link AbsolutePosition}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -203,21 +193,8 @@ export const AwarenessPeerUpdate = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link AwarenessPeerUpdate}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link AwarenessPeerUpdate}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -262,11 +239,11 @@ export type ChangeMeta = { /** * The commit message of the change */ - message: string | undefined; + message?: string; /** * The dependencies of the first op of the change */ - deps: FrontiersInterface; + deps: FrontiersLike; /** * The total op num inside this change */ @@ -284,21 +261,8 @@ export const ChangeMeta = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link ChangeMeta}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link ChangeMeta}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -339,10 +303,10 @@ const FfiConverterTypeChangeMeta = (() => { })(); export type CommitOptions = { - origin: string | undefined; + origin?: string; immediateRenew: boolean; - timestamp: /*i64*/ bigint | undefined; - commitMsg: string | undefined; + timestamp?: /*i64*/ bigint; + commitMsg?: string; }; /** @@ -356,21 +320,8 @@ export const CommitOptions = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link CommitOptions}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link CommitOptions}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -437,21 +388,8 @@ export const ContainerDiff = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link ContainerDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link ContainerDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -501,21 +439,8 @@ export const ContainerIdAndDiff = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link ContainerIdAndDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link ContainerIdAndDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -559,21 +484,8 @@ export const ContainerPath = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link ContainerPath}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link ContainerPath}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -617,21 +529,8 @@ export const CounterSpan = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link CounterSpan}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link CounterSpan}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -660,7 +559,7 @@ const FfiConverterTypeCounterSpan = (() => { })(); export type CursorWithPos = { - cursor: CursorInterface; + cursor: CursorLike; pos: AbsolutePosition; }; @@ -675,21 +574,8 @@ export const CursorWithPos = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link CursorWithPos}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link CursorWithPos}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -729,7 +615,7 @@ export type DiffEvent = { /** * The current receiver of the event. */ - currentTarget: ContainerId | undefined; + currentTarget?: ContainerId; /** * The diffs of the event. */ @@ -745,21 +631,8 @@ export const DiffEvent = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link DiffEvent}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link DiffEvent}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -813,21 +686,8 @@ export const EphemeralStoreEvent = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link EphemeralStoreEvent}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link EphemeralStoreEvent}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -877,21 +737,8 @@ export const FirstCommitFromPeerPayload = (() => { >(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link FirstCommitFromPeerPayload}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link FirstCommitFromPeerPayload}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); @@ -916,8 +763,8 @@ const FfiConverterTypeFirstCommitFromPeerPayload = (() => { })(); export type FrontiersOrId = { - frontiers: FrontiersInterface | undefined; - id: Id | undefined; + frontiers?: FrontiersLike; + id?: Id; }; /** @@ -931,21 +778,8 @@ export const FrontiersOrId = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link FrontiersOrId}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link FrontiersOrId}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -987,21 +821,8 @@ export const Id = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link Id}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link Id}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1043,21 +864,8 @@ export const IdLp = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link IdLp}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link IdLp}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1099,21 +907,8 @@ export const IdSpan = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link IdSpan}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link IdSpan}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1149,7 +944,7 @@ export type ImportBlobMetadata = { * However, it does not constitute a complete version vector, as it only contains counters * from peers included within the import blob. */ - partialStartVv: VersionVectorInterface; + partialStartVv: VersionVectorLike; /** * The partial end version vector. * @@ -1157,9 +952,9 @@ export type ImportBlobMetadata = { * However, it does not constitute a complete version vector, as it only contains counters * from peers included within the import blob. */ - partialEndVv: VersionVectorInterface; + partialEndVv: VersionVectorLike; startTimestamp: /*i64*/ bigint; - startFrontiers: FrontiersInterface; + startFrontiers: FrontiersLike; endTimestamp: /*i64*/ bigint; changeNum: /*u32*/ number; mode: string; @@ -1176,21 +971,8 @@ export const ImportBlobMetadata = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link ImportBlobMetadata}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link ImportBlobMetadata}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1235,7 +1017,7 @@ const FfiConverterTypeImportBlobMetadata = (() => { export type ImportStatus = { success: Map; - pending: Map | undefined; + pending?: Map; }; /** @@ -1249,21 +1031,8 @@ export const ImportStatus = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link ImportStatus}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link ImportStatus}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1294,7 +1063,7 @@ const FfiConverterTypeImportStatus = (() => { })(); export type MapDelta = { - updated: Map; + updated: Map; }; /** @@ -1306,21 +1075,8 @@ export const MapDelta = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link MapDelta}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link MapDelta}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1362,21 +1118,8 @@ export const PathItem = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link PathItem}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link PathItem}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1419,21 +1162,8 @@ export const PeerInfo = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link PeerInfo}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link PeerInfo}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1465,7 +1195,7 @@ const FfiConverterTypePeerInfo = (() => { })(); export type PosQueryResult = { - update: CursorInterface | undefined; + update?: CursorLike; current: AbsolutePosition; }; @@ -1480,21 +1210,8 @@ export const PosQueryResult = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link PosQueryResult}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link PosQueryResult}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1525,7 +1242,7 @@ const FfiConverterTypePosQueryResult = (() => { export type PreCommitCallbackPayload = { changeMeta: ChangeMeta; origin: string; - modifier: ChangeModifierInterface; + modifier: ChangeModifierLike; }; /** @@ -1540,21 +1257,8 @@ export const PreCommitCallbackPayload = (() => { >(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link PreCommitCallbackPayload}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link PreCommitCallbackPayload}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); @@ -1601,21 +1305,8 @@ export const StyleConfig = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link StyleConfig}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link StyleConfig}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1651,21 +1342,8 @@ export const TreeDiff = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link TreeDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link TreeDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1704,21 +1382,8 @@ export const TreeDiffItem = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link TreeDiffItem}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link TreeDiffItem}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1760,21 +1425,8 @@ export const TreeId = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link TreeId}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link TreeId}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1818,21 +1470,8 @@ export const UndoItemMeta = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link UndoItemMeta}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link UndoItemMeta}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1861,7 +1500,7 @@ const FfiConverterTypeUndoItemMeta = (() => { })(); export type UpdateOptions = { - timeoutMs: /*f64*/ number | undefined; + timeoutMs?: /*f64*/ number; useRefinedDiff: boolean; }; @@ -1876,21 +1515,8 @@ export const UpdateOptions = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link UpdateOptions}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link UpdateOptions}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -1935,21 +1561,8 @@ export const VersionRangeItem = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link VersionRangeItem}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link VersionRangeItem}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -2002,21 +1615,8 @@ export const VersionVectorDiff = (() => { ); })(); return Object.freeze({ - /** - * Create a frozen instance of {@link VersionVectorDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ create, - - /** - * Create a frozen instance of {@link VersionVectorDiff}, with defaults specified - * in Rust, in the {@link loro} crate. - */ new: create, - - /** - * Defaults specified in the {@link loro} crate. - */ defaults: () => Object.freeze(defaults()) as Partial, }); })(); @@ -2088,7 +1688,7 @@ export const CannotFindRelativePosition = (() => { */ readonly [variantOrdinalSymbol] = 1; - public readonly tag = CannotFindRelativePosition_Tags.ContainerDeleted; + readonly tag = CannotFindRelativePosition_Tags.ContainerDeleted; constructor(message: string) { super('CannotFindRelativePosition', 'ContainerDeleted', message); @@ -2110,7 +1710,7 @@ export const CannotFindRelativePosition = (() => { */ readonly [variantOrdinalSymbol] = 2; - public readonly tag = CannotFindRelativePosition_Tags.HistoryCleared; + readonly tag = CannotFindRelativePosition_Tags.HistoryCleared; constructor(message: string) { super('CannotFindRelativePosition', 'HistoryCleared', message); @@ -2132,7 +1732,7 @@ export const CannotFindRelativePosition = (() => { */ readonly [variantOrdinalSymbol] = 3; - public readonly tag = CannotFindRelativePosition_Tags.IdNotFound; + readonly tag = CannotFindRelativePosition_Tags.IdNotFound; constructor(message: string) { super('CannotFindRelativePosition', 'IdNotFound', message); @@ -2219,7 +1819,7 @@ export const ChangeTravelError = (() => { */ readonly [variantOrdinalSymbol] = 1; - public readonly tag = ChangeTravelError_Tags.TargetIdNotFound; + readonly tag = ChangeTravelError_Tags.TargetIdNotFound; constructor(message: string) { super('ChangeTravelError', 'TargetIdNotFound', message); @@ -2241,7 +1841,7 @@ export const ChangeTravelError = (() => { */ readonly [variantOrdinalSymbol] = 2; - public readonly tag = ChangeTravelError_Tags.TargetVersionNotIncluded; + readonly tag = ChangeTravelError_Tags.TargetVersionNotIncluded; constructor(message: string) { super('ChangeTravelError', 'TargetVersionNotIncluded', message); @@ -3198,14 +2798,327 @@ const FfiConverterTypeExpandType = (() => { return new FFIConverter(); })(); -// Enum: Index -export enum Index_Tags { - Key = 'Key', - Seq = 'Seq', - Node = 'Node', +// Enum: ExportMode +export enum ExportMode_Tags { + Snapshot = 'Snapshot', + Updates = 'Updates', + UpdatesInRange = 'UpdatesInRange', + ShallowSnapshot = 'ShallowSnapshot', + StateOnly = 'StateOnly', + SnapshotAt = 'SnapshotAt', } -export const Index = (() => { - type Key__interface = { +export const ExportMode = (() => { + type Snapshot__interface = { + tag: ExportMode_Tags.Snapshot; + }; + + class Snapshot_ extends UniffiEnum implements Snapshot__interface { + /** + * @private + * This field is private and should not be used, use `tag` instead. + */ + readonly [uniffiTypeNameSymbol] = 'ExportMode'; + readonly tag = ExportMode_Tags.Snapshot; + constructor() { + super('ExportMode', 'Snapshot'); + } + + static new(): Snapshot_ { + return new Snapshot_(); + } + + static instanceOf(obj: any): obj is Snapshot_ { + return obj.tag === ExportMode_Tags.Snapshot; + } + } + + type Updates__interface = { + tag: ExportMode_Tags.Updates; + inner: Readonly<{ from: VersionVectorLike }>; + }; + + class Updates_ extends UniffiEnum implements Updates__interface { + /** + * @private + * This field is private and should not be used, use `tag` instead. + */ + readonly [uniffiTypeNameSymbol] = 'ExportMode'; + readonly tag = ExportMode_Tags.Updates; + readonly inner: Readonly<{ from: VersionVectorLike }>; + constructor(inner: { from: VersionVectorLike }) { + super('ExportMode', 'Updates'); + this.inner = Object.freeze(inner); + } + + static new(inner: { from: VersionVectorLike }): Updates_ { + return new Updates_(inner); + } + + static instanceOf(obj: any): obj is Updates_ { + return obj.tag === ExportMode_Tags.Updates; + } + } + + type UpdatesInRange__interface = { + tag: ExportMode_Tags.UpdatesInRange; + inner: Readonly<{ spans: Array }>; + }; + + class UpdatesInRange_ + extends UniffiEnum + implements UpdatesInRange__interface + { + /** + * @private + * This field is private and should not be used, use `tag` instead. + */ + readonly [uniffiTypeNameSymbol] = 'ExportMode'; + readonly tag = ExportMode_Tags.UpdatesInRange; + readonly inner: Readonly<{ spans: Array }>; + constructor(inner: { spans: Array }) { + super('ExportMode', 'UpdatesInRange'); + this.inner = Object.freeze(inner); + } + + static new(inner: { spans: Array }): UpdatesInRange_ { + return new UpdatesInRange_(inner); + } + + static instanceOf(obj: any): obj is UpdatesInRange_ { + return obj.tag === ExportMode_Tags.UpdatesInRange; + } + } + + type ShallowSnapshot__interface = { + tag: ExportMode_Tags.ShallowSnapshot; + inner: Readonly<{ frontiers: FrontiersLike }>; + }; + + class ShallowSnapshot_ + extends UniffiEnum + implements ShallowSnapshot__interface + { + /** + * @private + * This field is private and should not be used, use `tag` instead. + */ + readonly [uniffiTypeNameSymbol] = 'ExportMode'; + readonly tag = ExportMode_Tags.ShallowSnapshot; + readonly inner: Readonly<{ frontiers: FrontiersLike }>; + constructor(inner: { frontiers: FrontiersLike }) { + super('ExportMode', 'ShallowSnapshot'); + this.inner = Object.freeze(inner); + } + + static new(inner: { frontiers: FrontiersLike }): ShallowSnapshot_ { + return new ShallowSnapshot_(inner); + } + + static instanceOf(obj: any): obj is ShallowSnapshot_ { + return obj.tag === ExportMode_Tags.ShallowSnapshot; + } + } + + type StateOnly__interface = { + tag: ExportMode_Tags.StateOnly; + inner: Readonly<{ frontiers: FrontiersLike | undefined }>; + }; + + class StateOnly_ extends UniffiEnum implements StateOnly__interface { + /** + * @private + * This field is private and should not be used, use `tag` instead. + */ + readonly [uniffiTypeNameSymbol] = 'ExportMode'; + readonly tag = ExportMode_Tags.StateOnly; + readonly inner: Readonly<{ frontiers: FrontiersLike | undefined }>; + constructor(inner: { frontiers: FrontiersLike | undefined }) { + super('ExportMode', 'StateOnly'); + this.inner = Object.freeze(inner); + } + + static new(inner: { frontiers: FrontiersLike | undefined }): StateOnly_ { + return new StateOnly_(inner); + } + + static instanceOf(obj: any): obj is StateOnly_ { + return obj.tag === ExportMode_Tags.StateOnly; + } + } + + type SnapshotAt__interface = { + tag: ExportMode_Tags.SnapshotAt; + inner: Readonly<{ frontiers: FrontiersLike }>; + }; + + class SnapshotAt_ extends UniffiEnum implements SnapshotAt__interface { + /** + * @private + * This field is private and should not be used, use `tag` instead. + */ + readonly [uniffiTypeNameSymbol] = 'ExportMode'; + readonly tag = ExportMode_Tags.SnapshotAt; + readonly inner: Readonly<{ frontiers: FrontiersLike }>; + constructor(inner: { frontiers: FrontiersLike }) { + super('ExportMode', 'SnapshotAt'); + this.inner = Object.freeze(inner); + } + + static new(inner: { frontiers: FrontiersLike }): SnapshotAt_ { + return new SnapshotAt_(inner); + } + + static instanceOf(obj: any): obj is SnapshotAt_ { + return obj.tag === ExportMode_Tags.SnapshotAt; + } + } + + function instanceOf(obj: any): obj is ExportMode { + return obj[uniffiTypeNameSymbol] === 'ExportMode'; + } + + return Object.freeze({ + instanceOf, + Snapshot: Snapshot_, + Updates: Updates_, + UpdatesInRange: UpdatesInRange_, + ShallowSnapshot: ShallowSnapshot_, + StateOnly: StateOnly_, + SnapshotAt: SnapshotAt_, + }); +})(); + +export type ExportMode = InstanceType< + (typeof ExportMode)[keyof Omit] +>; + +// FfiConverter for enum ExportMode +const FfiConverterTypeExportMode = (() => { + const ordinalConverter = FfiConverterInt32; + type TypeName = ExportMode; + class FFIConverter extends AbstractFfiConverterByteArray { + read(from: RustBuffer): TypeName { + switch (ordinalConverter.read(from)) { + case 1: + return new ExportMode.Snapshot(); + case 2: + return new ExportMode.Updates({ + from: FfiConverterTypeVersionVector.read(from), + }); + case 3: + return new ExportMode.UpdatesInRange({ + spans: FfiConverterArrayTypeIdSpan.read(from), + }); + case 4: + return new ExportMode.ShallowSnapshot({ + frontiers: FfiConverterTypeFrontiers.read(from), + }); + case 5: + return new ExportMode.StateOnly({ + frontiers: FfiConverterOptionalTypeFrontiers.read(from), + }); + case 6: + return new ExportMode.SnapshotAt({ + frontiers: FfiConverterTypeFrontiers.read(from), + }); + default: + throw new UniffiInternalError.UnexpectedEnumCase(); + } + } + write(value: TypeName, into: RustBuffer): void { + switch (value.tag) { + case ExportMode_Tags.Snapshot: { + ordinalConverter.write(1, into); + return; + } + case ExportMode_Tags.Updates: { + ordinalConverter.write(2, into); + const inner = value.inner; + FfiConverterTypeVersionVector.write(inner.from, into); + return; + } + case ExportMode_Tags.UpdatesInRange: { + ordinalConverter.write(3, into); + const inner = value.inner; + FfiConverterArrayTypeIdSpan.write(inner.spans, into); + return; + } + case ExportMode_Tags.ShallowSnapshot: { + ordinalConverter.write(4, into); + const inner = value.inner; + FfiConverterTypeFrontiers.write(inner.frontiers, into); + return; + } + case ExportMode_Tags.StateOnly: { + ordinalConverter.write(5, into); + const inner = value.inner; + FfiConverterOptionalTypeFrontiers.write(inner.frontiers, into); + return; + } + case ExportMode_Tags.SnapshotAt: { + ordinalConverter.write(6, into); + const inner = value.inner; + FfiConverterTypeFrontiers.write(inner.frontiers, into); + return; + } + default: + // Throwing from here means that ExportMode_Tags hasn't matched an ordinal. + throw new UniffiInternalError.UnexpectedEnumCase(); + } + } + allocationSize(value: TypeName): number { + switch (value.tag) { + case ExportMode_Tags.Snapshot: { + return ordinalConverter.allocationSize(1); + } + case ExportMode_Tags.Updates: { + const inner = value.inner; + let size = ordinalConverter.allocationSize(2); + size += FfiConverterTypeVersionVector.allocationSize(inner.from); + return size; + } + case ExportMode_Tags.UpdatesInRange: { + const inner = value.inner; + let size = ordinalConverter.allocationSize(3); + size += FfiConverterArrayTypeIdSpan.allocationSize(inner.spans); + return size; + } + case ExportMode_Tags.ShallowSnapshot: { + const inner = value.inner; + let size = ordinalConverter.allocationSize(4); + size += FfiConverterTypeFrontiers.allocationSize(inner.frontiers); + return size; + } + case ExportMode_Tags.StateOnly: { + const inner = value.inner; + let size = ordinalConverter.allocationSize(5); + size += FfiConverterOptionalTypeFrontiers.allocationSize( + inner.frontiers + ); + return size; + } + case ExportMode_Tags.SnapshotAt: { + const inner = value.inner; + let size = ordinalConverter.allocationSize(6); + size += FfiConverterTypeFrontiers.allocationSize(inner.frontiers); + return size; + } + default: + throw new UniffiInternalError.UnexpectedEnumCase(); + } + } + } + return new FFIConverter(); +})(); + +// Enum: Index +export enum Index_Tags { + Key = 'Key', + Seq = 'Seq', + Node = 'Node', +} +export const Index = (() => { + type Key__interface = { tag: Index_Tags.Key; inner: Readonly<{ key: string }>; }; @@ -3390,7 +3303,7 @@ export const JsonPathError = (() => { */ readonly [variantOrdinalSymbol] = 1; - public readonly tag = JsonPathError_Tags.InvalidJsonPath; + readonly tag = JsonPathError_Tags.InvalidJsonPath; constructor(message: string) { super('JsonPathError', 'InvalidJsonPath', message); @@ -3412,7 +3325,7 @@ export const JsonPathError = (() => { */ readonly [variantOrdinalSymbol] = 2; - public readonly tag = JsonPathError_Tags.EvaluationError; + readonly tag = JsonPathError_Tags.EvaluationError; constructor(message: string) { super('JsonPathError', 'EvaluationError', message); @@ -3481,10 +3394,7 @@ export enum ListDiffItem_Tags { export const ListDiffItem = (() => { type Insert__interface = { tag: ListDiffItem_Tags.Insert; - inner: Readonly<{ - insert: Array; - isMove: boolean; - }>; + inner: Readonly<{ insert: Array; isMove: boolean }>; }; /** @@ -3498,19 +3408,16 @@ export const ListDiffItem = (() => { readonly [uniffiTypeNameSymbol] = 'ListDiffItem'; readonly tag = ListDiffItem_Tags.Insert; readonly inner: Readonly<{ - insert: Array; + insert: Array; isMove: boolean; }>; - constructor(inner: { - insert: Array; - isMove: boolean; - }) { + constructor(inner: { insert: Array; isMove: boolean }) { super('ListDiffItem', 'Insert'); this.inner = Object.freeze(inner); } static new(inner: { - insert: Array; + insert: Array; isMove: boolean; }): Insert_ { return new Insert_(inner); @@ -3699,7 +3606,7 @@ export const LoroEncodeError = (() => { */ readonly [variantOrdinalSymbol] = 1; - public readonly tag = LoroEncodeError_Tags.FrontiersNotFound; + readonly tag = LoroEncodeError_Tags.FrontiersNotFound; constructor(message: string) { super('LoroEncodeError', 'FrontiersNotFound', message); @@ -3721,7 +3628,7 @@ export const LoroEncodeError = (() => { */ readonly [variantOrdinalSymbol] = 2; - public readonly tag = + readonly tag = LoroEncodeError_Tags.ShallowSnapshotIncompatibleWithOldFormat; constructor(message: string) { @@ -3748,7 +3655,7 @@ export const LoroEncodeError = (() => { */ readonly [variantOrdinalSymbol] = 3; - public readonly tag = LoroEncodeError_Tags.UnknownContainer; + readonly tag = LoroEncodeError_Tags.UnknownContainer; constructor(message: string) { super('LoroEncodeError', 'UnknownContainer', message); @@ -3848,6 +3755,7 @@ export enum LoroError_Tags { EndIndexLessThanStartIndex = 'EndIndexLessThanStartIndex', InvalidRootContainerName = 'InvalidRootContainerName', ImportUpdatesThatDependsOnOutdatedVersion = 'ImportUpdatesThatDependsOnOutdatedVersion', + ImportUnsupportedEncodingMode = 'ImportUnsupportedEncodingMode', SwitchToVersionBeforeShallowRoot = 'SwitchToVersionBeforeShallowRoot', ContainerDeleted = 'ContainerDeleted', ConcurrentOpsWithSamePeerId = 'ConcurrentOpsWithSamePeerID', @@ -3868,7 +3776,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 1; - public readonly tag = LoroError_Tags.UnmatchedContext; + readonly tag = LoroError_Tags.UnmatchedContext; constructor(message: string) { super('LoroError', 'UnmatchedContext', message); @@ -3890,7 +3798,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 2; - public readonly tag = LoroError_Tags.DecodeVersionVectorError; + readonly tag = LoroError_Tags.DecodeVersionVectorError; constructor(message: string) { super('LoroError', 'DecodeVersionVectorError', message); @@ -3912,7 +3820,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 3; - public readonly tag = LoroError_Tags.DecodeError; + readonly tag = LoroError_Tags.DecodeError; constructor(message: string) { super('LoroError', 'DecodeError', message); @@ -3934,7 +3842,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 4; - public readonly tag = LoroError_Tags.DecodeDataCorruptionError; + readonly tag = LoroError_Tags.DecodeDataCorruptionError; constructor(message: string) { super('LoroError', 'DecodeDataCorruptionError', message); @@ -3956,7 +3864,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 5; - public readonly tag = LoroError_Tags.DecodeChecksumMismatchError; + readonly tag = LoroError_Tags.DecodeChecksumMismatchError; constructor(message: string) { super('LoroError', 'DecodeChecksumMismatchError', message); @@ -3978,7 +3886,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 6; - public readonly tag = LoroError_Tags.IncompatibleFutureEncodingError; + readonly tag = LoroError_Tags.IncompatibleFutureEncodingError; constructor(message: string) { super('LoroError', 'IncompatibleFutureEncodingError', message); @@ -4000,7 +3908,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 7; - public readonly tag = LoroError_Tags.JsError; + readonly tag = LoroError_Tags.JsError; constructor(message: string) { super('LoroError', 'JsError', message); @@ -4022,7 +3930,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 8; - public readonly tag = LoroError_Tags.LockError; + readonly tag = LoroError_Tags.LockError; constructor(message: string) { super('LoroError', 'LockError', message); @@ -4044,7 +3952,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 9; - public readonly tag = LoroError_Tags.DuplicatedTransactionError; + readonly tag = LoroError_Tags.DuplicatedTransactionError; constructor(message: string) { super('LoroError', 'DuplicatedTransactionError', message); @@ -4066,7 +3974,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 10; - public readonly tag = LoroError_Tags.NotFoundError; + readonly tag = LoroError_Tags.NotFoundError; constructor(message: string) { super('LoroError', 'NotFoundError', message); @@ -4088,7 +3996,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 11; - public readonly tag = LoroError_Tags.TransactionError; + readonly tag = LoroError_Tags.TransactionError; constructor(message: string) { super('LoroError', 'TransactionError', message); @@ -4110,7 +4018,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 12; - public readonly tag = LoroError_Tags.OutOfBound; + readonly tag = LoroError_Tags.OutOfBound; constructor(message: string) { super('LoroError', 'OutOfBound', message); @@ -4132,7 +4040,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 13; - public readonly tag = LoroError_Tags.UsedOpId; + readonly tag = LoroError_Tags.UsedOpId; constructor(message: string) { super('LoroError', 'UsedOpId', message); @@ -4154,7 +4062,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 14; - public readonly tag = LoroError_Tags.TreeError; + readonly tag = LoroError_Tags.TreeError; constructor(message: string) { super('LoroError', 'TreeError', message); @@ -4176,7 +4084,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 15; - public readonly tag = LoroError_Tags.ArgErr; + readonly tag = LoroError_Tags.ArgErr; constructor(message: string) { super('LoroError', 'ArgErr', message); @@ -4198,7 +4106,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 16; - public readonly tag = LoroError_Tags.AutoCommitNotStarted; + readonly tag = LoroError_Tags.AutoCommitNotStarted; constructor(message: string) { super('LoroError', 'AutoCommitNotStarted', message); @@ -4220,7 +4128,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 17; - public readonly tag = LoroError_Tags.StyleConfigMissing; + readonly tag = LoroError_Tags.StyleConfigMissing; constructor(message: string) { super('LoroError', 'StyleConfigMissing', message); @@ -4242,7 +4150,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 18; - public readonly tag = LoroError_Tags.Unknown; + readonly tag = LoroError_Tags.Unknown; constructor(message: string) { super('LoroError', 'Unknown', message); @@ -4264,7 +4172,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 19; - public readonly tag = LoroError_Tags.FrontiersNotFound; + readonly tag = LoroError_Tags.FrontiersNotFound; constructor(message: string) { super('LoroError', 'FrontiersNotFound', message); @@ -4286,7 +4194,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 20; - public readonly tag = LoroError_Tags.ImportWhenInTxn; + readonly tag = LoroError_Tags.ImportWhenInTxn; constructor(message: string) { super('LoroError', 'ImportWhenInTxn', message); @@ -4308,7 +4216,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 21; - public readonly tag = LoroError_Tags.MisuseDetachedContainer; + readonly tag = LoroError_Tags.MisuseDetachedContainer; constructor(message: string) { super('LoroError', 'MisuseDetachedContainer', message); @@ -4330,7 +4238,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 22; - public readonly tag = LoroError_Tags.NotImplemented; + readonly tag = LoroError_Tags.NotImplemented; constructor(message: string) { super('LoroError', 'NotImplemented', message); @@ -4352,7 +4260,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 23; - public readonly tag = LoroError_Tags.ReattachAttachedContainer; + readonly tag = LoroError_Tags.ReattachAttachedContainer; constructor(message: string) { super('LoroError', 'ReattachAttachedContainer', message); @@ -4374,7 +4282,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 24; - public readonly tag = LoroError_Tags.EditWhenDetached; + readonly tag = LoroError_Tags.EditWhenDetached; constructor(message: string) { super('LoroError', 'EditWhenDetached', message); @@ -4396,7 +4304,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 25; - public readonly tag = LoroError_Tags.UndoInvalidIdSpan; + readonly tag = LoroError_Tags.UndoInvalidIdSpan; constructor(message: string) { super('LoroError', 'UndoInvalidIdSpan', message); @@ -4418,7 +4326,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 26; - public readonly tag = LoroError_Tags.UndoWithDifferentPeerId; + readonly tag = LoroError_Tags.UndoWithDifferentPeerId; constructor(message: string) { super('LoroError', 'UndoWithDifferentPeerId', message); @@ -4440,7 +4348,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 27; - public readonly tag = LoroError_Tags.InvalidJsonSchema; + readonly tag = LoroError_Tags.InvalidJsonSchema; constructor(message: string) { super('LoroError', 'InvalidJsonSchema', message); @@ -4462,7 +4370,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 28; - public readonly tag = LoroError_Tags.Utf8InUnicodeCodePoint; + readonly tag = LoroError_Tags.Utf8InUnicodeCodePoint; constructor(message: string) { super('LoroError', 'Utf8InUnicodeCodePoint', message); @@ -4484,7 +4392,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 29; - public readonly tag = LoroError_Tags.Utf16InUnicodeCodePoint; + readonly tag = LoroError_Tags.Utf16InUnicodeCodePoint; constructor(message: string) { super('LoroError', 'Utf16InUnicodeCodePoint', message); @@ -4506,7 +4414,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 30; - public readonly tag = LoroError_Tags.EndIndexLessThanStartIndex; + readonly tag = LoroError_Tags.EndIndexLessThanStartIndex; constructor(message: string) { super('LoroError', 'EndIndexLessThanStartIndex', message); @@ -4528,7 +4436,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 31; - public readonly tag = LoroError_Tags.InvalidRootContainerName; + readonly tag = LoroError_Tags.InvalidRootContainerName; constructor(message: string) { super('LoroError', 'InvalidRootContainerName', message); @@ -4550,8 +4458,7 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 32; - public readonly tag = - LoroError_Tags.ImportUpdatesThatDependsOnOutdatedVersion; + readonly tag = LoroError_Tags.ImportUpdatesThatDependsOnOutdatedVersion; constructor(message: string) { super('LoroError', 'ImportUpdatesThatDependsOnOutdatedVersion', message); @@ -4561,7 +4468,7 @@ export const LoroError = (() => { return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 32; } } - class SwitchToVersionBeforeShallowRoot extends UniffiError { + class ImportUnsupportedEncodingMode extends UniffiError { /** * @private * This field is private and should not be used. @@ -4573,14 +4480,36 @@ export const LoroError = (() => { */ readonly [variantOrdinalSymbol] = 33; - public readonly tag = LoroError_Tags.SwitchToVersionBeforeShallowRoot; + readonly tag = LoroError_Tags.ImportUnsupportedEncodingMode; + + constructor(message: string) { + super('LoroError', 'ImportUnsupportedEncodingMode', message); + } + + static instanceOf(e: any): e is ImportUnsupportedEncodingMode { + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 33; + } + } + class SwitchToVersionBeforeShallowRoot extends UniffiError { + /** + * @private + * This field is private and should not be used. + */ + readonly [uniffiTypeNameSymbol]: string = 'LoroError'; + /** + * @private + * This field is private and should not be used. + */ + readonly [variantOrdinalSymbol] = 34; + + readonly tag = LoroError_Tags.SwitchToVersionBeforeShallowRoot; constructor(message: string) { super('LoroError', 'SwitchToVersionBeforeShallowRoot', message); } static instanceOf(e: any): e is SwitchToVersionBeforeShallowRoot { - return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 33; + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 34; } } class ContainerDeleted extends UniffiError { @@ -4593,16 +4522,16 @@ export const LoroError = (() => { * @private * This field is private and should not be used. */ - readonly [variantOrdinalSymbol] = 34; + readonly [variantOrdinalSymbol] = 35; - public readonly tag = LoroError_Tags.ContainerDeleted; + readonly tag = LoroError_Tags.ContainerDeleted; constructor(message: string) { super('LoroError', 'ContainerDeleted', message); } static instanceOf(e: any): e is ContainerDeleted { - return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 34; + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 35; } } class ConcurrentOpsWithSamePeerId extends UniffiError { @@ -4615,16 +4544,16 @@ export const LoroError = (() => { * @private * This field is private and should not be used. */ - readonly [variantOrdinalSymbol] = 35; + readonly [variantOrdinalSymbol] = 36; - public readonly tag = LoroError_Tags.ConcurrentOpsWithSamePeerId; + readonly tag = LoroError_Tags.ConcurrentOpsWithSamePeerId; constructor(message: string) { super('LoroError', 'ConcurrentOpsWithSamePeerId', message); } static instanceOf(e: any): e is ConcurrentOpsWithSamePeerId { - return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 35; + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 36; } } class InvalidPeerId extends UniffiError { @@ -4637,16 +4566,16 @@ export const LoroError = (() => { * @private * This field is private and should not be used. */ - readonly [variantOrdinalSymbol] = 36; + readonly [variantOrdinalSymbol] = 37; - public readonly tag = LoroError_Tags.InvalidPeerId; + readonly tag = LoroError_Tags.InvalidPeerId; constructor(message: string) { super('LoroError', 'InvalidPeerId', message); } static instanceOf(e: any): e is InvalidPeerId { - return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 36; + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 37; } } class ContainersNotFound extends UniffiError { @@ -4659,16 +4588,16 @@ export const LoroError = (() => { * @private * This field is private and should not be used. */ - readonly [variantOrdinalSymbol] = 37; + readonly [variantOrdinalSymbol] = 38; - public readonly tag = LoroError_Tags.ContainersNotFound; + readonly tag = LoroError_Tags.ContainersNotFound; constructor(message: string) { super('LoroError', 'ContainersNotFound', message); } static instanceOf(e: any): e is ContainersNotFound { - return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 37; + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 38; } } class UndoGroupAlreadyStarted extends UniffiError { @@ -4681,16 +4610,16 @@ export const LoroError = (() => { * @private * This field is private and should not be used. */ - readonly [variantOrdinalSymbol] = 38; + readonly [variantOrdinalSymbol] = 39; - public readonly tag = LoroError_Tags.UndoGroupAlreadyStarted; + readonly tag = LoroError_Tags.UndoGroupAlreadyStarted; constructor(message: string) { super('LoroError', 'UndoGroupAlreadyStarted', message); } static instanceOf(e: any): e is UndoGroupAlreadyStarted { - return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 38; + return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 39; } } @@ -4731,6 +4660,7 @@ export const LoroError = (() => { EndIndexLessThanStartIndex, InvalidRootContainerName, ImportUpdatesThatDependsOnOutdatedVersion, + ImportUnsupportedEncodingMode, SwitchToVersionBeforeShallowRoot, ContainerDeleted, ConcurrentOpsWithSamePeerId, @@ -4880,27 +4810,32 @@ const FfiConverterTypeLoroError = (() => { ); case 33: - return new LoroError.SwitchToVersionBeforeShallowRoot( + return new LoroError.ImportUnsupportedEncodingMode( FfiConverterString.read(from) ); case 34: - return new LoroError.ContainerDeleted(FfiConverterString.read(from)); + return new LoroError.SwitchToVersionBeforeShallowRoot( + FfiConverterString.read(from) + ); case 35: + return new LoroError.ContainerDeleted(FfiConverterString.read(from)); + + case 36: return new LoroError.ConcurrentOpsWithSamePeerId( FfiConverterString.read(from) ); - case 36: + case 37: return new LoroError.InvalidPeerId(FfiConverterString.read(from)); - case 37: + case 38: return new LoroError.ContainersNotFound( FfiConverterString.read(from) ); - case 38: + case 39: return new LoroError.UndoGroupAlreadyStarted( FfiConverterString.read(from) ); @@ -5396,33 +5331,82 @@ const FfiConverterTypeOrdering = (() => { return new FFIConverter(); })(); -export enum Side { - Left, - Middle, - Right, +export enum PosType { + Bytes, + Unicode, + Utf16, + Event, + Entity, } -const FfiConverterTypeSide = (() => { +const FfiConverterTypePosType = (() => { const ordinalConverter = FfiConverterInt32; - type TypeName = Side; + type TypeName = PosType; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { switch (ordinalConverter.read(from)) { case 1: - return Side.Left; + return PosType.Bytes; case 2: - return Side.Middle; + return PosType.Unicode; case 3: - return Side.Right; + return PosType.Utf16; + case 4: + return PosType.Event; + case 5: + return PosType.Entity; default: throw new UniffiInternalError.UnexpectedEnumCase(); } } write(value: TypeName, into: RustBuffer): void { switch (value) { - case Side.Left: + case PosType.Bytes: return ordinalConverter.write(1, into); - case Side.Middle: + case PosType.Unicode: + return ordinalConverter.write(2, into); + case PosType.Utf16: + return ordinalConverter.write(3, into); + case PosType.Event: + return ordinalConverter.write(4, into); + case PosType.Entity: + return ordinalConverter.write(5, into); + } + } + allocationSize(value: TypeName): number { + return ordinalConverter.allocationSize(0); + } + } + return new FFIConverter(); +})(); + +export enum Side { + Left, + Middle, + Right, +} + +const FfiConverterTypeSide = (() => { + const ordinalConverter = FfiConverterInt32; + type TypeName = Side; + class FFIConverter extends AbstractFfiConverterByteArray { + read(from: RustBuffer): TypeName { + switch (ordinalConverter.read(from)) { + case 1: + return Side.Left; + case 2: + return Side.Middle; + case 3: + return Side.Right; + default: + throw new UniffiInternalError.UnexpectedEnumCase(); + } + } + write(value: TypeName, into: RustBuffer): void { + switch (value) { + case Side.Left: + return ordinalConverter.write(1, into); + case Side.Middle: return ordinalConverter.write(2, into); case Side.Right: return ordinalConverter.write(3, into); @@ -6148,7 +6132,7 @@ export const UpdateTimeoutError = (() => { */ readonly [variantOrdinalSymbol] = 1; - public readonly tag = UpdateTimeoutError_Tags.Timeout; + readonly tag = UpdateTimeoutError_Tags.Timeout; constructor(message: string) { super('UpdateTimeoutError', 'Timeout', message); @@ -6224,7 +6208,7 @@ const FfiConverterMapUInt64TypePeerInfo = new FfiConverterMap( /** * Deprecated, use `EphemeralStore` instead. */ -export interface AwarenessInterface { +export interface AwarenessLike { apply(encodedPeersInfo: ArrayBuffer): AwarenessPeerUpdate; encode(peers: Array): ArrayBuffer; encodeAll(): ArrayBuffer; @@ -6234,17 +6218,18 @@ export interface AwarenessInterface { removeOutdated(): Array; setLocalState(value: LoroValueLike): void; } +/** + * @deprecated Use `AwarenessLike` instead. + */ +export type AwarenessInterface = AwarenessLike; /** * Deprecated, use `EphemeralStore` instead. */ -export class Awareness - extends UniffiAbstractObject - implements AwarenessInterface -{ +export class Awareness extends UniffiAbstractObject implements AwarenessLike { readonly [uniffiTypeNameSymbol] = 'Awareness'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor(peer: /*u64*/ bigint, timeout: /*i64*/ bigint) { super(); const pointer = uniffiCaller.rustCall( @@ -6262,7 +6247,7 @@ export class Awareness uniffiTypeAwarenessObjectFactory.bless(pointer); } - public apply(encodedPeersInfo: ArrayBuffer): AwarenessPeerUpdate { + apply(encodedPeersInfo: ArrayBuffer): AwarenessPeerUpdate { return FfiConverterTypeAwarenessPeerUpdate.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6277,7 +6262,7 @@ export class Awareness ); } - public encode(peers: Array): ArrayBuffer { + encode(peers: Array): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6292,7 +6277,7 @@ export class Awareness ); } - public encodeAll(): ArrayBuffer { + encodeAll(): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6306,7 +6291,7 @@ export class Awareness ); } - public getAllStates(): Map { + getAllStates(): Map { return FfiConverterMapUInt64TypePeerInfo.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6320,7 +6305,7 @@ export class Awareness ); } - public getLocalState(): LoroValue | undefined { + getLocalState(): LoroValue | undefined { return FfiConverterOptionalTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6334,7 +6319,7 @@ export class Awareness ); } - public peer(): /*u64*/ bigint { + peer(): /*u64*/ bigint { return FfiConverterUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6348,7 +6333,7 @@ export class Awareness ); } - public removeOutdated(): Array { + removeOutdated(): Array { return FfiConverterArrayUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6362,7 +6347,7 @@ export class Awareness ); } - public setLocalState(value: LoroValueLike): void { + setLocalState(value: LoroValueLike): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_awareness_set_local_state( @@ -6393,68 +6378,71 @@ export class Awareness } } -const uniffiTypeAwarenessObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): AwarenessInterface { - const instance = Object.create(Awareness.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'Awareness'; - return instance; - }, +const uniffiTypeAwarenessObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): AwarenessLike { + const instance = Object.create(Awareness.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'Awareness'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_awareness_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_awareness_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: AwarenessInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: AwarenessLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: AwarenessInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_awareness( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: AwarenessLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_awareness( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_awareness( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_awareness( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is AwarenessInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'Awareness' - ); - }, - }; -// FfiConverter for AwarenessInterface + isConcreteType(obj: any): obj is AwarenessLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'Awareness' + ); + }, + }; + })(); +// FfiConverter for AwarenessLike const FfiConverterTypeAwareness = new FfiConverterObject( uniffiTypeAwarenessObjectFactory ); @@ -6468,17 +6456,17 @@ export class ChangeAncestorsTravelerImpl implements ChangeAncestorsTraveler { readonly [uniffiTypeNameSymbol] = 'ChangeAncestorsTravelerImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeChangeAncestorsTravelerImplObjectFactory.bless(pointer); } - public travel(change: ChangeMeta): boolean { + travel(change: ChangeMeta): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6517,67 +6505,69 @@ export class ChangeAncestorsTravelerImpl } const uniffiTypeChangeAncestorsTravelerImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): ChangeAncestorsTraveler { - const instance = Object.create(ChangeAncestorsTravelerImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'ChangeAncestorsTravelerImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): ChangeAncestorsTraveler { + const instance = Object.create(ChangeAncestorsTravelerImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'ChangeAncestorsTravelerImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_changeancestorstraveler_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_changeancestorstraveler_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: ChangeAncestorsTraveler): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: ChangeAncestorsTraveler): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: ChangeAncestorsTraveler): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_changeancestorstraveler( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: ChangeAncestorsTraveler): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_changeancestorstraveler( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_changeancestorstraveler( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_changeancestorstraveler( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is ChangeAncestorsTraveler { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'ChangeAncestorsTravelerImpl' - ); - }, - }; + isConcreteType(obj: any): obj is ChangeAncestorsTraveler { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'ChangeAncestorsTravelerImpl' + ); + }, + }; + })(); // FfiConverter for ChangeAncestorsTraveler const FfiConverterTypeChangeAncestorsTraveler = new FfiConverterObjectWithCallbacks( @@ -6619,6 +6609,9 @@ const uniffiCallbackInterfaceChangeAncestorsTraveler: { // ChangeAncestorsTraveler: this will throw a stale handle error if the handle isn't found. FfiConverterTypeChangeAncestorsTraveler.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeChangeAncestorsTraveler.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_changeancestorstraveler( @@ -6627,27 +6620,31 @@ const uniffiCallbackInterfaceChangeAncestorsTraveler: { }, }; -export interface ChangeModifierInterface { +export interface ChangeModifierLike { setMessage(msg: string): void; setTimestamp(timestamp: /*i64*/ bigint): void; } +/** + * @deprecated Use `ChangeModifierLike` instead. + */ +export type ChangeModifierInterface = ChangeModifierLike; export class ChangeModifier extends UniffiAbstractObject - implements ChangeModifierInterface + implements ChangeModifierLike { readonly [uniffiTypeNameSymbol] = 'ChangeModifier'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeChangeModifierObjectFactory.bless(pointer); } - public setMessage(msg: string): void { + setMessage(msg: string): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_changemodifier_set_message( @@ -6660,7 +6657,7 @@ export class ChangeModifier ); } - public setTimestamp(timestamp: /*i64*/ bigint): void { + setTimestamp(timestamp: /*i64*/ bigint): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_changemodifier_set_timestamp( @@ -6691,98 +6688,101 @@ export class ChangeModifier } } -const uniffiTypeChangeModifierObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): ChangeModifierInterface { - const instance = Object.create(ChangeModifier.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'ChangeModifier'; - return instance; - }, +const uniffiTypeChangeModifierObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): ChangeModifierLike { + const instance = Object.create(ChangeModifier.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'ChangeModifier'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_changemodifier_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_changemodifier_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: ChangeModifierInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: ChangeModifierLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: ChangeModifierInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_changemodifier( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: ChangeModifierLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_changemodifier( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_changemodifier( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_changemodifier( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is ChangeModifierInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'ChangeModifier' - ); - }, - }; -// FfiConverter for ChangeModifierInterface + isConcreteType(obj: any): obj is ChangeModifierLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'ChangeModifier' + ); + }, + }; + })(); +// FfiConverter for ChangeModifierLike const FfiConverterTypeChangeModifier = new FfiConverterObject( uniffiTypeChangeModifierObjectFactory ); -export interface ConfigureInterface { - fork(): ConfigureInterface; +export interface ConfigureLike { + fork(): ConfigureLike; mergeInterval(): /*i64*/ bigint; recordTimestamp(): boolean; setMergeInterval(interval: /*i64*/ bigint): void; setRecordTimestamp(record: boolean): void; - textStyleConfig(): StyleConfigMapInterface; + textStyleConfig(): StyleConfigMapLike; } +/** + * @deprecated Use `ConfigureLike` instead. + */ +export type ConfigureInterface = ConfigureLike; -export class Configure - extends UniffiAbstractObject - implements ConfigureInterface -{ +export class Configure extends UniffiAbstractObject implements ConfigureLike { readonly [uniffiTypeNameSymbol] = 'Configure'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeConfigureObjectFactory.bless(pointer); } - public fork(): ConfigureInterface { + fork(): ConfigureLike { return FfiConverterTypeConfigure.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6796,7 +6796,7 @@ export class Configure ); } - public mergeInterval(): /*i64*/ bigint { + mergeInterval(): /*i64*/ bigint { return FfiConverterInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6810,7 +6810,7 @@ export class Configure ); } - public recordTimestamp(): boolean { + recordTimestamp(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6824,7 +6824,7 @@ export class Configure ); } - public setMergeInterval(interval: /*i64*/ bigint): void { + setMergeInterval(interval: /*i64*/ bigint): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_configure_set_merge_interval( @@ -6837,7 +6837,7 @@ export class Configure ); } - public setRecordTimestamp(record: boolean): void { + setRecordTimestamp(record: boolean): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_configure_set_record_timestamp( @@ -6850,7 +6850,7 @@ export class Configure ); } - public textStyleConfig(): StyleConfigMapInterface { + textStyleConfig(): StyleConfigMapLike { return FfiConverterTypeStyleConfigMap.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -6882,68 +6882,71 @@ export class Configure } } -const uniffiTypeConfigureObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): ConfigureInterface { - const instance = Object.create(Configure.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'Configure'; - return instance; - }, +const uniffiTypeConfigureObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): ConfigureLike { + const instance = Object.create(Configure.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'Configure'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_configure_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_configure_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: ConfigureInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: ConfigureLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: ConfigureInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_configure( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: ConfigureLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_configure( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_configure( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_configure( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is ConfigureInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'Configure' - ); - }, - }; -// FfiConverter for ConfigureInterface + isConcreteType(obj: any): obj is ConfigureLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'Configure' + ); + }, + }; + })(); +// FfiConverter for ConfigureLike const FfiConverterTypeConfigure = new FfiConverterObject( uniffiTypeConfigureObjectFactory ); @@ -6957,17 +6960,17 @@ export class ContainerIdLikeImpl implements ContainerIdLike { readonly [uniffiTypeNameSymbol] = 'ContainerIdLikeImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeContainerIdLikeImplObjectFactory.bless(pointer); } - public asContainerId(ty: ContainerType): ContainerId { + asContainerId(ty: ContainerType): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7001,67 +7004,69 @@ export class ContainerIdLikeImpl } const uniffiTypeContainerIdLikeImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): ContainerIdLike { - const instance = Object.create(ContainerIdLikeImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'ContainerIdLikeImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): ContainerIdLike { + const instance = Object.create(ContainerIdLikeImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'ContainerIdLikeImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_containeridlike_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_containeridlike_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: ContainerIdLike): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: ContainerIdLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: ContainerIdLike): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_containeridlike( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: ContainerIdLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_containeridlike( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_containeridlike( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_containeridlike( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is ContainerIdLike { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'ContainerIdLikeImpl' - ); - }, - }; + isConcreteType(obj: any): obj is ContainerIdLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'ContainerIdLikeImpl' + ); + }, + }; + })(); // FfiConverter for ContainerIdLike const FfiConverterTypeContainerIdLike = new FfiConverterObjectWithCallbacks( uniffiTypeContainerIdLikeImplObjectFactory @@ -7104,6 +7109,9 @@ const uniffiCallbackInterfaceContainerIdLike: { // ContainerIdLike: this will throw a stale handle error if the handle isn't found. FfiConverterTypeContainerIdLike.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeContainerIdLike.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_containeridlike( @@ -7112,14 +7120,18 @@ const uniffiCallbackInterfaceContainerIdLike: { }, }; -export interface CursorInterface { +export interface CursorLike { encode(): ArrayBuffer; } +/** + * @deprecated Use `CursorLike` instead. + */ +export type CursorInterface = CursorLike; -export class Cursor extends UniffiAbstractObject implements CursorInterface { +export class Cursor extends UniffiAbstractObject implements CursorLike { readonly [uniffiTypeNameSymbol] = 'Cursor'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor( id: Id | undefined, container: ContainerId, @@ -7143,7 +7155,7 @@ export class Cursor extends UniffiAbstractObject implements CursorInterface { this[destructorGuardSymbol] = uniffiTypeCursorObjectFactory.bless(pointer); } - public static decode(data: ArrayBuffer): CursorInterface /*throws*/ { + static decode(data: ArrayBuffer): CursorLike /*throws*/ { return FfiConverterTypeCursor.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -7160,7 +7172,7 @@ export class Cursor extends UniffiAbstractObject implements CursorInterface { ); } - public encode(): ArrayBuffer { + encode(): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7192,67 +7204,74 @@ export class Cursor extends UniffiAbstractObject implements CursorInterface { } } -const uniffiTypeCursorObjectFactory: UniffiObjectFactory = { - create(pointer: UnsafeMutableRawPointer): CursorInterface { - const instance = Object.create(Cursor.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'Cursor'; - return instance; - }, +const uniffiTypeCursorObjectFactory: UniffiObjectFactory = (() => { + return { + create(pointer: UniffiHandle): CursorLike { + const instance = Object.create(Cursor.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'Cursor'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_cursor_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_cursor_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: CursorInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: CursorLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: CursorInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_cursor( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: CursorLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_cursor( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_cursor(pointer, callStatus), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_cursor( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is CursorInterface { - return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'Cursor'; - }, -}; -// FfiConverter for CursorInterface + isConcreteType(obj: any): obj is CursorLike { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'Cursor' + ); + }, + }; +})(); +// FfiConverter for CursorLike const FfiConverterTypeCursor = new FfiConverterObject( uniffiTypeCursorObjectFactory ); -export interface DiffBatchInterface { +export interface DiffBatchLike { /** * Returns an iterator over the diffs in this batch, in the order they were added. * @@ -7270,14 +7289,15 @@ export interface DiffBatchInterface { */ push(cid: ContainerId, diff: Diff): Diff | undefined; } +/** + * @deprecated Use `DiffBatchLike` instead. + */ +export type DiffBatchInterface = DiffBatchLike; -export class DiffBatch - extends UniffiAbstractObject - implements DiffBatchInterface -{ +export class DiffBatch extends UniffiAbstractObject implements DiffBatchLike { readonly [uniffiTypeNameSymbol] = 'DiffBatch'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor() { super(); const pointer = uniffiCaller.rustCall( @@ -7302,7 +7322,7 @@ export class DiffBatch * * The order of the diffs is preserved from when they were originally added to the batch. */ - public getDiff(): Array { + getDiff(): Array { return FfiConverterArrayTypeContainerIDAndDiff.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7321,7 +7341,7 @@ export class DiffBatch * * If the cid already exists in the batch, return Err */ - public push(cid: ContainerId, diff: Diff): Diff | undefined { + push(cid: ContainerId, diff: Diff): Diff | undefined { return FfiConverterOptionalTypeDiff.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7355,73 +7375,76 @@ export class DiffBatch } } -const uniffiTypeDiffBatchObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): DiffBatchInterface { - const instance = Object.create(DiffBatch.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'DiffBatch'; - return instance; - }, +const uniffiTypeDiffBatchObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): DiffBatchLike { + const instance = Object.create(DiffBatch.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'DiffBatch'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_diffbatch_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_diffbatch_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: DiffBatchInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: DiffBatchLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: DiffBatchInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_diffbatch( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: DiffBatchLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_diffbatch( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_diffbatch( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_diffbatch( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is DiffBatchInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'DiffBatch' - ); - }, - }; -// FfiConverter for DiffBatchInterface + isConcreteType(obj: any): obj is DiffBatchLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'DiffBatch' + ); + }, + }; + })(); +// FfiConverter for DiffBatchLike const FfiConverterTypeDiffBatch = new FfiConverterObject( uniffiTypeDiffBatchObjectFactory ); -export interface EphemeralStoreInterface { +export interface EphemeralStoreLike { apply(data: ArrayBuffer) /*throws*/ : void; delete_(key: string): void; encode(key: string): ArrayBuffer; @@ -7431,17 +7454,21 @@ export interface EphemeralStoreInterface { keys(): Array; removeOutdated(): void; set(key: string, value: LoroValueLike): void; - subscribe(listener: EphemeralSubscriber): SubscriptionInterface; - subscribeLocalUpdate(listener: LocalEphemeralListener): SubscriptionInterface; + subscribe(listener: EphemeralSubscriber): SubscriptionLike; + subscribeLocalUpdate(listener: LocalEphemeralListener): SubscriptionLike; } +/** + * @deprecated Use `EphemeralStoreLike` instead. + */ +export type EphemeralStoreInterface = EphemeralStoreLike; export class EphemeralStore extends UniffiAbstractObject - implements EphemeralStoreInterface + implements EphemeralStoreLike { readonly [uniffiTypeNameSymbol] = 'EphemeralStore'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor(timeout: /*i64*/ bigint) { super(); const pointer = uniffiCaller.rustCall( @@ -7458,7 +7485,7 @@ export class EphemeralStore uniffiTypeEphemeralStoreObjectFactory.bless(pointer); } - public apply(data: ArrayBuffer): void /*throws*/ { + apply(data: ArrayBuffer): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -7474,7 +7501,7 @@ export class EphemeralStore ); } - public delete_(key: string): void { + delete_(key: string): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_ephemeralstore_delete( @@ -7487,7 +7514,7 @@ export class EphemeralStore ); } - public encode(key: string): ArrayBuffer { + encode(key: string): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7502,7 +7529,7 @@ export class EphemeralStore ); } - public encodeAll(): ArrayBuffer { + encodeAll(): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7516,7 +7543,7 @@ export class EphemeralStore ); } - public get(key: string): LoroValue | undefined { + get(key: string): LoroValue | undefined { return FfiConverterOptionalTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7531,7 +7558,7 @@ export class EphemeralStore ); } - public getAllStates(): Map { + getAllStates(): Map { return FfiConverterMapStringTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7545,7 +7572,7 @@ export class EphemeralStore ); } - public keys(): Array { + keys(): Array { return FfiConverterArrayString.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7559,7 +7586,7 @@ export class EphemeralStore ); } - public removeOutdated(): void { + removeOutdated(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_ephemeralstore_remove_outdated( @@ -7571,7 +7598,7 @@ export class EphemeralStore ); } - public set(key: string, value: LoroValueLike): void { + set(key: string, value: LoroValueLike): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_ephemeralstore_set( @@ -7585,7 +7612,7 @@ export class EphemeralStore ); } - public subscribe(listener: EphemeralSubscriber): SubscriptionInterface { + subscribe(listener: EphemeralSubscriber): SubscriptionLike { return FfiConverterTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7600,9 +7627,7 @@ export class EphemeralStore ); } - public subscribeLocalUpdate( - listener: LocalEphemeralListener - ): SubscriptionInterface { + subscribeLocalUpdate(listener: LocalEphemeralListener): SubscriptionLike { return FfiConverterTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -7635,69 +7660,71 @@ export class EphemeralStore } } -const uniffiTypeEphemeralStoreObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): EphemeralStoreInterface { - const instance = Object.create(EphemeralStore.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'EphemeralStore'; - return instance; - }, +const uniffiTypeEphemeralStoreObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): EphemeralStoreLike { + const instance = Object.create(EphemeralStore.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'EphemeralStore'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_ephemeralstore_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_ephemeralstore_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: EphemeralStoreInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: EphemeralStoreLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: EphemeralStoreInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_ephemeralstore( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: EphemeralStoreLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_ephemeralstore( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_ephemeralstore( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_ephemeralstore( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is EphemeralStoreInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'EphemeralStore' - ); - }, - }; -// FfiConverter for EphemeralStoreInterface + isConcreteType(obj: any): obj is EphemeralStoreLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'EphemeralStore' + ); + }, + }; + })(); +// FfiConverter for EphemeralStoreLike const FfiConverterTypeEphemeralStore = new FfiConverterObject( uniffiTypeEphemeralStoreObjectFactory ); @@ -7711,17 +7738,17 @@ export class EphemeralSubscriberImpl implements EphemeralSubscriber { readonly [uniffiTypeNameSymbol] = 'EphemeralSubscriberImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeEphemeralSubscriberImplObjectFactory.bless(pointer); } - public onEphemeralEvent(event: EphemeralStoreEvent): void { + onEphemeralEvent(event: EphemeralStoreEvent): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_ephemeralsubscriber_on_ephemeral_event( @@ -7754,67 +7781,69 @@ export class EphemeralSubscriberImpl } const uniffiTypeEphemeralSubscriberImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): EphemeralSubscriber { - const instance = Object.create(EphemeralSubscriberImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'EphemeralSubscriberImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): EphemeralSubscriber { + const instance = Object.create(EphemeralSubscriberImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'EphemeralSubscriberImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_ephemeralsubscriber_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_ephemeralsubscriber_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: EphemeralSubscriber): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: EphemeralSubscriber): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: EphemeralSubscriber): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_ephemeralsubscriber( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: EphemeralSubscriber): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_ephemeralsubscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_ephemeralsubscriber( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_ephemeralsubscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is EphemeralSubscriber { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'EphemeralSubscriberImpl' - ); - }, - }; + isConcreteType(obj: any): obj is EphemeralSubscriber { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'EphemeralSubscriberImpl' + ); + }, + }; + })(); // FfiConverter for EphemeralSubscriber const FfiConverterTypeEphemeralSubscriber = new FfiConverterObjectWithCallbacks( uniffiTypeEphemeralSubscriberImplObjectFactory @@ -7855,6 +7884,9 @@ const uniffiCallbackInterfaceEphemeralSubscriber: { // EphemeralSubscriber: this will throw a stale handle error if the handle isn't found. FfiConverterTypeEphemeralSubscriber.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeEphemeralSubscriber.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_ephemeralsubscriber( @@ -7872,17 +7904,17 @@ export class FirstCommitFromPeerCallbackImpl implements FirstCommitFromPeerCallback { readonly [uniffiTypeNameSymbol] = 'FirstCommitFromPeerCallbackImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeFirstCommitFromPeerCallbackImplObjectFactory.bless(pointer); } - public onFirstCommitFromPeer(payload: FirstCommitFromPeerPayload): void { + onFirstCommitFromPeer(payload: FirstCommitFromPeerPayload): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_firstcommitfrompeercallback_on_first_commit_from_peer( @@ -7921,67 +7953,71 @@ export class FirstCommitFromPeerCallbackImpl } const uniffiTypeFirstCommitFromPeerCallbackImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): FirstCommitFromPeerCallback { - const instance = Object.create(FirstCommitFromPeerCallbackImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'FirstCommitFromPeerCallbackImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): FirstCommitFromPeerCallback { + const instance = Object.create( + FirstCommitFromPeerCallbackImpl.prototype + ); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'FirstCommitFromPeerCallbackImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_firstcommitfrompeercallback_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_firstcommitfrompeercallback_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: FirstCommitFromPeerCallback): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: FirstCommitFromPeerCallback): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: FirstCommitFromPeerCallback): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_firstcommitfrompeercallback( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: FirstCommitFromPeerCallback): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_firstcommitfrompeercallback( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_firstcommitfrompeercallback( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_firstcommitfrompeercallback( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is FirstCommitFromPeerCallback { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'FirstCommitFromPeerCallbackImpl' - ); - }, - }; + isConcreteType(obj: any): obj is FirstCommitFromPeerCallback { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'FirstCommitFromPeerCallbackImpl' + ); + }, + }; + })(); // FfiConverter for FirstCommitFromPeerCallback const FfiConverterTypeFirstCommitFromPeerCallback = new FfiConverterObjectWithCallbacks( @@ -8023,6 +8059,9 @@ const uniffiCallbackInterfaceFirstCommitFromPeerCallback: { // FirstCommitFromPeerCallback: this will throw a stale handle error if the handle isn't found. FfiConverterTypeFirstCommitFromPeerCallback.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeFirstCommitFromPeerCallback.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_firstcommitfrompeercallback( @@ -8031,26 +8070,28 @@ const uniffiCallbackInterfaceFirstCommitFromPeerCallback: { }, }; -export interface FractionalIndexInterface { - toString(): string; -} +export interface FractionalIndexLike {} +/** + * @deprecated Use `FractionalIndexLike` instead. + */ +export type FractionalIndexInterface = FractionalIndexLike; export class FractionalIndex extends UniffiAbstractObject - implements FractionalIndexInterface + implements FractionalIndexLike { readonly [uniffiTypeNameSymbol] = 'FractionalIndex'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeFractionalIndexObjectFactory.bless(pointer); } - public static fromBytes(bytes: ArrayBuffer): FractionalIndexInterface { + static fromBytes(bytes: ArrayBuffer): FractionalIndexLike { return FfiConverterTypeFractionalIndex.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8064,7 +8105,7 @@ export class FractionalIndex ); } - public static fromHexString(str: string): FractionalIndexInterface { + static fromHexString(str: string): FractionalIndexLike { return FfiConverterTypeFractionalIndex.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8078,11 +8119,16 @@ export class FractionalIndex ); } - public toString(): string { + /** + * Calls into the `FractionalIndexLike::to_string()` method of the native Rust peer. + * + * Generated by deriving the `Display` trait in Rust. + */ + toString(): string { return FfiConverterString.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { - return nativeModule().ubrn_uniffi_loro_ffi_fn_method_fractionalindex_to_string( + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_fractionalindex_uniffi_trait_display( uniffiTypeFractionalIndexObjectFactory.clonePointer(this), callStatus ); @@ -8110,87 +8156,90 @@ export class FractionalIndex } } -const uniffiTypeFractionalIndexObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): FractionalIndexInterface { - const instance = Object.create(FractionalIndex.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'FractionalIndex'; - return instance; - }, +const uniffiTypeFractionalIndexObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): FractionalIndexLike { + const instance = Object.create(FractionalIndex.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'FractionalIndex'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_fractionalindex_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_fractionalindex_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: FractionalIndexInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: FractionalIndexLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: FractionalIndexInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_fractionalindex( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: FractionalIndexLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_fractionalindex( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_fractionalindex( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_fractionalindex( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is FractionalIndexInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'FractionalIndex' - ); - }, - }; -// FfiConverter for FractionalIndexInterface + isConcreteType(obj: any): obj is FractionalIndexLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'FractionalIndex' + ); + }, + }; + })(); +// FfiConverter for FractionalIndexLike const FfiConverterTypeFractionalIndex = new FfiConverterObject( uniffiTypeFractionalIndexObjectFactory ); -export interface FrontiersInterface { +export interface FrontiersLike { encode(): ArrayBuffer; - eq(other: FrontiersInterface): boolean; + eq(other: FrontiersLike): boolean; isEmpty(): boolean; toVec(): Array; } +/** + * @deprecated Use `FrontiersLike` instead. + */ +export type FrontiersInterface = FrontiersLike; -export class Frontiers - extends UniffiAbstractObject - implements FrontiersInterface -{ +export class Frontiers extends UniffiAbstractObject implements FrontiersLike { readonly [uniffiTypeNameSymbol] = 'Frontiers'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor() { super(); const pointer = uniffiCaller.rustCall( @@ -8206,7 +8255,7 @@ export class Frontiers uniffiTypeFrontiersObjectFactory.bless(pointer); } - public static decode(bytes: ArrayBuffer): FrontiersInterface /*throws*/ { + static decode(bytes: ArrayBuffer): FrontiersLike /*throws*/ { return FfiConverterTypeFrontiers.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -8223,7 +8272,7 @@ export class Frontiers ); } - public static fromId(id: Id): FrontiersInterface { + static fromId(id: Id): FrontiersLike { return FfiConverterTypeFrontiers.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8237,7 +8286,7 @@ export class Frontiers ); } - public static fromIds(ids: Array): FrontiersInterface { + static fromIds(ids: Array): FrontiersLike { return FfiConverterTypeFrontiers.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8251,7 +8300,7 @@ export class Frontiers ); } - public encode(): ArrayBuffer { + encode(): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8265,7 +8314,7 @@ export class Frontiers ); } - public eq(other: FrontiersInterface): boolean { + eq(other: FrontiersLike): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8280,7 +8329,7 @@ export class Frontiers ); } - public isEmpty(): boolean { + isEmpty(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8294,7 +8343,7 @@ export class Frontiers ); } - public toVec(): Array { + toVec(): Array { return FfiConverterArrayTypeID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8326,72 +8375,244 @@ export class Frontiers } } -const uniffiTypeFrontiersObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): FrontiersInterface { - const instance = Object.create(Frontiers.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'Frontiers'; - return instance; - }, +const uniffiTypeFrontiersObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): FrontiersLike { + const instance = Object.create(Frontiers.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'Frontiers'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_frontiers_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_frontiers_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: FrontiersInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: FrontiersLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: FrontiersInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_frontiers( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: FrontiersLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_frontiers( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_frontiers( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_frontiers( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is FrontiersInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'Frontiers' - ); - }, - }; -// FfiConverter for FrontiersInterface + isConcreteType(obj: any): obj is FrontiersLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'Frontiers' + ); + }, + }; + })(); +// FfiConverter for FrontiersLike const FfiConverterTypeFrontiers = new FfiConverterObject( uniffiTypeFrontiersObjectFactory ); +export interface JsonPathSubscriber { + /** + * Called when a change may affect the subscribed JSONPath query. + */ + onJsonpathChanged(): void; +} + +export class JsonPathSubscriberImpl + extends UniffiAbstractObject + implements JsonPathSubscriber +{ + readonly [uniffiTypeNameSymbol] = 'JsonPathSubscriberImpl'; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; + // No primary constructor declared for this class. + private constructor(pointer: UniffiHandle) { + super(); + this[pointerLiteralSymbol] = pointer; + this[destructorGuardSymbol] = + uniffiTypeJsonPathSubscriberImplObjectFactory.bless(pointer); + } + + /** + * Called when a change may affect the subscribed JSONPath query. + */ + onJsonpathChanged(): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_jsonpathsubscriber_on_jsonpath_changed( + uniffiTypeJsonPathSubscriberImplObjectFactory.clonePointer(this), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + + /** + * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} + */ + uniffiDestroy(): void { + const ptr = (this as any)[destructorGuardSymbol]; + if (ptr !== undefined) { + const pointer = + uniffiTypeJsonPathSubscriberImplObjectFactory.pointer(this); + uniffiTypeJsonPathSubscriberImplObjectFactory.freePointer(pointer); + uniffiTypeJsonPathSubscriberImplObjectFactory.unbless(ptr); + delete (this as any)[destructorGuardSymbol]; + } + } + + static instanceOf(obj: any): obj is JsonPathSubscriberImpl { + return uniffiTypeJsonPathSubscriberImplObjectFactory.isConcreteType(obj); + } +} + +const uniffiTypeJsonPathSubscriberImplObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): JsonPathSubscriber { + const instance = Object.create(JsonPathSubscriberImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'JsonPathSubscriberImpl'; + return instance; + }, + + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_jsonpathsubscriber_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, + + pointer(obj: JsonPathSubscriber): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, + + clonePointer(obj: JsonPathSubscriber): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_jsonpathsubscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_jsonpathsubscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + isConcreteType(obj: any): obj is JsonPathSubscriber { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'JsonPathSubscriberImpl' + ); + }, + }; + })(); +// FfiConverter for JsonPathSubscriber +const FfiConverterTypeJsonPathSubscriber = new FfiConverterObjectWithCallbacks( + uniffiTypeJsonPathSubscriberImplObjectFactory +); + +// Add a vtavble for the callbacks that go in JsonPathSubscriber. + +// Put the implementation in a struct so we don't pollute the top-level namespace +const uniffiCallbackInterfaceJsonPathSubscriber: { + vtable: UniffiVTableCallbackInterfaceJsonPathSubscriber; + register: () => void; +} = { + // Create the VTable using a series of closures. + // ts automatically converts these into C callback functions. + vtable: { + onJsonpathChanged: (uniffiHandle: bigint) => { + const uniffiMakeCall = (): void => { + const jsCallback = + FfiConverterTypeJsonPathSubscriber.lift(uniffiHandle); + return jsCallback.onJsonpathChanged(); + }; + const uniffiResult = UniffiResult.ready(); + const uniffiHandleSuccess = (obj: any) => {}; + const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { + UniffiResult.writeError(uniffiResult, code, errBuf); + }; + uniffiTraitInterfaceCall( + /*makeCall:*/ uniffiMakeCall, + /*handleSuccess:*/ uniffiHandleSuccess, + /*handleError:*/ uniffiHandleError, + /*lowerString:*/ FfiConverterString.lower + ); + return uniffiResult; + }, + uniffiFree: (uniffiHandle: UniffiHandle): void => { + // JsonPathSubscriber: this will throw a stale handle error if the handle isn't found. + FfiConverterTypeJsonPathSubscriber.drop(uniffiHandle); + }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeJsonPathSubscriber.clone(uniffiHandle); + }, + }, + register: () => { + nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_jsonpathsubscriber( + uniffiCallbackInterfaceJsonPathSubscriber.vtable + ); + }, +}; + export interface LocalEphemeralListener { onEphemeralUpdate(update: ArrayBuffer): void; } @@ -8401,17 +8622,17 @@ export class LocalEphemeralListenerImpl implements LocalEphemeralListener { readonly [uniffiTypeNameSymbol] = 'LocalEphemeralListenerImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeLocalEphemeralListenerImplObjectFactory.bless(pointer); } - public onEphemeralUpdate(update: ArrayBuffer): void { + onEphemeralUpdate(update: ArrayBuffer): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_localephemerallistener_on_ephemeral_update( @@ -8446,67 +8667,69 @@ export class LocalEphemeralListenerImpl } const uniffiTypeLocalEphemeralListenerImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LocalEphemeralListener { - const instance = Object.create(LocalEphemeralListenerImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LocalEphemeralListenerImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): LocalEphemeralListener { + const instance = Object.create(LocalEphemeralListenerImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LocalEphemeralListenerImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_localephemerallistener_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_localephemerallistener_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LocalEphemeralListener): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LocalEphemeralListener): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LocalEphemeralListener): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_localephemerallistener( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LocalEphemeralListener): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_localephemerallistener( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_localephemerallistener( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_localephemerallistener( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LocalEphemeralListener { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'LocalEphemeralListenerImpl' - ); - }, - }; + isConcreteType(obj: any): obj is LocalEphemeralListener { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'LocalEphemeralListenerImpl' + ); + }, + }; + })(); // FfiConverter for LocalEphemeralListener const FfiConverterTypeLocalEphemeralListener = new FfiConverterObjectWithCallbacks( @@ -8548,6 +8771,9 @@ const uniffiCallbackInterfaceLocalEphemeralListener: { // LocalEphemeralListener: this will throw a stale handle error if the handle isn't found. FfiConverterTypeLocalEphemeralListener.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeLocalEphemeralListener.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_localephemerallistener( @@ -8565,17 +8791,17 @@ export class LocalUpdateCallbackImpl implements LocalUpdateCallback { readonly [uniffiTypeNameSymbol] = 'LocalUpdateCallbackImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeLocalUpdateCallbackImplObjectFactory.bless(pointer); } - public onLocalUpdate(update: ArrayBuffer): void { + onLocalUpdate(update: ArrayBuffer): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_localupdatecallback_on_local_update( @@ -8608,67 +8834,69 @@ export class LocalUpdateCallbackImpl } const uniffiTypeLocalUpdateCallbackImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LocalUpdateCallback { - const instance = Object.create(LocalUpdateCallbackImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LocalUpdateCallbackImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): LocalUpdateCallback { + const instance = Object.create(LocalUpdateCallbackImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LocalUpdateCallbackImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_localupdatecallback_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_localupdatecallback_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LocalUpdateCallback): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LocalUpdateCallback): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LocalUpdateCallback): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_localupdatecallback( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LocalUpdateCallback): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_localupdatecallback( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_localupdatecallback( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_localupdatecallback( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LocalUpdateCallback { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'LocalUpdateCallbackImpl' - ); - }, - }; + isConcreteType(obj: any): obj is LocalUpdateCallback { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'LocalUpdateCallbackImpl' + ); + }, + }; + })(); // FfiConverter for LocalUpdateCallback const FfiConverterTypeLocalUpdateCallback = new FfiConverterObjectWithCallbacks( uniffiTypeLocalUpdateCallbackImplObjectFactory @@ -8707,6 +8935,9 @@ const uniffiCallbackInterfaceLocalUpdateCallback: { // LocalUpdateCallback: this will throw a stale handle error if the handle isn't found. FfiConverterTypeLocalUpdateCallback.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeLocalUpdateCallback.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_localupdatecallback( @@ -8715,7 +8946,7 @@ const uniffiCallbackInterfaceLocalUpdateCallback: { }, }; -export interface LoroCounterInterface { +export interface LoroCounterLike { /** * Decrement the counter by the given value. */ @@ -8723,11 +8954,11 @@ export interface LoroCounterInterface { /** * Get the LoroDoc from this container */ - doc(): LoroDocInterface | undefined; + doc(): LoroDocLike | undefined; /** * If a detached container is attached, this method will return its corresponding attached handler. */ - getAttached(): LoroCounterInterface | undefined; + getAttached(): LoroCounterLike | undefined; /** * Get the current value of the counter. */ @@ -8764,16 +8995,20 @@ export interface LoroCounterInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe(subscriber: Subscriber): SubscriptionInterface | undefined; + subscribe(subscriber: Subscriber): SubscriptionLike | undefined; } +/** + * @deprecated Use `LoroCounterLike` instead. + */ +export type LoroCounterInterface = LoroCounterLike; export class LoroCounter extends UniffiAbstractObject - implements LoroCounterInterface + implements LoroCounterLike { readonly [uniffiTypeNameSymbol] = 'LoroCounter'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new Counter. */ @@ -8795,7 +9030,7 @@ export class LoroCounter /** * Decrement the counter by the given value. */ - public decrement(value: /*f64*/ number): void /*throws*/ { + decrement(value: /*f64*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -8814,7 +9049,7 @@ export class LoroCounter /** * Get the LoroDoc from this container */ - public doc(): LoroDocInterface | undefined { + doc(): LoroDocLike | undefined { return FfiConverterOptionalTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8831,7 +9066,7 @@ export class LoroCounter /** * If a detached container is attached, this method will return its corresponding attached handler. */ - public getAttached(): LoroCounterInterface | undefined { + getAttached(): LoroCounterLike | undefined { return FfiConverterOptionalTypeLoroCounter.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8848,7 +9083,7 @@ export class LoroCounter /** * Get the current value of the counter. */ - public getValue(): /*f64*/ number { + getValue(): /*f64*/ number { return FfiConverterFloat64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8865,7 +9100,7 @@ export class LoroCounter /** * Return container id of the Counter. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8882,7 +9117,7 @@ export class LoroCounter /** * Increment the counter by the given value. */ - public increment(value: /*f64*/ number): void /*throws*/ { + increment(value: /*f64*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -8904,7 +9139,7 @@ export class LoroCounter * The edits on a detached container will not be persisted. * To attach the container to the document, please insert it into an attached container. */ - public isAttached(): boolean { + isAttached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8921,7 +9156,7 @@ export class LoroCounter /** * Whether the container is deleted. */ - public isDeleted(): boolean { + isDeleted(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8948,7 +9183,7 @@ export class LoroCounter * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe(subscriber: Subscriber): SubscriptionInterface | undefined { + subscribe(subscriber: Subscriber): SubscriptionLike | undefined { return FfiConverterOptionalTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -8981,69 +9216,71 @@ export class LoroCounter } } -const uniffiTypeLoroCounterObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroCounterInterface { - const instance = Object.create(LoroCounter.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroCounter'; - return instance; - }, - - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorocounter_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, - - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, +const uniffiTypeLoroCounterObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroCounterLike { + const instance = Object.create(LoroCounter.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroCounter'; + return instance; + }, - pointer(obj: LoroCounterInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorocounter_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - clonePointer(obj: LoroCounterInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorocounter( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorocounter( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + pointer(obj: LoroCounterLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - isConcreteType(obj: any): obj is LoroCounterInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'LoroCounter' - ); - }, - }; -// FfiConverter for LoroCounterInterface + clonePointer(obj: LoroCounterLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorocounter( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorocounter( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + isConcreteType(obj: any): obj is LoroCounterLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'LoroCounter' + ); + }, + }; + })(); +// FfiConverter for LoroCounterLike const FfiConverterTypeLoroCounter = new FfiConverterObject( uniffiTypeLoroCounterObjectFactory ); @@ -9056,13 +9293,13 @@ const FfiConverterTypeLoroCounter = new FfiConverterObject( * It is the responsibility of the user to manage the storage, loading, and synchronization * of the bytes exported by Loro in a manner suitable for their specific environment. */ -export interface LoroDocInterface { +export interface LoroDocLike { /** * Apply a diff to the current document state. * * Internally, it will apply the diff to the current state. */ - applyDiff(diff: DiffBatchInterface) /*throws*/ : void; + applyDiff(diff: DiffBatchLike) /*throws*/ : void; /** * Attach the document state to the latest known version. * @@ -9087,7 +9324,7 @@ export interface LoroDocInterface { * * You should call `attach` to attach the `DocState` to the latest version of `OpLog`. */ - checkout(frontiers: FrontiersInterface) /*throws*/ : void; + checkout(frontiers: FrontiersLike) /*throws*/ : void; /** * Checkout the `DocState` to the latest version. * @@ -9108,7 +9345,7 @@ export interface LoroDocInterface { * * If `other` contains any version that's not contained in the current OpLog, return [Ordering::Less]. */ - cmpWithFrontiers(other: FrontiersInterface): Ordering; + cmpWithFrontiers(other: FrontiersLike): Ordering; /** * Commit the cumulative auto commit transaction. * @@ -9131,7 +9368,7 @@ export interface LoroDocInterface { /** * Get the configurations of the document. */ - config(): ConfigureInterface; + config(): ConfigureLike; /** * Configures the default text style for the document. * @@ -9152,7 +9389,7 @@ export interface LoroDocInterface { * Expand is used to specify the behavior of expanding when new text is inserted at the * beginning or end of the style. */ - configTextStyle(textStyle: StyleConfigMapInterface): void; + configTextStyle(textStyle: StyleConfigMapLike): void; /** * Delete all content from a root container and hide it from the document. * @@ -9174,10 +9411,11 @@ export interface LoroDocInterface { /** * Calculate the diff between two versions */ - diff( - a: FrontiersInterface, - b: FrontiersInterface - ) /*throws*/ : DiffBatchInterface; + diff(a: FrontiersLike, b: FrontiersLike) /*throws*/ : DiffBatchLike; + /** + * Export the document in the given mode. + */ + export_(mode: ExportMode) /*throws*/ : ArrayBuffer; /** * Exports changes within the specified ID span to JSON schema format. * @@ -9193,8 +9431,8 @@ export interface LoroDocInterface { * Export the current state with json-string format of the document. */ exportJsonUpdates( - startVv: VersionVectorInterface, - endVv: VersionVectorInterface + startVv: VersionVectorLike, + endVv: VersionVectorLike ): string; /** * Export the current state with json-string format of the document, without peer compression. @@ -9203,30 +9441,27 @@ export interface LoroDocInterface { * So the operations are easier to be processed by application code. */ exportJsonUpdatesWithoutPeerCompression( - startVv: VersionVectorInterface, - endVv: VersionVectorInterface + startVv: VersionVectorLike, + endVv: VersionVectorLike ): string; - exportShallowSnapshot(frontiers: FrontiersInterface) /*throws*/ : ArrayBuffer; + exportShallowSnapshot(frontiers: FrontiersLike) /*throws*/ : ArrayBuffer; /** * Export the current state and history of the document. */ exportSnapshot() /*throws*/ : ArrayBuffer; - exportSnapshotAt(frontiers: FrontiersInterface) /*throws*/ : ArrayBuffer; + exportSnapshotAt(frontiers: FrontiersLike) /*throws*/ : ArrayBuffer; exportStateOnly( - frontiers: FrontiersInterface | undefined + frontiers: FrontiersLike | undefined ) /*throws*/ : ArrayBuffer; /** * Export all the ops not included in the given `VersionVector` */ - exportUpdates(vv: VersionVectorInterface) /*throws*/ : ArrayBuffer; + exportUpdates(vv: VersionVectorLike) /*throws*/ : ArrayBuffer; exportUpdatesInRange(spans: Array) /*throws*/ : ArrayBuffer; /** * Find the operation id spans that between the `from` version and the `to` version. */ - findIdSpansBetween( - from: FrontiersInterface, - to: FrontiersInterface - ): VersionVectorDiff; + findIdSpansBetween(from: FrontiersLike, to: FrontiersLike): VersionVectorDiff; /** * Duplicate the document with a different PeerID * @@ -9235,13 +9470,13 @@ export interface LoroDocInterface { * When called in detached mode, it will fork at the current state frontiers. * It will have the same effect as `fork_at(&self.state_frontiers())`. */ - fork(): LoroDocInterface; + fork(): LoroDocLike; /** * Fork the document at the given frontiers. * * The created doc will only contain the history before the specified frontiers. */ - forkAt(frontiers: FrontiersInterface): LoroDocInterface; + forkAt(frontiers: FrontiersLike) /*throws*/ : LoroDocLike; /** * Free the cached diff calculator that is used for checkout. */ @@ -9256,13 +9491,11 @@ export interface LoroDocInterface { /** * Convert `Frontiers` into `VersionVector` */ - frontiersToVv( - frontiers: FrontiersInterface - ): VersionVectorInterface | undefined; + frontiersToVv(frontiers: FrontiersLike): VersionVectorLike | undefined; /** * Get the handler by the path. */ - getByPath(path: Array): ValueOrContainerInterface | undefined; + getByPath(path: Array): ValueOrContainer | undefined; /** * The path can be specified in different ways depending on the container type: * @@ -9316,7 +9549,7 @@ export interface LoroDocInterface { * assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "item".into()); * ``` */ - getByStrPath(path: string): ValueOrContainerInterface | undefined; + getByStrPath(path: string): ValueOrContainer | undefined; /** * Get `Change` at the given id. * @@ -9347,13 +9580,17 @@ export interface LoroDocInterface { * * `len` - The length of the change range to check */ getChangedContainersIn(id: Id, len: /*u32*/ number): Array; + /** + * Get a container by container id. + */ + getContainer(id: ContainerId): ValueOrContainer | undefined; /** * Get a [LoroCounter] by container id. * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - getCounter(id: ContainerIdLike): LoroCounterInterface; - getCursorPos(cursor: CursorInterface) /*throws*/ : PosQueryResult; + getCounter(id: ContainerIdLike): LoroCounterLike; + getCursorPos(cursor: CursorLike) /*throws*/ : PosQueryResult; /** * Get the entire state of the current DocState */ @@ -9367,19 +9604,19 @@ export interface LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - getList(id: ContainerIdLike): LoroListInterface; + getList(id: ContainerIdLike): LoroListLike; /** * Get a [LoroMap] by container id. * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - getMap(id: ContainerIdLike): LoroMapInterface; + getMap(id: ContainerIdLike): LoroMapLike; /** * Get a [LoroMovableList] by container id. * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - getMovableList(id: ContainerIdLike): LoroMovableListInterface; + getMovableList(id: ContainerIdLike): LoroMovableListLike; /** * Get the path from the root to the container */ @@ -9396,13 +9633,13 @@ export interface LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - getText(id: ContainerIdLike): LoroTextInterface; + getText(id: ContainerIdLike): LoroTextLike; /** * Get a [LoroTree] by container id. * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - getTree(id: ContainerIdLike): LoroTreeInterface; + getTree(id: ContainerIdLike): LoroTreeLike; /** * Get the shallow value of the document. */ @@ -9473,7 +9710,7 @@ export interface LoroDocInterface { * assert_eq!(result[0].to_json_value(), serde_json::json!(30)); * ``` */ - jsonpath(path: string) /*throws*/ : Array; + jsonpath(path: string) /*throws*/ : Array; /** * Get the total number of changes in the `OpLog` */ @@ -9485,15 +9722,15 @@ export interface LoroDocInterface { /** * Minimize the frontiers by removing the unnecessary entries. */ - minimizeFrontiers(frontiers: FrontiersInterface): FrontiersOrId; + minimizeFrontiers(frontiers: FrontiersLike): FrontiersOrId; /** * Get the `Frontiers` version of `OpLog` */ - oplogFrontiers(): FrontiersInterface; + oplogFrontiers(): FrontiersLike; /** * Get the `VersionVector` version of `OpLog` */ - oplogVv(): VersionVectorInterface; + oplogVv(): VersionVectorLike; /** * Get the PeerID */ @@ -9514,7 +9751,7 @@ export interface LoroDocInterface { */ redactJsonUpdates( json: string, - versionRange: VersionRangeInterface + versionRange: VersionRangeLike ) /*throws*/ : string; /** * Revert the current document state back to the target version @@ -9523,7 +9760,7 @@ export interface LoroDocInterface { * current doc to the target version. It will calculate the diff between the current * state and the target state, and apply the diff to the current state. */ - revertTo(version: FrontiersInterface) /*throws*/ : void; + revertTo(version: FrontiersLike) /*throws*/ : void; /** * Set the interval of mergeable changes, **in seconds**. * @@ -9587,17 +9824,17 @@ export interface LoroDocInterface { * * The ops included by the trimmed history are not in the doc. */ - shallowSinceVv(): VersionVectorInterface; + shallowSinceVv(): VersionVectorLike; /** * Get the `Frontiers` version of `DocState` * * Learn more about [`Frontiers`](https://loro.dev/docs/advanced/version_deep_dive) */ - stateFrontiers(): FrontiersInterface; + stateFrontiers(): FrontiersLike; /** * Get the `VersionVector` version of `DocState` */ - stateVv(): VersionVectorInterface; + stateVv(): VersionVectorLike; /** * Subscribe the events of a container. * @@ -9611,10 +9848,7 @@ export interface LoroDocInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe( - containerId: ContainerId, - subscriber: Subscriber - ): SubscriptionInterface; + subscribe(containerId: ContainerId, subscriber: Subscriber): SubscriptionLike; /** * Subscribe to the first commit from a peer. Operations performed on the `LoroDoc` within this callback * will be merged into the current commit. @@ -9624,25 +9858,35 @@ export interface LoroDocInterface { */ subscribeFirstCommitFromPeer( callback: FirstCommitFromPeerCallback - ): SubscriptionInterface; + ): SubscriptionLike; + /** + * Subscribe to updates that might affect the given JSONPath query. + * + * The callback may fire false positives; it is intended as a lightweight notification so + * callers can debounce or throttle before re-running JSONPath themselves. + */ + subscribeJsonpath( + path: string, + callback: JsonPathSubscriber + ) /*throws*/ : SubscriptionLike; /** * Subscribe the local update of the document. */ - subscribeLocalUpdate(callback: LocalUpdateCallback): SubscriptionInterface; + subscribeLocalUpdate(callback: LocalUpdateCallback): SubscriptionLike; /** * Subscribe to the pre-commit event. * * The callback will be called when the changes are committed but not yet applied to the OpLog. * You can modify the commit message and timestamp in the callback by [`ChangeModifier`]. */ - subscribePreCommit(callback: PreCommitCallback): SubscriptionInterface; + subscribePreCommit(callback: PreCommitCallback): SubscriptionLike; /** * Subscribe all the events. * * The callback will be invoked when any part of the [loro_internal::DocState] is changed. * Returns a subscription that can be used to unsubscribe. */ - subscribeRoot(subscriber: Subscriber): SubscriptionInterface; + subscribeRoot(subscriber: Subscriber): SubscriptionLike; /** * Traverses the ancestors of the Change containing the given ID, including itself. * @@ -9658,11 +9902,51 @@ export interface LoroDocInterface { ids: Array, f: ChangeAncestorsTraveler ) /*throws*/ : void; + /** + * Try to get a [LoroCounter] by container id. + * + * Returns null if the container does not exist. + */ + tryGetCounter(id: ContainerIdLike): LoroCounterLike | undefined; + /** + * Try to get a [LoroList] by container id. + * + * Returns null if the container does not exist. + */ + tryGetList(id: ContainerIdLike): LoroListLike | undefined; + /** + * Try to get a [LoroMap] by container id. + * + * Returns null if the container does not exist. + */ + tryGetMap(id: ContainerIdLike): LoroMapLike | undefined; + /** + * Try to get a [LoroMovableList] by container id. + * + * Returns null if the container does not exist. + */ + tryGetMovableList(id: ContainerIdLike): LoroMovableListLike | undefined; + /** + * Try to get a [LoroText] by container id. + * + * Returns null if the container does not exist. + */ + tryGetText(id: ContainerIdLike): LoroTextLike | undefined; + /** + * Try to get a [LoroTree] by container id. + * + * Returns null if the container does not exist. + */ + tryGetTree(id: ContainerIdLike): LoroTreeLike | undefined; /** * Convert `VersionVector` into `Frontiers` */ - vvToFrontiers(vv: VersionVectorInterface): FrontiersInterface; + vvToFrontiers(vv: VersionVectorLike): FrontiersLike; } +/** + * @deprecated Use `LoroDocLike` instead. + */ +export type LoroDocInterface = LoroDocLike; /** * `LoroDoc` is the entry for the whole document. @@ -9672,10 +9956,10 @@ export interface LoroDocInterface { * It is the responsibility of the user to manage the storage, loading, and synchronization * of the bytes exported by Loro in a manner suitable for their specific environment. */ -export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { +export class LoroDoc extends UniffiAbstractObject implements LoroDocLike { readonly [uniffiTypeNameSymbol] = 'LoroDoc'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new `LoroDoc` instance. */ @@ -9698,7 +9982,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * Internally, it will apply the diff to the current state. */ - public applyDiff(diff: DiffBatchInterface): void /*throws*/ { + applyDiff(diff: DiffBatchLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -9722,7 +10006,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * > In a detached state, the document is not editable, and any `import` operations will be * > recorded in the `OpLog` without being applied to the `DocState`. */ - public attach(): void { + attach(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_attach( @@ -9738,7 +10022,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * Check the correctness of the document state by comparing it with the state * calculated by applying all the history. */ - public checkStateCorrectnessSlow(): void { + checkStateCorrectnessSlow(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_check_state_correctness_slow( @@ -9760,7 +10044,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * You should call `attach` to attach the `DocState` to the latest version of `OpLog`. */ - public checkout(frontiers: FrontiersInterface): void /*throws*/ { + checkout(frontiers: FrontiersLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -9786,7 +10070,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * This has the same effect as `attach`. */ - public checkoutToLatest(): void { + checkoutToLatest(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_checkout_to_latest( @@ -9801,7 +10085,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Clear the options of the next commit. */ - public clearNextCommitOptions(): void { + clearNextCommitOptions(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_clear_next_commit_options( @@ -9818,7 +10102,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * If `other` contains any version that's not contained in the current OpLog, return [Ordering::Less]. */ - public cmpWithFrontiers(other: FrontiersInterface): Ordering { + cmpWithFrontiers(other: FrontiersLike): Ordering { return FfiConverterTypeOrdering.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -9844,7 +10128,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public commit(): void { + commit(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_commit( @@ -9856,7 +10140,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public commitWith(options: CommitOptions): void { + commitWith(options: CommitOptions): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_commit_with( @@ -9874,7 +10158,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * The parsed ops will be dropped */ - public compactChangeStore(): void { + compactChangeStore(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_compact_change_store( @@ -9889,7 +10173,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the configurations of the document. */ - public config(): ConfigureInterface { + config(): ConfigureLike { return FfiConverterTypeConfigure.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -9913,7 +10197,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * - `text_style`: The style configuration to set as the default. `None` to reset. */ - public configDefaultTextStyle(textStyle: StyleConfig | undefined): void { + configDefaultTextStyle(textStyle: StyleConfig | undefined): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_config_default_text_style( @@ -9935,7 +10219,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * Expand is used to specify the behavior of expanding when new text is inserted at the * beginning or end of the style. */ - public configTextStyle(textStyle: StyleConfigMapInterface): void { + configTextStyle(textStyle: StyleConfigMapLike): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_config_text_style( @@ -9957,7 +10241,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * Only works on root containers (containers without parents). */ - public deleteRootContainer(cid: ContainerId): void { + deleteRootContainer(cid: ContainerId): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_delete_root_container( @@ -9977,7 +10261,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * Learn more at https://loro.dev/docs/advanced/doc_state_and_oplog#attacheddetached-status */ - public detach(): void { + detach(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_detach( @@ -9992,10 +10276,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Calculate the diff between two versions */ - public diff( - a: FrontiersInterface, - b: FrontiersInterface - ): DiffBatchInterface /*throws*/ { + diff(a: FrontiersLike, b: FrontiersLike): DiffBatchLike /*throws*/ { return FfiConverterTypeDiffBatch.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -10014,6 +10295,27 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } + /** + * Export the document in the given mode. + */ + export_(mode: ExportMode): ArrayBuffer /*throws*/ { + return FfiConverterArrayBuffer.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroEncodeError.lift.bind( + FfiConverterTypeLoroEncodeError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_export( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeExportMode.lower(mode), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * Exports changes within the specified ID span to JSON schema format. * @@ -10024,7 +10326,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * This method will NOT trigger a new commit implicitly. */ - public exportJsonInIdSpan(idSpan: IdSpan): Array { + exportJsonInIdSpan(idSpan: IdSpan): Array { return FfiConverterArrayString.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10042,9 +10344,9 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Export the current state with json-string format of the document. */ - public exportJsonUpdates( - startVv: VersionVectorInterface, - endVv: VersionVectorInterface + exportJsonUpdates( + startVv: VersionVectorLike, + endVv: VersionVectorLike ): string { return FfiConverterString.lift( uniffiCaller.rustCall( @@ -10067,9 +10369,9 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * Compared to [`export_json_updates`], this method does not compress the peer IDs in the updates. * So the operations are easier to be processed by application code. */ - public exportJsonUpdatesWithoutPeerCompression( - startVv: VersionVectorInterface, - endVv: VersionVectorInterface + exportJsonUpdatesWithoutPeerCompression( + startVv: VersionVectorLike, + endVv: VersionVectorLike ): string { return FfiConverterString.lift( uniffiCaller.rustCall( @@ -10086,9 +10388,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public exportShallowSnapshot( - frontiers: FrontiersInterface - ): ArrayBuffer /*throws*/ { + exportShallowSnapshot(frontiers: FrontiersLike): ArrayBuffer /*throws*/ { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroEncodeError.lift.bind( @@ -10109,7 +10409,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Export the current state and history of the document. */ - public exportSnapshot(): ArrayBuffer /*throws*/ { + exportSnapshot(): ArrayBuffer /*throws*/ { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroEncodeError.lift.bind( @@ -10126,9 +10426,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public exportSnapshotAt( - frontiers: FrontiersInterface - ): ArrayBuffer /*throws*/ { + exportSnapshotAt(frontiers: FrontiersLike): ArrayBuffer /*throws*/ { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroEncodeError.lift.bind( @@ -10146,8 +10444,8 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public exportStateOnly( - frontiers: FrontiersInterface | undefined + exportStateOnly( + frontiers: FrontiersLike | undefined ): ArrayBuffer /*throws*/ { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCallWithError( @@ -10169,7 +10467,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Export all the ops not included in the given `VersionVector` */ - public exportUpdates(vv: VersionVectorInterface): ArrayBuffer /*throws*/ { + exportUpdates(vv: VersionVectorLike): ArrayBuffer /*throws*/ { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroEncodeError.lift.bind( @@ -10187,7 +10485,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public exportUpdatesInRange(spans: Array): ArrayBuffer /*throws*/ { + exportUpdatesInRange(spans: Array): ArrayBuffer /*throws*/ { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroEncodeError.lift.bind( @@ -10208,9 +10506,9 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Find the operation id spans that between the `from` version and the `to` version. */ - public findIdSpansBetween( - from: FrontiersInterface, - to: FrontiersInterface + findIdSpansBetween( + from: FrontiersLike, + to: FrontiersLike ): VersionVectorDiff { return FfiConverterTypeVersionVectorDiff.lift( uniffiCaller.rustCall( @@ -10235,7 +10533,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * When called in detached mode, it will fork at the current state frontiers. * It will have the same effect as `fork_at(&self.state_frontiers())`. */ - public fork(): LoroDocInterface { + fork(): LoroDocLike { return FfiConverterTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10254,9 +10552,12 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * The created doc will only contain the history before the specified frontiers. */ - public forkAt(frontiers: FrontiersInterface): LoroDocInterface { + forkAt(frontiers: FrontiersLike): LoroDocLike /*throws*/ { return FfiConverterTypeLoroDoc.lift( - uniffiCaller.rustCall( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_fork_at( uniffiTypeLoroDocObjectFactory.clonePointer(this), @@ -10272,7 +10573,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Free the cached diff calculator that is used for checkout. */ - public freeDiffCalculator(): void { + freeDiffCalculator(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_free_diff_calculator( @@ -10290,7 +10591,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * If you use checkout that switching to an old/concurrent version, the history cache will be built. * You can free it by calling this method. */ - public freeHistoryCache(): void { + freeHistoryCache(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_free_history_cache( @@ -10305,9 +10606,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Convert `Frontiers` into `VersionVector` */ - public frontiersToVv( - frontiers: FrontiersInterface - ): VersionVectorInterface | undefined { + frontiersToVv(frontiers: FrontiersLike): VersionVectorLike | undefined { return FfiConverterOptionalTypeVersionVector.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10325,7 +10624,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the handler by the path. */ - public getByPath(path: Array): ValueOrContainerInterface | undefined { + getByPath(path: Array): ValueOrContainer | undefined { return FfiConverterOptionalTypeValueOrContainer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10393,7 +10692,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "item".into()); * ``` */ - public getByStrPath(path: string): ValueOrContainerInterface | undefined { + getByStrPath(path: string): ValueOrContainer | undefined { return FfiConverterOptionalTypeValueOrContainer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10423,7 +10722,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * The length of the `Change` is how many operations it contains */ - public getChange(id: Id): ChangeMeta | undefined { + getChange(id: Id): ChangeMeta | undefined { return FfiConverterOptionalTypeChangeMeta.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10451,10 +10750,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * `id` - The starting ID of the change range * * `len` - The length of the change range to check */ - public getChangedContainersIn( - id: Id, - len: /*u32*/ number - ): Array { + getChangedContainersIn(id: Id, len: /*u32*/ number): Array { return FfiConverterArrayTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10470,12 +10766,30 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } + /** + * Get a container by container id. + */ + getContainer(id: ContainerId): ValueOrContainer | undefined { + return FfiConverterOptionalTypeValueOrContainer.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_get_container( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeContainerID.lower(id), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * Get a [LoroCounter] by container id. * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - public getCounter(id: ContainerIdLike): LoroCounterInterface { + getCounter(id: ContainerIdLike): LoroCounterLike { return FfiConverterTypeLoroCounter.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10490,7 +10804,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public getCursorPos(cursor: CursorInterface): PosQueryResult /*throws*/ { + getCursorPos(cursor: CursorLike): PosQueryResult /*throws*/ { return FfiConverterTypePosQueryResult.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeCannotFindRelativePosition.lift.bind( @@ -10511,7 +10825,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the entire state of the current DocState */ - public getDeepValue(): LoroValue { + getDeepValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10528,7 +10842,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the entire state of the current DocState with container id */ - public getDeepValueWithId(): LoroValue { + getDeepValueWithId(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10547,7 +10861,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - public getList(id: ContainerIdLike): LoroListInterface { + getList(id: ContainerIdLike): LoroListLike { return FfiConverterTypeLoroList.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10567,7 +10881,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - public getMap(id: ContainerIdLike): LoroMapInterface { + getMap(id: ContainerIdLike): LoroMapLike { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10587,7 +10901,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - public getMovableList(id: ContainerIdLike): LoroMovableListInterface { + getMovableList(id: ContainerIdLike): LoroMovableListLike { return FfiConverterTypeLoroMovableList.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10605,7 +10919,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the path from the root to the container */ - public getPathToContainer(id: ContainerId): Array | undefined { + getPathToContainer(id: ContainerId): Array | undefined { return FfiConverterOptionalArrayTypeContainerPath.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10626,7 +10940,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * The pending transaction is the one that is not committed yet. It will be committed * after calling `doc.commit()`, `doc.export(mode)` or `doc.checkout(version)`. */ - public getPendingTxnLen(): /*u32*/ number { + getPendingTxnLen(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10645,7 +10959,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - public getText(id: ContainerIdLike): LoroTextInterface { + getText(id: ContainerIdLike): LoroTextLike { return FfiConverterTypeLoroText.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10665,7 +10979,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * If the provided id is string, it will be converted into a root container id with the name of the string. */ - public getTree(id: ContainerIdLike): LoroTreeInterface { + getTree(id: ContainerIdLike): LoroTreeLike { return FfiConverterTypeLoroTree.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10683,7 +10997,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the shallow value of the document. */ - public getValue(): LoroValue { + getValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10703,7 +11017,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * A root container always exists, while a normal container exists * if it has ever been created on the doc. */ - public hasContainer(id: ContainerId): boolean { + hasContainer(id: ContainerId): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10718,7 +11032,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public hasHistoryCache(): boolean { + hasHistoryCache(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10735,7 +11049,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`]. */ - public import_(bytes: ArrayBuffer): ImportStatus /*throws*/ { + import_(bytes: ArrayBuffer): ImportStatus /*throws*/ { return FfiConverterTypeImportStatus.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -10758,7 +11072,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * The data can be in arbitrary order. The import result will be the same. */ - public importBatch(bytes: Array): ImportStatus /*throws*/ { + importBatch(bytes: Array): ImportStatus /*throws*/ { return FfiConverterTypeImportStatus.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -10776,7 +11090,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - public importJsonUpdates(json: string): ImportStatus /*throws*/ { + importJsonUpdates(json: string): ImportStatus /*throws*/ { return FfiConverterTypeImportStatus.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -10800,10 +11114,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * It marks the import with a custom `origin` string. It can be used to track the import source * in the generated events. */ - public importWith( - bytes: ArrayBuffer, - origin: string - ): ImportStatus /*throws*/ { + importWith(bytes: ArrayBuffer, origin: string): ImportStatus /*throws*/ { return FfiConverterTypeImportStatus.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -10826,7 +11137,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * Whether the document is in detached mode, where the [loro_internal::DocState] is not * synchronized with the latest version of the [loro_internal::OpLog]. */ - public isDetached(): boolean { + isDetached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10843,7 +11154,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Check if the doc contains the full history. */ - public isShallow(): boolean { + isShallow(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10888,7 +11199,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * assert_eq!(result[0].to_json_value(), serde_json::json!(30)); * ``` */ - public jsonpath(path: string): Array /*throws*/ { + jsonpath(path: string): Array /*throws*/ { return FfiConverterArrayTypeValueOrContainer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeJsonPathError.lift.bind( @@ -10909,7 +11220,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the total number of changes in the `OpLog` */ - public lenChanges(): /*u64*/ bigint { + lenChanges(): /*u64*/ bigint { return FfiConverterUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10926,7 +11237,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the total number of operations in the `OpLog` */ - public lenOps(): /*u64*/ bigint { + lenOps(): /*u64*/ bigint { return FfiConverterUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10943,7 +11254,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Minimize the frontiers by removing the unnecessary entries. */ - public minimizeFrontiers(frontiers: FrontiersInterface): FrontiersOrId { + minimizeFrontiers(frontiers: FrontiersLike): FrontiersOrId { return FfiConverterTypeFrontiersOrID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10961,7 +11272,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the `Frontiers` version of `OpLog` */ - public oplogFrontiers(): FrontiersInterface { + oplogFrontiers(): FrontiersLike { return FfiConverterTypeFrontiers.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10978,7 +11289,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the `VersionVector` version of `OpLog` */ - public oplogVv(): VersionVectorInterface { + oplogVv(): VersionVectorLike { return FfiConverterTypeVersionVector.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -10995,7 +11306,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the PeerID */ - public peerId(): /*u64*/ bigint { + peerId(): /*u64*/ bigint { return FfiConverterUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11023,9 +11334,9 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * - Replaces text mark values with null * - Preserves map keys and text annotation keys */ - public redactJsonUpdates( + redactJsonUpdates( json: string, - versionRange: VersionRangeInterface + versionRange: VersionRangeLike ): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( @@ -11052,7 +11363,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * current doc to the target version. It will calculate the diff between the current * state and the target state, and apply the diff to the current state. */ - public revertTo(version: FrontiersInterface): void /*throws*/ { + revertTo(version: FrontiersLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -11077,7 +11388,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * By default, we record timestamps in seconds for each change. So if the merge interval is 1, and changes A and B * have timestamps of 3 and 4 respectively, then they will be merged into one change */ - public setChangeMergeInterval(interval: /*i64*/ bigint): void { + setChangeMergeInterval(interval: /*i64*/ bigint): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_change_merge_interval( @@ -11093,7 +11404,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Set whether to hide empty root containers. */ - public setHideEmptyRootContainers(hide: boolean): void { + setHideEmptyRootContainers(hide: boolean): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_hide_empty_root_containers( @@ -11111,7 +11422,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * It will be persisted. */ - public setNextCommitMessage(msg: string): void { + setNextCommitMessage(msg: string): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_next_commit_message( @@ -11129,7 +11440,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * It will be used when the next commit is performed. */ - public setNextCommitOptions(options: CommitOptions): void { + setNextCommitOptions(options: CommitOptions): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_next_commit_options( @@ -11147,7 +11458,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * It will NOT be persisted. */ - public setNextCommitOrigin(origin: string): void { + setNextCommitOrigin(origin: string): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_next_commit_origin( @@ -11166,7 +11477,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * It will be persisted and stored in the `OpLog`. * You can get the timestamp from the [`Change`] type. */ - public setNextCommitTimestamp(timestamp: /*i64*/ bigint): void { + setNextCommitTimestamp(timestamp: /*i64*/ bigint): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_next_commit_timestamp( @@ -11185,7 +11496,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * NOTE: You need to make sure there is no chance two peer have the same PeerID. * If it happens, the document will be corrupted. */ - public setPeerId(peer: /*u64*/ bigint): void /*throws*/ { + setPeerId(peer: /*u64*/ bigint): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -11212,7 +11523,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * If you commit a new change with a timestamp that is less than the existing one, * the largest existing timestamp will be used instead. */ - public setRecordTimestamp(record: boolean): void { + setRecordTimestamp(record: boolean): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_set_record_timestamp( @@ -11230,7 +11541,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * The ops included by the trimmed history are not in the doc. */ - public shallowSinceVv(): VersionVectorInterface { + shallowSinceVv(): VersionVectorLike { return FfiConverterTypeVersionVector.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11249,7 +11560,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * * Learn more about [`Frontiers`](https://loro.dev/docs/advanced/version_deep_dive) */ - public stateFrontiers(): FrontiersInterface { + stateFrontiers(): FrontiersLike { return FfiConverterTypeFrontiers.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11266,7 +11577,7 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { /** * Get the `VersionVector` version of `DocState` */ - public stateVv(): VersionVectorInterface { + stateVv(): VersionVectorLike { return FfiConverterTypeVersionVector.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11293,10 +11604,10 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe( + subscribe( containerId: ContainerId, subscriber: Subscriber - ): SubscriptionInterface { + ): SubscriptionLike { return FfiConverterTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11319,9 +11630,9 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { * This is useful for managing the relationship between `PeerID` and user information. * For example, you could store user names in a `LoroMap` using `PeerID` as the key and the `UserID` as the value. */ - public subscribeFirstCommitFromPeer( + subscribeFirstCommitFromPeer( callback: FirstCommitFromPeerCallback - ): SubscriptionInterface { + ): SubscriptionLike { return FfiConverterTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11336,12 +11647,38 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } + /** + * Subscribe to updates that might affect the given JSONPath query. + * + * The callback may fire false positives; it is intended as a lightweight notification so + * callers can debounce or throttle before re-running JSONPath themselves. + */ + subscribeJsonpath( + path: string, + callback: JsonPathSubscriber + ): SubscriptionLike /*throws*/ { + return FfiConverterTypeSubscription.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_jsonpath( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterString.lower(path), + FfiConverterTypeJsonPathSubscriber.lower(callback), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * Subscribe the local update of the document. */ - public subscribeLocalUpdate( - callback: LocalUpdateCallback - ): SubscriptionInterface { + subscribeLocalUpdate(callback: LocalUpdateCallback): SubscriptionLike { return FfiConverterTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11357,20 +11694,170 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { } /** - * Subscribe to the pre-commit event. + * Subscribe to the pre-commit event. + * + * The callback will be called when the changes are committed but not yet applied to the OpLog. + * You can modify the commit message and timestamp in the callback by [`ChangeModifier`]. + */ + subscribePreCommit(callback: PreCommitCallback): SubscriptionLike { + return FfiConverterTypeSubscription.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_pre_commit( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypePreCommitCallback.lower(callback), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Subscribe all the events. + * + * The callback will be invoked when any part of the [loro_internal::DocState] is changed. + * Returns a subscription that can be used to unsubscribe. + */ + subscribeRoot(subscriber: Subscriber): SubscriptionLike { + return FfiConverterTypeSubscription.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_root( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeSubscriber.lower(subscriber), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Traverses the ancestors of the Change containing the given ID, including itself. + * + * This method visits all ancestors in causal order, from the latest to the oldest, + * based on their Lamport timestamps. + * + * # Arguments + * + * * `ids` - The IDs of the Change to start the traversal from. + * * `f` - A mutable function that is called for each ancestor. It can return `ControlFlow::Break(())` to stop the traversal. + */ + travelChangeAncestors( + ids: Array, + f: ChangeAncestorsTraveler + ): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeChangeTravelError.lift.bind( + FfiConverterTypeChangeTravelError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_travel_change_ancestors( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterArrayTypeID.lower(ids), + FfiConverterTypeChangeAncestorsTraveler.lower(f), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + + /** + * Try to get a [LoroCounter] by container id. + * + * Returns null if the container does not exist. + */ + tryGetCounter(id: ContainerIdLike): LoroCounterLike | undefined { + return FfiConverterOptionalTypeLoroCounter.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_counter( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeContainerIdLike.lower(id), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Try to get a [LoroList] by container id. + * + * Returns null if the container does not exist. + */ + tryGetList(id: ContainerIdLike): LoroListLike | undefined { + return FfiConverterOptionalTypeLoroList.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_list( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeContainerIdLike.lower(id), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Try to get a [LoroMap] by container id. + * + * Returns null if the container does not exist. + */ + tryGetMap(id: ContainerIdLike): LoroMapLike | undefined { + return FfiConverterOptionalTypeLoroMap.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_map( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeContainerIdLike.lower(id), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Try to get a [LoroMovableList] by container id. + * + * Returns null if the container does not exist. + */ + tryGetMovableList(id: ContainerIdLike): LoroMovableListLike | undefined { + return FfiConverterOptionalTypeLoroMovableList.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_movable_list( + uniffiTypeLoroDocObjectFactory.clonePointer(this), + FfiConverterTypeContainerIdLike.lower(id), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Try to get a [LoroText] by container id. * - * The callback will be called when the changes are committed but not yet applied to the OpLog. - * You can modify the commit message and timestamp in the callback by [`ChangeModifier`]. + * Returns null if the container does not exist. */ - public subscribePreCommit( - callback: PreCommitCallback - ): SubscriptionInterface { - return FfiConverterTypeSubscription.lift( + tryGetText(id: ContainerIdLike): LoroTextLike | undefined { + return FfiConverterOptionalTypeLoroText.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { - return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_pre_commit( + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_text( uniffiTypeLoroDocObjectFactory.clonePointer(this), - FfiConverterTypePreCommitCallback.lower(callback), + FfiConverterTypeContainerIdLike.lower(id), callStatus ); }, @@ -11380,18 +11867,17 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { } /** - * Subscribe all the events. + * Try to get a [LoroTree] by container id. * - * The callback will be invoked when any part of the [loro_internal::DocState] is changed. - * Returns a subscription that can be used to unsubscribe. + * Returns null if the container does not exist. */ - public subscribeRoot(subscriber: Subscriber): SubscriptionInterface { - return FfiConverterTypeSubscription.lift( + tryGetTree(id: ContainerIdLike): LoroTreeLike | undefined { + return FfiConverterOptionalTypeLoroTree.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { - return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_subscribe_root( + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_try_get_tree( uniffiTypeLoroDocObjectFactory.clonePointer(this), - FfiConverterTypeSubscriber.lower(subscriber), + FfiConverterTypeContainerIdLike.lower(id), callStatus ); }, @@ -11400,41 +11886,10 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { ); } - /** - * Traverses the ancestors of the Change containing the given ID, including itself. - * - * This method visits all ancestors in causal order, from the latest to the oldest, - * based on their Lamport timestamps. - * - * # Arguments - * - * * `ids` - The IDs of the Change to start the traversal from. - * * `f` - A mutable function that is called for each ancestor. It can return `ControlFlow::Break(())` to stop the traversal. - */ - public travelChangeAncestors( - ids: Array, - f: ChangeAncestorsTraveler - ): void /*throws*/ { - uniffiCaller.rustCallWithError( - /*liftError:*/ FfiConverterTypeChangeTravelError.lift.bind( - FfiConverterTypeChangeTravelError - ), - /*caller:*/ (callStatus) => { - nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorodoc_travel_change_ancestors( - uniffiTypeLoroDocObjectFactory.clonePointer(this), - FfiConverterArrayTypeID.lower(ids), - FfiConverterTypeChangeAncestorsTraveler.lower(f), - callStatus - ); - }, - /*liftString:*/ FfiConverterString.lift - ); - } - /** * Convert `VersionVector` into `Frontiers` */ - public vvToFrontiers(vv: VersionVectorInterface): FrontiersInterface { + vvToFrontiers(vv: VersionVectorLike): FrontiersLike { return FfiConverterTypeFrontiers.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11467,72 +11922,75 @@ export class LoroDoc extends UniffiAbstractObject implements LoroDocInterface { } } -const uniffiTypeLoroDocObjectFactory: UniffiObjectFactory = { - create(pointer: UnsafeMutableRawPointer): LoroDocInterface { - const instance = Object.create(LoroDoc.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroDoc'; - return instance; - }, +const uniffiTypeLoroDocObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroDocLike { + const instance = Object.create(LoroDoc.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroDoc'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorodoc_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorodoc_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LoroDocInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LoroDocLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LoroDocInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorodoc( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroDocLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorodoc( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorodoc( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorodoc( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroDocInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroDoc' - ); - }, -}; -// FfiConverter for LoroDocInterface + isConcreteType(obj: any): obj is LoroDocLike { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroDoc' + ); + }, + }; + })(); +// FfiConverter for LoroDocLike const FfiConverterTypeLoroDoc = new FfiConverterObject( uniffiTypeLoroDocObjectFactory ); -export interface LoroListInterface { +export interface LoroListLike { /** * Delete all elements in the list. */ @@ -11544,16 +12002,16 @@ export interface LoroListInterface { /** * Get the LoroDoc from this container */ - doc(): LoroDocInterface | undefined; + doc(): LoroDocLike | undefined; /** * Get the value at the given position. */ - get(index: /*u32*/ number): ValueOrContainerInterface | undefined; + get(index: /*u32*/ number): ValueOrContainer | undefined; /** * If a detached container is attached, this method will return its corresponding attached handler. */ - getAttached(): LoroListInterface | undefined; - getCursor(pos: /*u32*/ number, side: Side): CursorInterface | undefined; + getAttached(): LoroListLike | undefined; + getCursor(pos: /*u32*/ number, side: Side): CursorLike | undefined; /** * Get the deep value of the container. */ @@ -11578,28 +12036,28 @@ export interface LoroListInterface { insert(pos: /*u32*/ number, v: LoroValueLike) /*throws*/ : void; insertCounterContainer( pos: /*u32*/ number, - child: LoroCounterInterface - ) /*throws*/ : LoroCounterInterface; + child: LoroCounterLike + ) /*throws*/ : LoroCounterLike; insertListContainer( pos: /*u32*/ number, - child: LoroListInterface - ) /*throws*/ : LoroListInterface; + child: LoroListLike + ) /*throws*/ : LoroListLike; insertMapContainer( pos: /*u32*/ number, - child: LoroMapInterface - ) /*throws*/ : LoroMapInterface; + child: LoroMapLike + ) /*throws*/ : LoroMapLike; insertMovableListContainer( pos: /*u32*/ number, - child: LoroMovableListInterface - ) /*throws*/ : LoroMovableListInterface; + child: LoroMovableListLike + ) /*throws*/ : LoroMovableListLike; insertTextContainer( pos: /*u32*/ number, - child: LoroTextInterface - ) /*throws*/ : LoroTextInterface; + child: LoroTextLike + ) /*throws*/ : LoroTextLike; insertTreeContainer( pos: /*u32*/ number, - child: LoroTreeInterface - ) /*throws*/ : LoroTreeInterface; + child: LoroTreeLike + ) /*throws*/ : LoroTreeLike; /** * Whether the container is attached to a document * @@ -11631,7 +12089,7 @@ export interface LoroListInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe(subscriber: Subscriber): SubscriptionInterface | undefined; + subscribe(subscriber: Subscriber): SubscriptionLike | undefined; /** * Converts the LoroList to a Vec of LoroValue. * @@ -11640,14 +12098,15 @@ export interface LoroListInterface { */ toVec(): Array; } +/** + * @deprecated Use `LoroListLike` instead. + */ +export type LoroListInterface = LoroListLike; -export class LoroList - extends UniffiAbstractObject - implements LoroListInterface -{ +export class LoroList extends UniffiAbstractObject implements LoroListLike { readonly [uniffiTypeNameSymbol] = 'LoroList'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new container that is detached from the document. * @@ -11672,7 +12131,7 @@ export class LoroList /** * Delete all elements in the list. */ - public clear(): void /*throws*/ { + clear(): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -11690,7 +12149,7 @@ export class LoroList /** * Delete values at the given position. */ - public delete_(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { + delete_(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -11710,7 +12169,7 @@ export class LoroList /** * Get the LoroDoc from this container */ - public doc(): LoroDocInterface | undefined { + doc(): LoroDocLike | undefined { return FfiConverterOptionalTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11727,7 +12186,7 @@ export class LoroList /** * Get the value at the given position. */ - public get(index: /*u32*/ number): ValueOrContainerInterface | undefined { + get(index: /*u32*/ number): ValueOrContainer | undefined { return FfiConverterOptionalTypeValueOrContainer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11745,7 +12204,7 @@ export class LoroList /** * If a detached container is attached, this method will return its corresponding attached handler. */ - public getAttached(): LoroListInterface | undefined { + getAttached(): LoroListLike | undefined { return FfiConverterOptionalTypeLoroList.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11759,10 +12218,7 @@ export class LoroList ); } - public getCursor( - pos: /*u32*/ number, - side: Side - ): CursorInterface | undefined { + getCursor(pos: /*u32*/ number, side: Side): CursorLike | undefined { return FfiConverterOptionalTypeCursor.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11781,7 +12237,7 @@ export class LoroList /** * Get the deep value of the container. */ - public getDeepValue(): LoroValue { + getDeepValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11798,7 +12254,7 @@ export class LoroList /** * Get the ID of the list item at the given position. */ - public getIdAt(pos: /*u32*/ number): Id | undefined { + getIdAt(pos: /*u32*/ number): Id | undefined { return FfiConverterOptionalTypeID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11818,7 +12274,7 @@ export class LoroList * * This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container]. */ - public getValue(): LoroValue { + getValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11835,7 +12291,7 @@ export class LoroList /** * Get the ID of the container. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -11852,7 +12308,7 @@ export class LoroList /** * Insert a value at the given position. */ - public insert(pos: /*u32*/ number, v: LoroValueLike): void /*throws*/ { + insert(pos: /*u32*/ number, v: LoroValueLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -11869,10 +12325,10 @@ export class LoroList ); } - public insertCounterContainer( + insertCounterContainer( pos: /*u32*/ number, - child: LoroCounterInterface - ): LoroCounterInterface /*throws*/ { + child: LoroCounterLike + ): LoroCounterLike /*throws*/ { return FfiConverterTypeLoroCounter.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -11891,10 +12347,10 @@ export class LoroList ); } - public insertListContainer( + insertListContainer( pos: /*u32*/ number, - child: LoroListInterface - ): LoroListInterface /*throws*/ { + child: LoroListLike + ): LoroListLike /*throws*/ { return FfiConverterTypeLoroList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -11913,10 +12369,10 @@ export class LoroList ); } - public insertMapContainer( + insertMapContainer( pos: /*u32*/ number, - child: LoroMapInterface - ): LoroMapInterface /*throws*/ { + child: LoroMapLike + ): LoroMapLike /*throws*/ { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -11935,10 +12391,10 @@ export class LoroList ); } - public insertMovableListContainer( + insertMovableListContainer( pos: /*u32*/ number, - child: LoroMovableListInterface - ): LoroMovableListInterface /*throws*/ { + child: LoroMovableListLike + ): LoroMovableListLike /*throws*/ { return FfiConverterTypeLoroMovableList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -11957,10 +12413,10 @@ export class LoroList ); } - public insertTextContainer( + insertTextContainer( pos: /*u32*/ number, - child: LoroTextInterface - ): LoroTextInterface /*throws*/ { + child: LoroTextLike + ): LoroTextLike /*throws*/ { return FfiConverterTypeLoroText.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -11979,10 +12435,10 @@ export class LoroList ); } - public insertTreeContainer( + insertTreeContainer( pos: /*u32*/ number, - child: LoroTreeInterface - ): LoroTreeInterface /*throws*/ { + child: LoroTreeLike + ): LoroTreeLike /*throws*/ { return FfiConverterTypeLoroTree.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12007,7 +12463,7 @@ export class LoroList * The edits on a detached container will not be persisted. * To attach the container to the document, please insert it into an attached container. */ - public isAttached(): boolean { + isAttached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12024,7 +12480,7 @@ export class LoroList /** * Whether the container is deleted. */ - public isDeleted(): boolean { + isDeleted(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12038,7 +12494,7 @@ export class LoroList ); } - public isEmpty(): boolean { + isEmpty(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12052,7 +12508,7 @@ export class LoroList ); } - public len(): /*u32*/ number { + len(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12069,7 +12525,7 @@ export class LoroList /** * Pop the last element of the list. */ - public pop(): LoroValue | undefined /*throws*/ { + pop(): LoroValue | undefined /*throws*/ { return FfiConverterOptionalTypeLoroValue.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12086,7 +12542,7 @@ export class LoroList ); } - public push(v: LoroValueLike): void /*throws*/ { + push(v: LoroValueLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -12115,7 +12571,7 @@ export class LoroList * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe(subscriber: Subscriber): SubscriptionInterface | undefined { + subscribe(subscriber: Subscriber): SubscriptionLike | undefined { return FfiConverterOptionalTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12136,7 +12592,7 @@ export class LoroList * This method unwraps the internal Arc and clones the data if necessary, * returning a Vec containing all the elements of the LoroList as LoroValue. */ - public toVec(): Array { + toVec(): Array { return FfiConverterArrayTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12168,73 +12624,75 @@ export class LoroList } } -const uniffiTypeLoroListObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroListInterface { - const instance = Object.create(LoroList.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroList'; - return instance; - }, +const uniffiTypeLoroListObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroListLike { + const instance = Object.create(LoroList.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroList'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorolist_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorolist_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LoroListInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LoroListLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LoroListInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorolist( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroListLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorolist( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorolist( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorolist( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroListInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroList' - ); - }, - }; -// FfiConverter for LoroListInterface + isConcreteType(obj: any): obj is LoroListLike { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroList' + ); + }, + }; + })(); +// FfiConverter for LoroListLike const FfiConverterTypeLoroList = new FfiConverterObject( uniffiTypeLoroListObjectFactory ); -export interface LoroMapInterface { +export interface LoroMapLike { /** * Delete all key-value pairs in the map. */ @@ -12246,15 +12704,15 @@ export interface LoroMapInterface { /** * Get the LoroDoc from this container */ - doc(): LoroDocInterface | undefined; + doc(): LoroDocLike | undefined; /** * Get the value of the map with the given key. */ - get(key: string): ValueOrContainerInterface | undefined; + get(key: string): ValueOrContainer | undefined; /** * If a detached container is attached, this method will return its corresponding attached handler. */ - getAttached(): LoroMapInterface | undefined; + getAttached(): LoroMapLike | undefined; /** * Get the deep value of the map. * @@ -12267,28 +12725,28 @@ export interface LoroMapInterface { getLastEditor(key: string): /*u64*/ bigint | undefined; getOrCreateCounterContainer( key: string, - child: LoroCounterInterface - ) /*throws*/ : LoroCounterInterface; + child: LoroCounterLike + ) /*throws*/ : LoroCounterLike; getOrCreateListContainer( key: string, - child: LoroListInterface - ) /*throws*/ : LoroListInterface; + child: LoroListLike + ) /*throws*/ : LoroListLike; getOrCreateMapContainer( key: string, - child: LoroMapInterface - ) /*throws*/ : LoroMapInterface; + child: LoroMapLike + ) /*throws*/ : LoroMapLike; getOrCreateMovableListContainer( key: string, - child: LoroMovableListInterface - ) /*throws*/ : LoroMovableListInterface; + child: LoroMovableListLike + ) /*throws*/ : LoroMovableListLike; getOrCreateTextContainer( key: string, - child: LoroTextInterface - ) /*throws*/ : LoroTextInterface; + child: LoroTextLike + ) /*throws*/ : LoroTextLike; getOrCreateTreeContainer( key: string, - child: LoroTreeInterface - ) /*throws*/ : LoroTreeInterface; + child: LoroTreeLike + ) /*throws*/ : LoroTreeLike; /** * Get the shallow value of the map. * @@ -12308,28 +12766,25 @@ export interface LoroMapInterface { insert(key: string, v: LoroValueLike) /*throws*/ : void; insertCounterContainer( key: string, - child: LoroCounterInterface - ) /*throws*/ : LoroCounterInterface; + child: LoroCounterLike + ) /*throws*/ : LoroCounterLike; insertListContainer( key: string, - child: LoroListInterface - ) /*throws*/ : LoroListInterface; - insertMapContainer( - key: string, - child: LoroMapInterface - ) /*throws*/ : LoroMapInterface; + child: LoroListLike + ) /*throws*/ : LoroListLike; + insertMapContainer(key: string, child: LoroMapLike) /*throws*/ : LoroMapLike; insertMovableListContainer( key: string, - child: LoroMovableListInterface - ) /*throws*/ : LoroMovableListInterface; + child: LoroMovableListLike + ) /*throws*/ : LoroMovableListLike; insertTextContainer( key: string, - child: LoroTextInterface - ) /*throws*/ : LoroTextInterface; + child: LoroTextLike + ) /*throws*/ : LoroTextLike; insertTreeContainer( key: string, - child: LoroTreeInterface - ) /*throws*/ : LoroTreeInterface; + child: LoroTreeLike + ) /*throws*/ : LoroTreeLike; /** * Whether the container is attached to a document. */ @@ -12363,17 +12818,21 @@ export interface LoroMapInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe(subscriber: Subscriber): SubscriptionInterface | undefined; + subscribe(subscriber: Subscriber): SubscriptionLike | undefined; /** * Get the values of the map. */ - values(): Array; + values(): Array; } +/** + * @deprecated Use `LoroMapLike` instead. + */ +export type LoroMapInterface = LoroMapLike; -export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { +export class LoroMap extends UniffiAbstractObject implements LoroMapLike { readonly [uniffiTypeNameSymbol] = 'LoroMap'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new container that is detached from the document. * @@ -12397,7 +12856,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Delete all key-value pairs in the map. */ - public clear(): void /*throws*/ { + clear(): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -12415,7 +12874,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Delete a key-value pair from the map. */ - public delete_(key: string): void /*throws*/ { + delete_(key: string): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -12434,7 +12893,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the LoroDoc from this container */ - public doc(): LoroDocInterface | undefined { + doc(): LoroDocLike | undefined { return FfiConverterOptionalTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12451,7 +12910,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the value of the map with the given key. */ - public get(key: string): ValueOrContainerInterface | undefined { + get(key: string): ValueOrContainer | undefined { return FfiConverterOptionalTypeValueOrContainer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12469,7 +12928,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * If a detached container is attached, this method will return its corresponding attached handler. */ - public getAttached(): LoroMapInterface | undefined { + getAttached(): LoroMapLike | undefined { return FfiConverterOptionalTypeLoroMap.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12488,7 +12947,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { * * It will convert the state of sub-containers into a nested JSON value. */ - public getDeepValue(): LoroValue { + getDeepValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12505,7 +12964,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the peer id of the last editor on the given entry */ - public getLastEditor(key: string): /*u64*/ bigint | undefined { + getLastEditor(key: string): /*u64*/ bigint | undefined { return FfiConverterOptionalUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12520,10 +12979,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public getOrCreateCounterContainer( + getOrCreateCounterContainer( key: string, - child: LoroCounterInterface - ): LoroCounterInterface /*throws*/ { + child: LoroCounterLike + ): LoroCounterLike /*throws*/ { return FfiConverterTypeLoroCounter.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12542,10 +13001,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public getOrCreateListContainer( + getOrCreateListContainer( key: string, - child: LoroListInterface - ): LoroListInterface /*throws*/ { + child: LoroListLike + ): LoroListLike /*throws*/ { return FfiConverterTypeLoroList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12564,10 +13023,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public getOrCreateMapContainer( + getOrCreateMapContainer( key: string, - child: LoroMapInterface - ): LoroMapInterface /*throws*/ { + child: LoroMapLike + ): LoroMapLike /*throws*/ { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12586,10 +13045,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public getOrCreateMovableListContainer( + getOrCreateMovableListContainer( key: string, - child: LoroMovableListInterface - ): LoroMovableListInterface /*throws*/ { + child: LoroMovableListLike + ): LoroMovableListLike /*throws*/ { return FfiConverterTypeLoroMovableList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12608,10 +13067,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public getOrCreateTextContainer( + getOrCreateTextContainer( key: string, - child: LoroTextInterface - ): LoroTextInterface /*throws*/ { + child: LoroTextLike + ): LoroTextLike /*throws*/ { return FfiConverterTypeLoroText.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12630,10 +13089,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public getOrCreateTreeContainer( + getOrCreateTreeContainer( key: string, - child: LoroTreeInterface - ): LoroTreeInterface /*throws*/ { + child: LoroTreeLike + ): LoroTreeLike /*throws*/ { return FfiConverterTypeLoroTree.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12657,7 +13116,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { * * It will not convert the state of sub-containers, but represent them as [LoroValue::Container]. */ - public getValue(): LoroValue { + getValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12674,7 +13133,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the ID of the map. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12694,7 +13153,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { * > **Note**: When calling `map.set(key, value)` on a LoroMap, if `map.get(key)` already returns `value`, * > the operation will be a no-op (no operation recorded) to avoid unnecessary updates. */ - public insert(key: string, v: LoroValueLike): void /*throws*/ { + insert(key: string, v: LoroValueLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -12711,10 +13170,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public insertCounterContainer( + insertCounterContainer( key: string, - child: LoroCounterInterface - ): LoroCounterInterface /*throws*/ { + child: LoroCounterLike + ): LoroCounterLike /*throws*/ { return FfiConverterTypeLoroCounter.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12733,10 +13192,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public insertListContainer( + insertListContainer( key: string, - child: LoroListInterface - ): LoroListInterface /*throws*/ { + child: LoroListLike + ): LoroListLike /*throws*/ { return FfiConverterTypeLoroList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12755,10 +13214,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public insertMapContainer( - key: string, - child: LoroMapInterface - ): LoroMapInterface /*throws*/ { + insertMapContainer(key: string, child: LoroMapLike): LoroMapLike /*throws*/ { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12777,10 +13233,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public insertMovableListContainer( + insertMovableListContainer( key: string, - child: LoroMovableListInterface - ): LoroMovableListInterface /*throws*/ { + child: LoroMovableListLike + ): LoroMovableListLike /*throws*/ { return FfiConverterTypeLoroMovableList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12799,10 +13255,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public insertTextContainer( + insertTextContainer( key: string, - child: LoroTextInterface - ): LoroTextInterface /*throws*/ { + child: LoroTextLike + ): LoroTextLike /*throws*/ { return FfiConverterTypeLoroText.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12821,10 +13277,10 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { ); } - public insertTreeContainer( + insertTreeContainer( key: string, - child: LoroTreeInterface - ): LoroTreeInterface /*throws*/ { + child: LoroTreeLike + ): LoroTreeLike /*throws*/ { return FfiConverterTypeLoroTree.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -12846,7 +13302,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Whether the container is attached to a document. */ - public isAttached(): boolean { + isAttached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12863,7 +13319,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Whether the container is deleted. */ - public isDeleted(): boolean { + isDeleted(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12880,7 +13336,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Whether the map is empty. */ - public isEmpty(): boolean { + isEmpty(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12897,7 +13353,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the keys of the map. */ - public keys(): Array { + keys(): Array { return FfiConverterArrayString.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12914,7 +13370,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the length of the map. */ - public len(): /*u32*/ number { + len(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12941,7 +13397,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe(subscriber: Subscriber): SubscriptionInterface | undefined { + subscribe(subscriber: Subscriber): SubscriptionLike | undefined { return FfiConverterOptionalTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12959,7 +13415,7 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { /** * Get the values of the map. */ - public values(): Array { + values(): Array { return FfiConverterArrayTypeValueOrContainer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -12991,72 +13447,75 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapInterface { } } -const uniffiTypeLoroMapObjectFactory: UniffiObjectFactory = { - create(pointer: UnsafeMutableRawPointer): LoroMapInterface { - const instance = Object.create(LoroMap.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroMap'; - return instance; - }, +const uniffiTypeLoroMapObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroMapLike { + const instance = Object.create(LoroMap.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroMap'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_loromap_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_loromap_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LoroMapInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LoroMapLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LoroMapInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_loromap( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroMapLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_loromap( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_loromap( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_loromap( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroMapInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroMap' - ); - }, -}; -// FfiConverter for LoroMapInterface + isConcreteType(obj: any): obj is LoroMapLike { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroMap' + ); + }, + }; + })(); +// FfiConverter for LoroMapLike const FfiConverterTypeLoroMap = new FfiConverterObject( uniffiTypeLoroMapObjectFactory ); -export interface LoroMovableListInterface { +export interface LoroMovableListLike { /** * Delete all elements in the list. */ @@ -13068,15 +13527,15 @@ export interface LoroMovableListInterface { /** * Get the LoroDoc from this container */ - doc(): LoroDocInterface | undefined; + doc(): LoroDocLike | undefined; /** * Get the value at the given position. */ - get(index: /*u32*/ number): ValueOrContainerInterface | undefined; + get(index: /*u32*/ number): ValueOrContainer | undefined; /** * If a detached container is attached, this method will return its corresponding attached handler. */ - getAttached(): LoroMovableListInterface | undefined; + getAttached(): LoroMovableListLike | undefined; getCreatorAt(pos: /*u32*/ number): /*u64*/ bigint | undefined; /** * Get the cursor at the given position. @@ -13093,7 +13552,7 @@ export interface LoroMovableListInterface { * updates cursor info to reference only the IDs of currently present elements, * thereby reducing the need for replay. */ - getCursor(pos: /*u32*/ number, side: Side): CursorInterface | undefined; + getCursor(pos: /*u32*/ number, side: Side): CursorLike | undefined; /** * Get the deep value of the container. */ @@ -13122,28 +13581,28 @@ export interface LoroMovableListInterface { insert(pos: /*u32*/ number, v: LoroValueLike) /*throws*/ : void; insertCounterContainer( pos: /*u32*/ number, - child: LoroCounterInterface - ) /*throws*/ : LoroCounterInterface; + child: LoroCounterLike + ) /*throws*/ : LoroCounterLike; insertListContainer( pos: /*u32*/ number, - child: LoroListInterface - ) /*throws*/ : LoroListInterface; + child: LoroListLike + ) /*throws*/ : LoroListLike; insertMapContainer( pos: /*u32*/ number, - child: LoroMapInterface - ) /*throws*/ : LoroMapInterface; + child: LoroMapLike + ) /*throws*/ : LoroMapLike; insertMovableListContainer( pos: /*u32*/ number, - child: LoroMovableListInterface - ) /*throws*/ : LoroMovableListInterface; + child: LoroMovableListLike + ) /*throws*/ : LoroMovableListLike; insertTextContainer( pos: /*u32*/ number, - child: LoroTextInterface - ) /*throws*/ : LoroTextInterface; + child: LoroTextLike + ) /*throws*/ : LoroTextLike; insertTreeContainer( pos: /*u32*/ number, - child: LoroTreeInterface - ) /*throws*/ : LoroTreeInterface; + child: LoroTreeLike + ) /*throws*/ : LoroTreeLike; /** * Whether the container is attached to a document * @@ -13164,7 +13623,7 @@ export interface LoroMovableListInterface { /** * Pop the last element of the list. */ - pop() /*throws*/ : ValueOrContainerInterface | undefined; + pop() /*throws*/ : ValueOrContainer | undefined; push(v: LoroValueLike) /*throws*/ : void; /** * Set the value at the given position. @@ -13172,28 +13631,28 @@ export interface LoroMovableListInterface { set(pos: /*u32*/ number, value: LoroValueLike) /*throws*/ : void; setCounterContainer( pos: /*u32*/ number, - child: LoroCounterInterface - ) /*throws*/ : LoroCounterInterface; + child: LoroCounterLike + ) /*throws*/ : LoroCounterLike; setListContainer( pos: /*u32*/ number, - child: LoroListInterface - ) /*throws*/ : LoroListInterface; + child: LoroListLike + ) /*throws*/ : LoroListLike; setMapContainer( pos: /*u32*/ number, - child: LoroMapInterface - ) /*throws*/ : LoroMapInterface; + child: LoroMapLike + ) /*throws*/ : LoroMapLike; setMovableListContainer( pos: /*u32*/ number, - child: LoroMovableListInterface - ) /*throws*/ : LoroMovableListInterface; + child: LoroMovableListLike + ) /*throws*/ : LoroMovableListLike; setTextContainer( pos: /*u32*/ number, - child: LoroTextInterface - ) /*throws*/ : LoroTextInterface; + child: LoroTextLike + ) /*throws*/ : LoroTextLike; setTreeContainer( pos: /*u32*/ number, - child: LoroTreeInterface - ) /*throws*/ : LoroTreeInterface; + child: LoroTreeLike + ) /*throws*/ : LoroTreeLike; /** * Subscribe the events of a container. * @@ -13207,7 +13666,7 @@ export interface LoroMovableListInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe(subscriber: Subscriber): SubscriptionInterface | undefined; + subscribe(subscriber: Subscriber): SubscriptionLike | undefined; /** * Get the elements of the list as a vector of LoroValues. * @@ -13217,14 +13676,18 @@ export interface LoroMovableListInterface { */ toVec(): Array; } +/** + * @deprecated Use `LoroMovableListLike` instead. + */ +export type LoroMovableListInterface = LoroMovableListLike; export class LoroMovableList extends UniffiAbstractObject - implements LoroMovableListInterface + implements LoroMovableListLike { readonly [uniffiTypeNameSymbol] = 'LoroMovableList'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new container that is detached from the document. * @@ -13249,7 +13712,7 @@ export class LoroMovableList /** * Delete all elements in the list. */ - public clear(): void /*throws*/ { + clear(): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -13267,7 +13730,7 @@ export class LoroMovableList /** * Delete values at the given position. */ - public delete_(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { + delete_(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -13287,7 +13750,7 @@ export class LoroMovableList /** * Get the LoroDoc from this container */ - public doc(): LoroDocInterface | undefined { + doc(): LoroDocLike | undefined { return FfiConverterOptionalTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13304,7 +13767,7 @@ export class LoroMovableList /** * Get the value at the given position. */ - public get(index: /*u32*/ number): ValueOrContainerInterface | undefined { + get(index: /*u32*/ number): ValueOrContainer | undefined { return FfiConverterOptionalTypeValueOrContainer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13322,7 +13785,7 @@ export class LoroMovableList /** * If a detached container is attached, this method will return its corresponding attached handler. */ - public getAttached(): LoroMovableListInterface | undefined { + getAttached(): LoroMovableListLike | undefined { return FfiConverterOptionalTypeLoroMovableList.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13336,7 +13799,7 @@ export class LoroMovableList ); } - public getCreatorAt(pos: /*u32*/ number): /*u64*/ bigint | undefined { + getCreatorAt(pos: /*u32*/ number): /*u64*/ bigint | undefined { return FfiConverterOptionalUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13366,10 +13829,7 @@ export class LoroMovableList * updates cursor info to reference only the IDs of currently present elements, * thereby reducing the need for replay. */ - public getCursor( - pos: /*u32*/ number, - side: Side - ): CursorInterface | undefined { + getCursor(pos: /*u32*/ number, side: Side): CursorLike | undefined { return FfiConverterOptionalTypeCursor.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13388,7 +13848,7 @@ export class LoroMovableList /** * Get the deep value of the container. */ - public getDeepValue(): LoroValue { + getDeepValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13405,7 +13865,7 @@ export class LoroMovableList /** * Get the last editor of the list item at the given position. */ - public getLastEditorAt(pos: /*u32*/ number): /*u64*/ bigint | undefined { + getLastEditorAt(pos: /*u32*/ number): /*u64*/ bigint | undefined { return FfiConverterOptionalUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13423,7 +13883,7 @@ export class LoroMovableList /** * Get the last mover of the list item at the given position. */ - public getLastMoverAt(pos: /*u32*/ number): /*u64*/ bigint | undefined { + getLastMoverAt(pos: /*u32*/ number): /*u64*/ bigint | undefined { return FfiConverterOptionalUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13443,7 +13903,7 @@ export class LoroMovableList * * This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container]. */ - public getValue(): LoroValue { + getValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13460,7 +13920,7 @@ export class LoroMovableList /** * Get the container id. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13477,7 +13937,7 @@ export class LoroMovableList /** * Insert a value at the given position. */ - public insert(pos: /*u32*/ number, v: LoroValueLike): void /*throws*/ { + insert(pos: /*u32*/ number, v: LoroValueLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -13494,10 +13954,10 @@ export class LoroMovableList ); } - public insertCounterContainer( + insertCounterContainer( pos: /*u32*/ number, - child: LoroCounterInterface - ): LoroCounterInterface /*throws*/ { + child: LoroCounterLike + ): LoroCounterLike /*throws*/ { return FfiConverterTypeLoroCounter.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13516,10 +13976,10 @@ export class LoroMovableList ); } - public insertListContainer( + insertListContainer( pos: /*u32*/ number, - child: LoroListInterface - ): LoroListInterface /*throws*/ { + child: LoroListLike + ): LoroListLike /*throws*/ { return FfiConverterTypeLoroList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13538,10 +13998,10 @@ export class LoroMovableList ); } - public insertMapContainer( + insertMapContainer( pos: /*u32*/ number, - child: LoroMapInterface - ): LoroMapInterface /*throws*/ { + child: LoroMapLike + ): LoroMapLike /*throws*/ { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13560,10 +14020,10 @@ export class LoroMovableList ); } - public insertMovableListContainer( + insertMovableListContainer( pos: /*u32*/ number, - child: LoroMovableListInterface - ): LoroMovableListInterface /*throws*/ { + child: LoroMovableListLike + ): LoroMovableListLike /*throws*/ { return FfiConverterTypeLoroMovableList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13582,10 +14042,10 @@ export class LoroMovableList ); } - public insertTextContainer( + insertTextContainer( pos: /*u32*/ number, - child: LoroTextInterface - ): LoroTextInterface /*throws*/ { + child: LoroTextLike + ): LoroTextLike /*throws*/ { return FfiConverterTypeLoroText.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13604,10 +14064,10 @@ export class LoroMovableList ); } - public insertTreeContainer( + insertTreeContainer( pos: /*u32*/ number, - child: LoroTreeInterface - ): LoroTreeInterface /*throws*/ { + child: LoroTreeLike + ): LoroTreeLike /*throws*/ { return FfiConverterTypeLoroTree.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13632,7 +14092,7 @@ export class LoroMovableList * The edits on a detached container will not be persisted. * To attach the container to the document, please insert it into an attached container. */ - public isAttached(): boolean { + isAttached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13649,7 +14109,7 @@ export class LoroMovableList /** * Whether the container is deleted. */ - public isDeleted(): boolean { + isDeleted(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13663,7 +14123,7 @@ export class LoroMovableList ); } - public isEmpty(): boolean { + isEmpty(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13677,7 +14137,7 @@ export class LoroMovableList ); } - public len(): /*u32*/ number { + len(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13694,7 +14154,7 @@ export class LoroMovableList /** * Move the value at the given position to the given position. */ - public mov(from: /*u32*/ number, to: /*u32*/ number): void /*throws*/ { + mov(from: /*u32*/ number, to: /*u32*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -13714,7 +14174,7 @@ export class LoroMovableList /** * Pop the last element of the list. */ - public pop(): ValueOrContainerInterface | undefined /*throws*/ { + pop(): ValueOrContainer | undefined /*throws*/ { return FfiConverterOptionalTypeValueOrContainer.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13731,7 +14191,7 @@ export class LoroMovableList ); } - public push(v: LoroValueLike): void /*throws*/ { + push(v: LoroValueLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -13750,7 +14210,7 @@ export class LoroMovableList /** * Set the value at the given position. */ - public set(pos: /*u32*/ number, value: LoroValueLike): void /*throws*/ { + set(pos: /*u32*/ number, value: LoroValueLike): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -13767,10 +14227,10 @@ export class LoroMovableList ); } - public setCounterContainer( + setCounterContainer( pos: /*u32*/ number, - child: LoroCounterInterface - ): LoroCounterInterface /*throws*/ { + child: LoroCounterLike + ): LoroCounterLike /*throws*/ { return FfiConverterTypeLoroCounter.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13789,10 +14249,10 @@ export class LoroMovableList ); } - public setListContainer( + setListContainer( pos: /*u32*/ number, - child: LoroListInterface - ): LoroListInterface /*throws*/ { + child: LoroListLike + ): LoroListLike /*throws*/ { return FfiConverterTypeLoroList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13811,10 +14271,10 @@ export class LoroMovableList ); } - public setMapContainer( + setMapContainer( pos: /*u32*/ number, - child: LoroMapInterface - ): LoroMapInterface /*throws*/ { + child: LoroMapLike + ): LoroMapLike /*throws*/ { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13833,10 +14293,10 @@ export class LoroMovableList ); } - public setMovableListContainer( + setMovableListContainer( pos: /*u32*/ number, - child: LoroMovableListInterface - ): LoroMovableListInterface /*throws*/ { + child: LoroMovableListLike + ): LoroMovableListLike /*throws*/ { return FfiConverterTypeLoroMovableList.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13855,10 +14315,10 @@ export class LoroMovableList ); } - public setTextContainer( + setTextContainer( pos: /*u32*/ number, - child: LoroTextInterface - ): LoroTextInterface /*throws*/ { + child: LoroTextLike + ): LoroTextLike /*throws*/ { return FfiConverterTypeLoroText.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13877,10 +14337,10 @@ export class LoroMovableList ); } - public setTreeContainer( + setTreeContainer( pos: /*u32*/ number, - child: LoroTreeInterface - ): LoroTreeInterface /*throws*/ { + child: LoroTreeLike + ): LoroTreeLike /*throws*/ { return FfiConverterTypeLoroTree.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -13912,7 +14372,7 @@ export class LoroMovableList * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe(subscriber: Subscriber): SubscriptionInterface | undefined { + subscribe(subscriber: Subscriber): SubscriptionLike | undefined { return FfiConverterOptionalTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13934,7 +14394,7 @@ export class LoroMovableList * It provides a convenient way to access the entire contents of the LoroMovableList * as a standard Rust vector. */ - public toVec(): Array { + toVec(): Array { return FfiConverterArrayTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -13966,74 +14426,76 @@ export class LoroMovableList } } -const uniffiTypeLoroMovableListObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroMovableListInterface { - const instance = Object.create(LoroMovableList.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroMovableList'; - return instance; - }, - - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_loromovablelist_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, - - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, - - pointer(obj: LoroMovableListInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, +const uniffiTypeLoroMovableListObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroMovableListLike { + const instance = Object.create(LoroMovableList.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroMovableList'; + return instance; + }, - clonePointer(obj: LoroMovableListInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_loromovablelist( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_loromovablelist_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_loromovablelist( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - isConcreteType(obj: any): obj is LoroMovableListInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'LoroMovableList' - ); - }, - }; -// FfiConverter for LoroMovableListInterface + pointer(obj: LoroMovableListLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, + + clonePointer(obj: LoroMovableListLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_loromovablelist( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_loromovablelist( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + isConcreteType(obj: any): obj is LoroMovableListLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'LoroMovableList' + ); + }, + }; + })(); +// FfiConverter for LoroMovableListLike const FfiConverterTypeLoroMovableList = new FfiConverterObject( uniffiTypeLoroMovableListObjectFactory ); -export interface LoroTextInterface { +export interface LoroTextLike { /** * Apply a [delta](https://quilljs.com/docs/delta/) to the text container. */ @@ -14042,10 +14504,22 @@ export interface LoroTextInterface { * Get the characters at given unicode position. */ charAt(pos: /*u32*/ number) /*throws*/ : string; + /** + * Convert a position between coordinate systems (Unicode, UTF-16, UTF-8 bytes, Event). + */ + convertPos( + index: /*u32*/ number, + from: PosType, + to: PosType + ): /*u32*/ number | undefined; /** * Delete a range of text at the given unicode position with unicode length. */ delete_(pos: /*u32*/ number, len: /*u32*/ number) /*throws*/ : void; + /** + * Delete a range of text at the given utf-16 position with utf-16 length. + */ + deleteUtf16(pos: /*u32*/ number, len: /*u32*/ number) /*throws*/ : void; /** * Delete a range of text at the given utf-8 position with utf-8 length. */ @@ -14053,11 +14527,11 @@ export interface LoroTextInterface { /** * Get the LoroDoc from this container */ - doc(): LoroDocInterface | undefined; + doc(): LoroDocLike | undefined; /** * If a detached container is attached, this method will return its corresponding attached handler. */ - getAttached(): LoroTextInterface | undefined; + getAttached(): LoroTextLike | undefined; /** * Get the cursor at the given position in the given Unicode position.. * @@ -14073,7 +14547,7 @@ export interface LoroTextInterface { * updates cursor info to reference only the IDs of currently present elements, * thereby reducing the need for replay. */ - getCursor(pos: /*u32*/ number, side: Side): CursorInterface | undefined; + getCursor(pos: /*u32*/ number, side: Side): CursorLike | undefined; /** * Get the editor of the text at the given position. */ @@ -14090,6 +14564,10 @@ export interface LoroTextInterface { * Insert a string at the given unicode position. */ insert(pos: /*u32*/ number, s: string) /*throws*/ : void; + /** + * Insert a string at the given utf-16 position. + */ + insertUtf16(pos: /*u32*/ number, s: string) /*throws*/ : void; /** * Insert a string at the given utf-8 position. */ @@ -14143,6 +14621,24 @@ export interface LoroTextInterface { key: string, value: LoroValueLike ) /*throws*/ : void; + /** + * Mark a range of text with UTF-16 offsets. + */ + markUtf16( + from: /*u32*/ number, + to: /*u32*/ number, + key: string, + value: LoroValueLike + ) /*throws*/ : void; + /** + * Mark a range of text with UTF-8 offsets. + */ + markUtf8( + from: /*u32*/ number, + to: /*u32*/ number, + key: string, + value: LoroValueLike + ) /*throws*/ : void; /** * Push a string to the end of the text container. */ @@ -14154,6 +14650,21 @@ export interface LoroTextInterface { startIndex: /*u32*/ number, endIndex: /*u32*/ number ) /*throws*/ : string; + /** + * Get the rich-text delta within a range. + */ + sliceDelta( + startIndex: /*u32*/ number, + endIndex: /*u32*/ number, + posType: PosType + ) /*throws*/ : Array; + /** + * Get a string slice at the given UTF-16 range + */ + sliceUtf16( + startIndex: /*u32*/ number, + endIndex: /*u32*/ number + ) /*throws*/ : string; /** * Delete specified character and insert string at the same position at given unicode position. */ @@ -14162,6 +14673,14 @@ export interface LoroTextInterface { len: /*u32*/ number, s: string ) /*throws*/ : string; + /** + * Delete specified range and insert a string at the same UTF-16 position. + */ + spliceUtf16( + pos: /*u32*/ number, + len: /*u32*/ number, + s: string + ) /*throws*/ : void; /** * Subscribe the events of a container. * @@ -14175,15 +14694,11 @@ export interface LoroTextInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe(subscriber: Subscriber): SubscriptionInterface | undefined; + subscribe(subscriber: Subscriber): SubscriptionLike | undefined; /** * Get the text in [Delta](https://quilljs.com/docs/delta/) format. */ toDelta(): Array; - /** - * Get the text content of the text container. - */ - toString(): string; /** * Unmark a range of text with a key and a value. * @@ -14207,6 +14722,14 @@ export interface LoroTextInterface { to: /*u32*/ number, key: string ) /*throws*/ : void; + /** + * Unmark a UTF-16 range of text with a key. + */ + unmarkUtf16( + from: /*u32*/ number, + to: /*u32*/ number, + key: string + ) /*throws*/ : void; /** * Update the current text based on the provided text. * @@ -14224,14 +14747,15 @@ export interface LoroTextInterface { */ updateByLine(s: string, options: UpdateOptions) /*throws*/ : void; } +/** + * @deprecated Use `LoroTextLike` instead. + */ +export type LoroTextInterface = LoroTextLike; -export class LoroText - extends UniffiAbstractObject - implements LoroTextInterface -{ +export class LoroText extends UniffiAbstractObject implements LoroTextLike { readonly [uniffiTypeNameSymbol] = 'LoroText'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new container that is detached from the document. * @@ -14256,7 +14780,7 @@ export class LoroText /** * Apply a [delta](https://quilljs.com/docs/delta/) to the text container. */ - public applyDelta(delta: Array): void /*throws*/ { + applyDelta(delta: Array): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -14275,7 +14799,7 @@ export class LoroText /** * Get the characters at given unicode position. */ - public charAt(pos: /*u32*/ number): string /*throws*/ { + charAt(pos: /*u32*/ number): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -14293,10 +14817,34 @@ export class LoroText ); } + /** + * Convert a position between coordinate systems (Unicode, UTF-16, UTF-8 bytes, Event). + */ + convertPos( + index: /*u32*/ number, + from: PosType, + to: PosType + ): /*u32*/ number | undefined { + return FfiConverterOptionalUInt32.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_convert_pos( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(index), + FfiConverterTypePosType.lower(from), + FfiConverterTypePosType.lower(to), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * Delete a range of text at the given unicode position with unicode length. */ - public delete_(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { + delete_(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -14313,10 +14861,30 @@ export class LoroText ); } + /** + * Delete a range of text at the given utf-16 position with utf-16 length. + */ + deleteUtf16(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_delete_utf16( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(pos), + FfiConverterUInt32.lower(len), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + /** * Delete a range of text at the given utf-8 position with utf-8 length. */ - public deleteUtf8(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { + deleteUtf8(pos: /*u32*/ number, len: /*u32*/ number): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -14336,7 +14904,7 @@ export class LoroText /** * Get the LoroDoc from this container */ - public doc(): LoroDocInterface | undefined { + doc(): LoroDocLike | undefined { return FfiConverterOptionalTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14353,7 +14921,7 @@ export class LoroText /** * If a detached container is attached, this method will return its corresponding attached handler. */ - public getAttached(): LoroTextInterface | undefined { + getAttached(): LoroTextLike | undefined { return FfiConverterOptionalTypeLoroText.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14382,10 +14950,7 @@ export class LoroText * updates cursor info to reference only the IDs of currently present elements, * thereby reducing the need for replay. */ - public getCursor( - pos: /*u32*/ number, - side: Side - ): CursorInterface | undefined { + getCursor(pos: /*u32*/ number, side: Side): CursorLike | undefined { return FfiConverterOptionalTypeCursor.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14404,9 +14969,7 @@ export class LoroText /** * Get the editor of the text at the given position. */ - public getEditorAtUnicodePos( - pos: /*u32*/ number - ): /*u64*/ bigint | undefined { + getEditorAtUnicodePos(pos: /*u32*/ number): /*u64*/ bigint | undefined { return FfiConverterOptionalUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14424,7 +14987,7 @@ export class LoroText /** * Get the text in [Delta](https://quilljs.com/docs/delta/) format. */ - public getRichtextValue(): LoroValue { + getRichtextValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14441,7 +15004,7 @@ export class LoroText /** * Get the [ContainerID] of the text container. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14458,7 +15021,7 @@ export class LoroText /** * Insert a string at the given unicode position. */ - public insert(pos: /*u32*/ number, s: string): void /*throws*/ { + insert(pos: /*u32*/ number, s: string): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -14475,10 +15038,30 @@ export class LoroText ); } + /** + * Insert a string at the given utf-16 position. + */ + insertUtf16(pos: /*u32*/ number, s: string): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_insert_utf16( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(pos), + FfiConverterString.lower(s), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + /** * Insert a string at the given utf-8 position. */ - public insertUtf8(pos: /*u32*/ number, s: string): void /*throws*/ { + insertUtf8(pos: /*u32*/ number, s: string): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -14501,7 +15084,7 @@ export class LoroText * The edits on a detached container will not be persisted. * To attach the container to the document, please insert it into an attached container. */ - public isAttached(): boolean { + isAttached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14518,7 +15101,7 @@ export class LoroText /** * Whether the container is deleted. */ - public isDeleted(): boolean { + isDeleted(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14535,7 +15118,7 @@ export class LoroText /** * Whether the text container is empty. */ - public isEmpty(): boolean { + isEmpty(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14552,7 +15135,7 @@ export class LoroText /** * Get the length of the text container in Unicode. */ - public lenUnicode(): /*u32*/ number { + lenUnicode(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14569,7 +15152,7 @@ export class LoroText /** * Get the length of the text container in UTF-16. */ - public lenUtf16(): /*u32*/ number { + lenUtf16(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14586,7 +15169,7 @@ export class LoroText /** * Get the length of the text container in UTF-8. */ - public lenUtf8(): /*u32*/ number { + lenUtf8(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14616,7 +15199,7 @@ export class LoroText * * Note: this is not suitable for unmergeable annotations like comments. */ - public mark( + mark( from: /*u32*/ number, to: /*u32*/ number, key: string, @@ -14640,10 +15223,64 @@ export class LoroText ); } + /** + * Mark a range of text with UTF-16 offsets. + */ + markUtf16( + from: /*u32*/ number, + to: /*u32*/ number, + key: string, + value: LoroValueLike + ): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_mark_utf16( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(from), + FfiConverterUInt32.lower(to), + FfiConverterString.lower(key), + FfiConverterTypeLoroValueLike.lower(value), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + + /** + * Mark a range of text with UTF-8 offsets. + */ + markUtf8( + from: /*u32*/ number, + to: /*u32*/ number, + key: string, + value: LoroValueLike + ): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_mark_utf8( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(from), + FfiConverterUInt32.lower(to), + FfiConverterString.lower(key), + FfiConverterTypeLoroValueLike.lower(value), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + /** * Push a string to the end of the text container. */ - public pushStr(s: string): void /*throws*/ { + pushStr(s: string): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -14662,7 +15299,7 @@ export class LoroText /** * Get a string slice at the given Unicode range */ - public slice( + slice( startIndex: /*u32*/ number, endIndex: /*u32*/ number ): string /*throws*/ { @@ -14684,10 +15321,62 @@ export class LoroText ); } + /** + * Get the rich-text delta within a range. + */ + sliceDelta( + startIndex: /*u32*/ number, + endIndex: /*u32*/ number, + posType: PosType + ): Array /*throws*/ { + return FfiConverterArrayTypeTextDelta.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_slice_delta( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(startIndex), + FfiConverterUInt32.lower(endIndex), + FfiConverterTypePosType.lower(posType), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + /** + * Get a string slice at the given UTF-16 range + */ + sliceUtf16( + startIndex: /*u32*/ number, + endIndex: /*u32*/ number + ): string /*throws*/ { + return FfiConverterString.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_slice_utf16( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(startIndex), + FfiConverterUInt32.lower(endIndex), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * Delete specified character and insert string at the same position at given unicode position. */ - public splice( + splice( pos: /*u32*/ number, len: /*u32*/ number, s: string @@ -14711,6 +15400,31 @@ export class LoroText ); } + /** + * Delete specified range and insert a string at the same UTF-16 position. + */ + spliceUtf16( + pos: /*u32*/ number, + len: /*u32*/ number, + s: string + ): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_splice_utf16( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(pos), + FfiConverterUInt32.lower(len), + FfiConverterString.lower(s), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + /** * Subscribe the events of a container. * @@ -14724,7 +15438,7 @@ export class LoroText * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe(subscriber: Subscriber): SubscriptionInterface | undefined { + subscribe(subscriber: Subscriber): SubscriptionLike | undefined { return FfiConverterOptionalTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -14740,30 +15454,13 @@ export class LoroText } /** - * Get the text in [Delta](https://quilljs.com/docs/delta/) format. - */ - public toDelta(): Array { - return FfiConverterArrayTypeTextDelta.lift( - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => { - return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_to_delta( - uniffiTypeLoroTextObjectFactory.clonePointer(this), - callStatus - ); - }, - /*liftString:*/ FfiConverterString.lift - ) - ); - } - - /** - * Get the text content of the text container. + * Get the text in [Delta](https://quilljs.com/docs/delta/) format. */ - public toString(): string { - return FfiConverterString.lift( + toDelta(): Array { + return FfiConverterArrayTypeTextDelta.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { - return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_to_string( + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_to_delta( uniffiTypeLoroTextObjectFactory.clonePointer(this), callStatus ); @@ -14791,7 +15488,7 @@ export class LoroText * * Note: you cannot delete unmergeable annotations like comments by this method. */ - public unmark( + unmark( from: /*u32*/ number, to: /*u32*/ number, key: string @@ -14813,6 +15510,31 @@ export class LoroText ); } + /** + * Unmark a UTF-16 range of text with a key. + */ + unmarkUtf16( + from: /*u32*/ number, + to: /*u32*/ number, + key: string + ): void /*throws*/ { + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_unmark_utf16( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + FfiConverterUInt32.lower(from), + FfiConverterUInt32.lower(to), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ); + } + /** * Update the current text based on the provided text. * @@ -14822,7 +15544,7 @@ export class LoroText * This could take a long time for large texts (e.g. > 50_000 characters). * In that case, you should use `updateByLine` instead. */ - public update(s: string, options: UpdateOptions): void /*throws*/ { + update(s: string, options: UpdateOptions): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeUpdateTimeoutError.lift.bind( FfiConverterTypeUpdateTimeoutError @@ -14844,7 +15566,7 @@ export class LoroText * * This update calculation is line-based, which will be more efficient but less precise. */ - public updateByLine(s: string, options: UpdateOptions): void /*throws*/ { + updateByLine(s: string, options: UpdateOptions): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeUpdateTimeoutError.lift.bind( FfiConverterTypeUpdateTimeoutError @@ -14861,6 +15583,25 @@ export class LoroText ); } + /** + * Calls into the `LoroTextLike::to_string()` method of the native Rust peer. + * + * Generated by deriving the `Display` trait in Rust. + */ + toString(): string { + return FfiConverterString.lift( + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotext_uniffi_trait_display( + uniffiTypeLoroTextObjectFactory.clonePointer(this), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} */ @@ -14879,73 +15620,75 @@ export class LoroText } } -const uniffiTypeLoroTextObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroTextInterface { - const instance = Object.create(LoroText.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroText'; - return instance; - }, +const uniffiTypeLoroTextObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroTextLike { + const instance = Object.create(LoroText.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroText'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorotext_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorotext_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LoroTextInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LoroTextLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LoroTextInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorotext( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroTextLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorotext( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorotext( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorotext( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroTextInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroText' - ); - }, - }; -// FfiConverter for LoroTextInterface + isConcreteType(obj: any): obj is LoroTextLike { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroText' + ); + }, + }; + })(); +// FfiConverter for LoroTextLike const FfiConverterTypeLoroText = new FfiConverterObject( uniffiTypeLoroTextObjectFactory ); -export interface LoroTreeInterface { +export interface LoroTreeLike { /** * Return all children of the target node. * @@ -14992,7 +15735,7 @@ export interface LoroTreeInterface { /** * Get the LoroDoc from this container */ - doc(): LoroDocInterface | undefined; + doc(): LoroDocLike | undefined; /** * Enable fractional index for Tree Position. * @@ -15010,7 +15753,7 @@ export interface LoroTreeInterface { /** * If a detached container is attached, this method will return its corresponding attached handler. */ - getAttached(): LoroTreeInterface | undefined; + getAttached(): LoroTreeLike | undefined; /** * Get the last move id of the target node. */ @@ -15018,7 +15761,7 @@ export interface LoroTreeInterface { /** * Get the associated metadata map handler of a tree node. */ - getMeta(target: TreeId) /*throws*/ : LoroMapInterface; + getMeta(target: TreeId) /*throws*/ : LoroMapLike; /** * Return the flat array of the forest. * @@ -15107,16 +15850,17 @@ export interface LoroTreeInterface { * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - subscribe(subscriber: Subscriber): SubscriptionInterface | undefined; + subscribe(subscriber: Subscriber): SubscriptionLike | undefined; } +/** + * @deprecated Use `LoroTreeLike` instead. + */ +export type LoroTreeInterface = LoroTreeLike; -export class LoroTree - extends UniffiAbstractObject - implements LoroTreeInterface -{ +export class LoroTree extends UniffiAbstractObject implements LoroTreeLike { readonly [uniffiTypeNameSymbol] = 'LoroTree'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new container that is detached from the document. * @@ -15143,7 +15887,7 @@ export class LoroTree * * If the parent node does not exist, return `None`. */ - public children(parent: TreeParentId): Array | undefined { + children(parent: TreeParentId): Array | undefined { return FfiConverterOptionalArrayTypeTreeID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15161,7 +15905,7 @@ export class LoroTree /** * Return the number of children of the target node. */ - public childrenNum(parent: TreeParentId): /*u32*/ number | undefined { + childrenNum(parent: TreeParentId): /*u32*/ number | undefined { return FfiConverterOptionalUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15179,7 +15923,7 @@ export class LoroTree /** * Return whether target node exists. */ - public contains(target: TreeId): boolean { + contains(target: TreeId): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15200,7 +15944,7 @@ export class LoroTree * If the `parent` is `None`, the created node is the root of a tree. * Otherwise, the created node is a child of the parent tree node. */ - public create(parent: TreeParentId): TreeId /*throws*/ { + create(parent: TreeParentId): TreeId /*throws*/ { return FfiConverterTypeTreeID.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -15224,10 +15968,7 @@ export class LoroTree * If the `parent` is `None`, the created node is the root of a tree. * If the `index` is greater than the number of children of the parent, error will be returned. */ - public createAt( - parent: TreeParentId, - index: /*u32*/ number - ): TreeId /*throws*/ { + createAt(parent: TreeParentId, index: /*u32*/ number): TreeId /*throws*/ { return FfiConverterTypeTreeID.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -15252,7 +15993,7 @@ export class LoroTree * Note: If the deleted node has children, the children do not appear in the state * rather than actually being deleted. */ - public delete_(target: TreeId): void /*throws*/ { + delete_(target: TreeId): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -15275,7 +16016,7 @@ export class LoroTree * After calling this, you cannot use `tree.moveTo()`, `tree.moveBefore()`, `tree.moveAfter()`, * and `tree.createAt()`. */ - public disableFractionalIndex(): void { + disableFractionalIndex(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotree_disable_fractional_index( @@ -15290,7 +16031,7 @@ export class LoroTree /** * Get the LoroDoc from this container */ - public doc(): LoroDocInterface | undefined { + doc(): LoroDocLike | undefined { return FfiConverterOptionalTypeLoroDoc.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15313,7 +16054,7 @@ export class LoroTree * Generally speaking, jitter will affect the growth rate of document size. * [Read more about it](https://www.loro.dev/blog/movable-tree#implementation-and-encoding-size) */ - public enableFractionalIndex(jitter: /*u8*/ number): void { + enableFractionalIndex(jitter: /*u8*/ number): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_lorotree_enable_fractional_index( @@ -15329,7 +16070,7 @@ export class LoroTree /** * Return the fractional index of the target node with hex format. */ - public fractionalIndex(target: TreeId): string | undefined { + fractionalIndex(target: TreeId): string | undefined { return FfiConverterOptionalString.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15347,7 +16088,7 @@ export class LoroTree /** * If a detached container is attached, this method will return its corresponding attached handler. */ - public getAttached(): LoroTreeInterface | undefined { + getAttached(): LoroTreeLike | undefined { return FfiConverterOptionalTypeLoroTree.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15364,7 +16105,7 @@ export class LoroTree /** * Get the last move id of the target node. */ - public getLastMoveId(target: TreeId): Id | undefined { + getLastMoveId(target: TreeId): Id | undefined { return FfiConverterOptionalTypeID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15382,7 +16123,7 @@ export class LoroTree /** * Get the associated metadata map handler of a tree node. */ - public getMeta(target: TreeId): LoroMapInterface /*throws*/ { + getMeta(target: TreeId): LoroMapLike /*throws*/ { return FfiConverterTypeLoroMap.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -15406,7 +16147,7 @@ export class LoroTree * Note: the metadata will be not resolved. So if you don't only care about hierarchy * but also the metadata, you should use `get_value_with_meta()`. */ - public getValue(): LoroValue { + getValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15423,7 +16164,7 @@ export class LoroTree /** * Return the flat array of the forest, each node is with metadata. */ - public getValueWithMeta(): LoroValue { + getValueWithMeta(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15440,7 +16181,7 @@ export class LoroTree /** * Return container id of the tree. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15460,7 +16201,7 @@ export class LoroTree * The edits on a detached container will not be persisted. * To attach the container to the document, please insert it into an attached container. */ - public isAttached(): boolean { + isAttached(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15477,7 +16218,7 @@ export class LoroTree /** * Whether the container is deleted. */ - public isDeleted(): boolean { + isDeleted(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15494,7 +16235,7 @@ export class LoroTree /** * Whether the fractional index is enabled. */ - public isFractionalIndexEnabled(): boolean { + isFractionalIndexEnabled(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15514,7 +16255,7 @@ export class LoroTree * # Errors * - If the target node does not exist, return `LoroTreeError::TreeNodeNotExist`. */ - public isNodeDeleted(target: TreeId): boolean /*throws*/ { + isNodeDeleted(target: TreeId): boolean /*throws*/ { return FfiConverterBool.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -15537,7 +16278,7 @@ export class LoroTree * * If the `parent` is `None`, the `target` node will be a root. */ - public mov(target: TreeId, parent: TreeParentId): void /*throws*/ { + mov(target: TreeId, parent: TreeParentId): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -15557,7 +16298,7 @@ export class LoroTree /** * Move the `target` node to be a child after the `after` node with the same parent. */ - public movAfter(target: TreeId, after: TreeId): void /*throws*/ { + movAfter(target: TreeId, after: TreeId): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -15577,7 +16318,7 @@ export class LoroTree /** * Move the `target` node to be a child before the `before` node with the same parent. */ - public movBefore(target: TreeId, before: TreeId): void /*throws*/ { + movBefore(target: TreeId, before: TreeId): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -15598,7 +16339,7 @@ export class LoroTree * Move the `target` node to be a child of the `parent` node at the given index. * If the `parent` is `None`, the `target` node will be a root. */ - public movTo( + movTo( target: TreeId, parent: TreeParentId, to: /*u32*/ number @@ -15623,7 +16364,7 @@ export class LoroTree /** * Return all nodes, including deleted nodes */ - public nodes(): Array { + nodes(): Array { return FfiConverterArrayTypeTreeID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15643,7 +16384,7 @@ export class LoroTree * - If the target node does not exist, throws Error. * - If the target node is a root node, return nil. */ - public parent(target: TreeId): TreeParentId /*throws*/ { + parent(target: TreeId): TreeParentId /*throws*/ { return FfiConverterTypeTreeParentId.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -15664,7 +16405,7 @@ export class LoroTree /** * Get the root nodes of the forest. */ - public roots(): Array { + roots(): Array { return FfiConverterArrayTypeTreeID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15691,7 +16432,7 @@ export class LoroTree * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public subscribe(subscriber: Subscriber): SubscriptionInterface | undefined { + subscribe(subscriber: Subscriber): SubscriptionLike | undefined { return FfiConverterOptionalTypeSubscription.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15724,88 +16465,94 @@ export class LoroTree } } -const uniffiTypeLoroTreeObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroTreeInterface { - const instance = Object.create(LoroTree.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroTree'; - return instance; - }, +const uniffiTypeLoroTreeObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroTreeLike { + const instance = Object.create(LoroTree.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroTree'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorotree_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorotree_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LoroTreeInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LoroTreeLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LoroTreeInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorotree( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroTreeLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorotree( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorotree( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorotree( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroTreeInterface { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroTree' - ); - }, - }; -// FfiConverter for LoroTreeInterface + isConcreteType(obj: any): obj is LoroTreeLike { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'LoroTree' + ); + }, + }; + })(); +// FfiConverter for LoroTreeLike const FfiConverterTypeLoroTree = new FfiConverterObject( uniffiTypeLoroTreeObjectFactory ); -export interface LoroUnknownInterface { +export interface LoroUnknownLike { /** * Get the container id. */ id(): ContainerId; } +/** + * @deprecated Use `LoroUnknownLike` instead. + */ +export type LoroUnknownInterface = LoroUnknownLike; export class LoroUnknown extends UniffiAbstractObject - implements LoroUnknownInterface + implements LoroUnknownLike { readonly [uniffiTypeNameSymbol] = 'LoroUnknown'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = @@ -15815,7 +16562,7 @@ export class LoroUnknown /** * Get the container id. */ - public id(): ContainerId { + id(): ContainerId { return FfiConverterTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15847,69 +16594,71 @@ export class LoroUnknown } } -const uniffiTypeLoroUnknownObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroUnknownInterface { - const instance = Object.create(LoroUnknown.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroUnknown'; - return instance; - }, +const uniffiTypeLoroUnknownObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): LoroUnknownLike { + const instance = Object.create(LoroUnknown.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroUnknown'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorounknown_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorounknown_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: LoroUnknownInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: LoroUnknownLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: LoroUnknownInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorounknown( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroUnknownLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorounknown( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorounknown( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorounknown( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroUnknownInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'LoroUnknown' - ); - }, - }; -// FfiConverter for LoroUnknownInterface + isConcreteType(obj: any): obj is LoroUnknownLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'LoroUnknown' + ); + }, + }; + })(); +// FfiConverter for LoroUnknownLike const FfiConverterTypeLoroUnknown = new FfiConverterObject( uniffiTypeLoroUnknownObjectFactory ); @@ -15923,17 +16672,17 @@ export class LoroValueLikeImpl implements LoroValueLike { readonly [uniffiTypeNameSymbol] = 'LoroValueLikeImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeLoroValueLikeImplObjectFactory.bless(pointer); } - public asLoroValue(): LoroValue { + asLoroValue(): LoroValue { return FfiConverterTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -15966,67 +16715,69 @@ export class LoroValueLikeImpl } const uniffiTypeLoroValueLikeImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): LoroValueLike { - const instance = Object.create(LoroValueLikeImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'LoroValueLikeImpl'; - return instance; - }, - - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_lorovaluelike_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + (() => { + return { + create(pointer: UniffiHandle): LoroValueLike { + const instance = Object.create(LoroValueLikeImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'LoroValueLikeImpl'; + return instance; + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_lorovaluelike_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - pointer(obj: LoroValueLike): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - clonePointer(obj: LoroValueLike): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorovaluelike( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + pointer(obj: LoroValueLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorovaluelike( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: LoroValueLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_lorovaluelike( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is LoroValueLike { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'LoroValueLikeImpl' - ); - }, - }; + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_lorovaluelike( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + isConcreteType(obj: any): obj is LoroValueLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'LoroValueLikeImpl' + ); + }, + }; + })(); // FfiConverter for LoroValueLike const FfiConverterTypeLoroValueLike = new FfiConverterObjectWithCallbacks( uniffiTypeLoroValueLikeImplObjectFactory @@ -16069,6 +16820,9 @@ const uniffiCallbackInterfaceLoroValueLike: { // LoroValueLike: this will throw a stale handle error if the handle isn't found. FfiConverterTypeLoroValueLike.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeLoroValueLike.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_lorovaluelike( @@ -16087,17 +16841,17 @@ export interface OnPop { export class OnPopImpl extends UniffiAbstractObject implements OnPop { readonly [uniffiTypeNameSymbol] = 'OnPopImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeOnPopImplObjectFactory.bless(pointer); } - public onPop( + onPop( undoOrRedo: UndoOrRedo, span: CounterSpan, undoMeta: UndoItemMeta @@ -16134,60 +16888,68 @@ export class OnPopImpl extends UniffiAbstractObject implements OnPop { } } -const uniffiTypeOnPopImplObjectFactory: UniffiObjectFactory = { - create(pointer: UnsafeMutableRawPointer): OnPop { - const instance = Object.create(OnPopImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'OnPopImpl'; - return instance; - }, +const uniffiTypeOnPopImplObjectFactory: UniffiObjectFactory = (() => { + return { + create(pointer: UniffiHandle): OnPop { + const instance = Object.create(OnPopImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'OnPopImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_onpop_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_onpop_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: OnPop): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: OnPop): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: OnPop): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_onpop(pointer, callStatus), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: OnPop): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_onpop( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_onpop(pointer, callStatus), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_onpop( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is OnPop { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'OnPopImpl' - ); - }, -}; + isConcreteType(obj: any): obj is OnPop { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'OnPopImpl' + ); + }, + }; +})(); // FfiConverter for OnPop const FfiConverterTypeOnPop = new FfiConverterObjectWithCallbacks( uniffiTypeOnPopImplObjectFactory @@ -16234,6 +16996,9 @@ const uniffiCallbackInterfaceOnPop: { // OnPop: this will throw a stale handle error if the handle isn't found. FfiConverterTypeOnPop.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeOnPop.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_onpop( @@ -16252,17 +17017,17 @@ export interface OnPush { export class OnPushImpl extends UniffiAbstractObject implements OnPush { readonly [uniffiTypeNameSymbol] = 'OnPushImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeOnPushImplObjectFactory.bless(pointer); } - public onPush( + onPush( undoOrRedo: UndoOrRedo, span: CounterSpan, diffEvent: DiffEvent | undefined @@ -16301,63 +17066,68 @@ export class OnPushImpl extends UniffiAbstractObject implements OnPush { } } -const uniffiTypeOnPushImplObjectFactory: UniffiObjectFactory = { - create(pointer: UnsafeMutableRawPointer): OnPush { - const instance = Object.create(OnPushImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'OnPushImpl'; - return instance; - }, +const uniffiTypeOnPushImplObjectFactory: UniffiObjectFactory = (() => { + return { + create(pointer: UniffiHandle): OnPush { + const instance = Object.create(OnPushImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'OnPushImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_onpush_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_onpush_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: OnPush): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: OnPush): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: OnPush): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_onpush( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: OnPush): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_onpush( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_onpush(pointer, callStatus), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_onpush( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is OnPush { - return ( - obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'OnPushImpl' - ); - }, -}; + isConcreteType(obj: any): obj is OnPush { + return ( + obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'OnPushImpl' + ); + }, + }; +})(); // FfiConverter for OnPush const FfiConverterTypeOnPush = new FfiConverterObjectWithCallbacks( uniffiTypeOnPushImplObjectFactory @@ -16409,6 +17179,9 @@ const uniffiCallbackInterfaceOnPush: { // OnPush: this will throw a stale handle error if the handle isn't found. FfiConverterTypeOnPush.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeOnPush.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_onpush( @@ -16426,17 +17199,17 @@ export class PreCommitCallbackImpl implements PreCommitCallback { readonly [uniffiTypeNameSymbol] = 'PreCommitCallbackImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypePreCommitCallbackImplObjectFactory.bless(pointer); } - public onPreCommit(payload: PreCommitCallbackPayload): void { + onPreCommit(payload: PreCommitCallbackPayload): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_precommitcallback_on_pre_commit( @@ -16469,67 +17242,69 @@ export class PreCommitCallbackImpl } const uniffiTypePreCommitCallbackImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): PreCommitCallback { - const instance = Object.create(PreCommitCallbackImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'PreCommitCallbackImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): PreCommitCallback { + const instance = Object.create(PreCommitCallbackImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'PreCommitCallbackImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_precommitcallback_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_precommitcallback_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: PreCommitCallback): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: PreCommitCallback): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: PreCommitCallback): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_precommitcallback( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: PreCommitCallback): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_precommitcallback( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_precommitcallback( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_precommitcallback( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is PreCommitCallback { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'PreCommitCallbackImpl' - ); - }, - }; + isConcreteType(obj: any): obj is PreCommitCallback { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'PreCommitCallbackImpl' + ); + }, + }; + })(); // FfiConverter for PreCommitCallback const FfiConverterTypePreCommitCallback = new FfiConverterObjectWithCallbacks( uniffiTypePreCommitCallbackImplObjectFactory @@ -16569,6 +17344,9 @@ const uniffiCallbackInterfacePreCommitCallback: { // PreCommitCallback: this will throw a stale handle error if the handle isn't found. FfiConverterTypePreCommitCallback.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypePreCommitCallback.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_precommitcallback( @@ -16577,18 +17355,22 @@ const uniffiCallbackInterfacePreCommitCallback: { }, }; -export interface StyleConfigMapInterface { +export interface StyleConfigMapLike { get(key: string): StyleConfig | undefined; insert(key: string, value: StyleConfig): void; } +/** + * @deprecated Use `StyleConfigMapLike` instead. + */ +export type StyleConfigMapInterface = StyleConfigMapLike; export class StyleConfigMap extends UniffiAbstractObject - implements StyleConfigMapInterface + implements StyleConfigMapLike { readonly [uniffiTypeNameSymbol] = 'StyleConfigMap'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor() { super(); const pointer = uniffiCaller.rustCall( @@ -16604,7 +17386,7 @@ export class StyleConfigMap uniffiTypeStyleConfigMapObjectFactory.bless(pointer); } - public static defaultRichTextConfig(): StyleConfigMapInterface { + static defaultRichTextConfig(): StyleConfigMapLike { return FfiConverterTypeStyleConfigMap.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -16617,7 +17399,7 @@ export class StyleConfigMap ); } - public get(key: string): StyleConfig | undefined { + get(key: string): StyleConfig | undefined { return FfiConverterOptionalTypeStyleConfig.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -16632,7 +17414,7 @@ export class StyleConfigMap ); } - public insert(key: string, value: StyleConfig): void { + insert(key: string, value: StyleConfig): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_styleconfigmap_insert( @@ -16664,69 +17446,71 @@ export class StyleConfigMap } } -const uniffiTypeStyleConfigMapObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): StyleConfigMapInterface { - const instance = Object.create(StyleConfigMap.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'StyleConfigMap'; - return instance; - }, - - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_styleconfigmap_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, +const uniffiTypeStyleConfigMapObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): StyleConfigMapLike { + const instance = Object.create(StyleConfigMap.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'StyleConfigMap'; + return instance; + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_styleconfigmap_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - pointer(obj: StyleConfigMapInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - clonePointer(obj: StyleConfigMapInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_styleconfigmap( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + pointer(obj: StyleConfigMapLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_styleconfigmap( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: StyleConfigMapLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_styleconfigmap( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is StyleConfigMapInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'StyleConfigMap' - ); - }, - }; -// FfiConverter for StyleConfigMapInterface + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_styleconfigmap( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + isConcreteType(obj: any): obj is StyleConfigMapLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'StyleConfigMap' + ); + }, + }; + })(); +// FfiConverter for StyleConfigMapLike const FfiConverterTypeStyleConfigMap = new FfiConverterObject( uniffiTypeStyleConfigMapObjectFactory ); @@ -16737,17 +17521,17 @@ export interface Subscriber { export class SubscriberImpl extends UniffiAbstractObject implements Subscriber { readonly [uniffiTypeNameSymbol] = 'SubscriberImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeSubscriberImplObjectFactory.bless(pointer); } - public onDiff(diff: DiffEvent): void { + onDiff(diff: DiffEvent): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_subscriber_on_diff( @@ -16778,67 +17562,70 @@ export class SubscriberImpl extends UniffiAbstractObject implements Subscriber { } } -const uniffiTypeSubscriberImplObjectFactory: UniffiObjectFactory = { - create(pointer: UnsafeMutableRawPointer): Subscriber { - const instance = Object.create(SubscriberImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'SubscriberImpl'; - return instance; - }, +const uniffiTypeSubscriberImplObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): Subscriber { + const instance = Object.create(SubscriberImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'SubscriberImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_subscriber_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_subscriber_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: Subscriber): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: Subscriber): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: Subscriber): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_subscriber( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: Subscriber): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_subscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_subscriber( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_subscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is Subscriber { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'SubscriberImpl' - ); - }, -}; + isConcreteType(obj: any): obj is Subscriber { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'SubscriberImpl' + ); + }, + }; + })(); // FfiConverter for Subscriber const FfiConverterTypeSubscriber = new FfiConverterObjectWithCallbacks( uniffiTypeSubscriberImplObjectFactory @@ -16876,6 +17663,9 @@ const uniffiCallbackInterfaceSubscriber: { // Subscriber: this will throw a stale handle error if the handle isn't found. FfiConverterTypeSubscriber.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeSubscriber.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_subscriber( @@ -16888,7 +17678,7 @@ const uniffiCallbackInterfaceSubscriber: { * A handle to a subscription created by GPUI. When dropped, the subscription * is cancelled and the callback will no longer be invoked. */ -export interface SubscriptionInterface { +export interface SubscriptionLike { /** * Detaches the subscription from this handle. The callback will * continue to be invoked until the views or models it has been @@ -16900,6 +17690,10 @@ export interface SubscriptionInterface { */ unsubscribe(): void; } +/** + * @deprecated Use `SubscriptionLike` instead. + */ +export type SubscriptionInterface = SubscriptionLike; /** * A handle to a subscription created by GPUI. When dropped, the subscription @@ -16907,13 +17701,13 @@ export interface SubscriptionInterface { */ export class Subscription extends UniffiAbstractObject - implements SubscriptionInterface + implements SubscriptionLike { readonly [uniffiTypeNameSymbol] = 'Subscription'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = @@ -16925,7 +17719,7 @@ export class Subscription * continue to be invoked until the views or models it has been * subscribed to are dropped */ - public detach(): void { + detach(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_subscription_detach( @@ -16940,7 +17734,7 @@ export class Subscription /** * Unsubscribes the subscription. */ - public unsubscribe(): void { + unsubscribe(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_subscription_unsubscribe( @@ -16970,74 +17764,76 @@ export class Subscription } } -const uniffiTypeSubscriptionObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): SubscriptionInterface { - const instance = Object.create(Subscription.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'Subscription'; - return instance; - }, +const uniffiTypeSubscriptionObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): SubscriptionLike { + const instance = Object.create(Subscription.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'Subscription'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_subscription_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_subscription_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: SubscriptionInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: SubscriptionLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: SubscriptionInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_subscription( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: SubscriptionLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_subscription( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_subscription( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_subscription( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is SubscriptionInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'Subscription' - ); - }, - }; -// FfiConverter for SubscriptionInterface + isConcreteType(obj: any): obj is SubscriptionLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'Subscription' + ); + }, + }; + })(); +// FfiConverter for SubscriptionLike const FfiConverterTypeSubscription = new FfiConverterObject( uniffiTypeSubscriptionObjectFactory ); -export interface UndoManagerInterface { +export interface UndoManagerLike { /** * If a local event's origin matches the given prefix, it will not be recorded in the * undo stack. @@ -17123,18 +17919,22 @@ export interface UndoManagerInterface { */ undoCount(): /*u32*/ number; } +/** + * @deprecated Use `UndoManagerLike` instead. + */ +export type UndoManagerInterface = UndoManagerLike; export class UndoManager extends UniffiAbstractObject - implements UndoManagerInterface + implements UndoManagerLike { readonly [uniffiTypeNameSymbol] = 'UndoManager'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new UndoManager. */ - constructor(doc: LoroDocInterface) { + constructor(doc: LoroDocLike) { super(); const pointer = uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17154,7 +17954,7 @@ export class UndoManager * If a local event's origin matches the given prefix, it will not be recorded in the * undo stack. */ - public addExcludeOriginPrefix(prefix: string): void { + addExcludeOriginPrefix(prefix: string): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_undomanager_add_exclude_origin_prefix( @@ -17170,7 +17970,7 @@ export class UndoManager /** * Whether the undo manager can redo. */ - public canRedo(): boolean { + canRedo(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17187,7 +17987,7 @@ export class UndoManager /** * Whether the undo manager can undo. */ - public canUndo(): boolean { + canUndo(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17205,7 +18005,7 @@ export class UndoManager * Ends the current group, calling UndoManager::undo() after this will * undo all changes that occurred during the group. */ - public groupEnd(): void { + groupEnd(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_undomanager_group_end( @@ -17224,7 +18024,7 @@ export class UndoManager * we split the undo item and close the group. If there are no conflict * in changed container ids we continue the group merge. */ - public groupStart(): void /*throws*/ { + groupStart(): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -17242,7 +18042,7 @@ export class UndoManager /** * Get the peer id of the undo manager */ - public peer(): /*u64*/ bigint { + peer(): /*u64*/ bigint { return FfiConverterUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17259,7 +18059,7 @@ export class UndoManager /** * Record a new checkpoint. */ - public recordNewCheckpoint(): void /*throws*/ { + recordNewCheckpoint(): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( FfiConverterTypeLoroError @@ -17277,7 +18077,7 @@ export class UndoManager /** * Redo the last change made by the peer. */ - public redo(): boolean /*throws*/ { + redo(): boolean /*throws*/ { return FfiConverterBool.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -17297,7 +18097,7 @@ export class UndoManager /** * How many times the undo manager can redo. */ - public redoCount(): /*u32*/ number { + redoCount(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17314,7 +18114,7 @@ export class UndoManager /** * Set the maximum number of undo steps. The default value is 100. */ - public setMaxUndoSteps(size: /*u32*/ number): void { + setMaxUndoSteps(size: /*u32*/ number): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_undomanager_set_max_undo_steps( @@ -17330,7 +18130,7 @@ export class UndoManager /** * Set the merge interval in ms. The default value is 0, which means no merge. */ - public setMergeInterval(interval: /*i64*/ bigint): void { + setMergeInterval(interval: /*i64*/ bigint): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_undomanager_set_merge_interval( @@ -17347,7 +18147,7 @@ export class UndoManager * Set the listener for pop events. * The listener will be called when an undo/redo item is popped from the stack. */ - public setOnPop(onPop: OnPop | undefined): void { + setOnPop(onPop: OnPop | undefined): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_undomanager_set_on_pop( @@ -17364,7 +18164,7 @@ export class UndoManager * Set the listener for push events. * The listener will be called when a new undo/redo item is pushed into the stack. */ - public setOnPush(onPush: OnPush | undefined): void { + setOnPush(onPush: OnPush | undefined): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_undomanager_set_on_push( @@ -17380,7 +18180,7 @@ export class UndoManager /** * Get the metadata of the top redo stack item, if any. */ - public topRedoMeta(): UndoItemMeta | undefined { + topRedoMeta(): UndoItemMeta | undefined { return FfiConverterOptionalTypeUndoItemMeta.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17397,7 +18197,7 @@ export class UndoManager /** * Get the value associated with the top redo stack item, if any. */ - public topRedoValue(): LoroValue | undefined { + topRedoValue(): LoroValue | undefined { return FfiConverterOptionalTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17414,7 +18214,7 @@ export class UndoManager /** * Get the metadata of the top undo stack item, if any. */ - public topUndoMeta(): UndoItemMeta | undefined { + topUndoMeta(): UndoItemMeta | undefined { return FfiConverterOptionalTypeUndoItemMeta.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17431,7 +18231,7 @@ export class UndoManager /** * Get the value associated with the top undo stack item, if any. */ - public topUndoValue(): LoroValue | undefined { + topUndoValue(): LoroValue | undefined { return FfiConverterOptionalTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17448,7 +18248,7 @@ export class UndoManager /** * Undo the last change made by the peer. */ - public undo(): boolean /*throws*/ { + undo(): boolean /*throws*/ { return FfiConverterBool.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -17468,7 +18268,7 @@ export class UndoManager /** * How many times the undo manager can undo. */ - public undoCount(): /*u32*/ number { + undoCount(): /*u32*/ number { return FfiConverterUInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -17500,69 +18300,71 @@ export class UndoManager } } -const uniffiTypeUndoManagerObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): UndoManagerInterface { - const instance = Object.create(UndoManager.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'UndoManager'; - return instance; - }, +const uniffiTypeUndoManagerObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): UndoManagerLike { + const instance = Object.create(UndoManager.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'UndoManager'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_undomanager_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_undomanager_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: UndoManagerInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: UndoManagerLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: UndoManagerInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_undomanager( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: UndoManagerLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_undomanager( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_undomanager( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_undomanager( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is UndoManagerInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'UndoManager' - ); - }, - }; -// FfiConverter for UndoManagerInterface + isConcreteType(obj: any): obj is UndoManagerLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'UndoManager' + ); + }, + }; + })(); +// FfiConverter for UndoManagerLike const FfiConverterTypeUndoManager = new FfiConverterObject( uniffiTypeUndoManagerObjectFactory ); @@ -17576,17 +18378,17 @@ export class UnsubscriberImpl implements Unsubscriber { readonly [uniffiTypeNameSymbol] = 'UnsubscriberImpl'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeUnsubscriberImplObjectFactory.bless(pointer); } - public onUnsubscribe(): void { + onUnsubscribe(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_unsubscriber_on_unsubscribe( @@ -17617,67 +18419,69 @@ export class UnsubscriberImpl } const uniffiTypeUnsubscriberImplObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): Unsubscriber { - const instance = Object.create(UnsubscriberImpl.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'UnsubscriberImpl'; - return instance; - }, + (() => { + return { + create(pointer: UniffiHandle): Unsubscriber { + const instance = Object.create(UnsubscriberImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'UnsubscriberImpl'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_unsubscriber_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_unsubscriber_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: Unsubscriber): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: Unsubscriber): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: Unsubscriber): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_unsubscriber( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: Unsubscriber): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_unsubscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_unsubscriber( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_unsubscriber( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is Unsubscriber { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'UnsubscriberImpl' - ); - }, - }; + isConcreteType(obj: any): obj is Unsubscriber { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'UnsubscriberImpl' + ); + }, + }; + })(); // FfiConverter for Unsubscriber const FfiConverterTypeUnsubscriber = new FfiConverterObjectWithCallbacks( uniffiTypeUnsubscriberImplObjectFactory @@ -17715,6 +18519,9 @@ const uniffiCallbackInterfaceUnsubscriber: { // Unsubscriber: this will throw a stale handle error if the handle isn't found. FfiConverterTypeUnsubscriber.drop(uniffiHandle); }, + uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { + return FfiConverterTypeUnsubscriber.clone(uniffiHandle); + }, }, register: () => { nativeModule().ubrn_uniffi_loro_ffi_fn_init_callback_vtable_unsubscriber( @@ -17723,42 +18530,46 @@ const uniffiCallbackInterfaceUnsubscriber: { }, }; -export interface ValueOrContainerInterface { +export interface ValueOrContainer { asContainer(): ContainerId | undefined; - asLoroCounter(): LoroCounterInterface | undefined; - asLoroList(): LoroListInterface | undefined; - asLoroMap(): LoroMapInterface | undefined; - asLoroMovableList(): LoroMovableListInterface | undefined; - asLoroText(): LoroTextInterface | undefined; - asLoroTree(): LoroTreeInterface | undefined; - asLoroUnknown(): LoroUnknownInterface | undefined; + asLoroCounter(): LoroCounterLike | undefined; + asLoroList(): LoroListLike | undefined; + asLoroMap(): LoroMapLike | undefined; + asLoroMovableList(): LoroMovableListLike | undefined; + asLoroText(): LoroTextLike | undefined; + asLoroTree(): LoroTreeLike | undefined; + asLoroUnknown(): LoroUnknownLike | undefined; asValue(): LoroValue | undefined; containerType(): ContainerType | undefined; isContainer(): boolean; isValue(): boolean; } +/** + * @deprecated Use `ValueOrContainer` instead. + */ +export type ValueOrContainerInterface = ValueOrContainer; -export class ValueOrContainer +export class ValueOrContainerImpl extends UniffiAbstractObject - implements ValueOrContainerInterface + implements ValueOrContainer { - readonly [uniffiTypeNameSymbol] = 'ValueOrContainer'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [uniffiTypeNameSymbol] = 'ValueOrContainerImpl'; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. - private constructor(pointer: UnsafeMutableRawPointer) { + private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = - uniffiTypeValueOrContainerObjectFactory.bless(pointer); + uniffiTypeValueOrContainerImplObjectFactory.bless(pointer); } - public asContainer(): ContainerId | undefined { + asContainer(): ContainerId | undefined { return FfiConverterOptionalTypeContainerID.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_container( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17767,12 +18578,12 @@ export class ValueOrContainer ); } - public asLoroCounter(): LoroCounterInterface | undefined { + asLoroCounter(): LoroCounterLike | undefined { return FfiConverterOptionalTypeLoroCounter.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_counter( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17781,12 +18592,12 @@ export class ValueOrContainer ); } - public asLoroList(): LoroListInterface | undefined { + asLoroList(): LoroListLike | undefined { return FfiConverterOptionalTypeLoroList.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_list( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17795,12 +18606,12 @@ export class ValueOrContainer ); } - public asLoroMap(): LoroMapInterface | undefined { + asLoroMap(): LoroMapLike | undefined { return FfiConverterOptionalTypeLoroMap.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_map( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17809,12 +18620,12 @@ export class ValueOrContainer ); } - public asLoroMovableList(): LoroMovableListInterface | undefined { + asLoroMovableList(): LoroMovableListLike | undefined { return FfiConverterOptionalTypeLoroMovableList.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_movable_list( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17823,12 +18634,12 @@ export class ValueOrContainer ); } - public asLoroText(): LoroTextInterface | undefined { + asLoroText(): LoroTextLike | undefined { return FfiConverterOptionalTypeLoroText.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_text( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17837,12 +18648,12 @@ export class ValueOrContainer ); } - public asLoroTree(): LoroTreeInterface | undefined { + asLoroTree(): LoroTreeLike | undefined { return FfiConverterOptionalTypeLoroTree.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_tree( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17851,12 +18662,12 @@ export class ValueOrContainer ); } - public asLoroUnknown(): LoroUnknownInterface | undefined { + asLoroUnknown(): LoroUnknownLike | undefined { return FfiConverterOptionalTypeLoroUnknown.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_loro_unknown( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17865,12 +18676,12 @@ export class ValueOrContainer ); } - public asValue(): LoroValue | undefined { + asValue(): LoroValue | undefined { return FfiConverterOptionalTypeLoroValue.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_as_value( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17879,12 +18690,12 @@ export class ValueOrContainer ); } - public containerType(): ContainerType | undefined { + containerType(): ContainerType | undefined { return FfiConverterOptionalTypeContainerType.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_container_type( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17893,12 +18704,12 @@ export class ValueOrContainer ); } - public isContainer(): boolean { + isContainer(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_is_container( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17907,12 +18718,12 @@ export class ValueOrContainer ); } - public isValue(): boolean { + isValue(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_loro_ffi_fn_method_valueorcontainer_is_value( - uniffiTypeValueOrContainerObjectFactory.clonePointer(this), + uniffiTypeValueOrContainerImplObjectFactory.clonePointer(this), callStatus ); }, @@ -17927,86 +18738,88 @@ export class ValueOrContainer uniffiDestroy(): void { const ptr = (this as any)[destructorGuardSymbol]; if (ptr !== undefined) { - const pointer = uniffiTypeValueOrContainerObjectFactory.pointer(this); - uniffiTypeValueOrContainerObjectFactory.freePointer(pointer); - uniffiTypeValueOrContainerObjectFactory.unbless(ptr); + const pointer = uniffiTypeValueOrContainerImplObjectFactory.pointer(this); + uniffiTypeValueOrContainerImplObjectFactory.freePointer(pointer); + uniffiTypeValueOrContainerImplObjectFactory.unbless(ptr); delete (this as any)[destructorGuardSymbol]; } } - static instanceOf(obj: any): obj is ValueOrContainer { - return uniffiTypeValueOrContainerObjectFactory.isConcreteType(obj); + static instanceOf(obj: any): obj is ValueOrContainerImpl { + return uniffiTypeValueOrContainerImplObjectFactory.isConcreteType(obj); } } -const uniffiTypeValueOrContainerObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): ValueOrContainerInterface { - const instance = Object.create(ValueOrContainer.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'ValueOrContainer'; - return instance; - }, - - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_valueorcontainer_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, +const uniffiTypeValueOrContainerImplObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): ValueOrContainer { + const instance = Object.create(ValueOrContainerImpl.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'ValueOrContainerImpl'; + return instance; + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_valueorcontainer_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - pointer(obj: ValueOrContainerInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - clonePointer(obj: ValueOrContainerInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_valueorcontainer( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + pointer(obj: ValueOrContainer): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_valueorcontainer( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: ValueOrContainer): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_valueorcontainer( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is ValueOrContainerInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'ValueOrContainer' - ); - }, - }; -// FfiConverter for ValueOrContainerInterface + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_valueorcontainer( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, + + isConcreteType(obj: any): obj is ValueOrContainer { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'ValueOrContainerImpl' + ); + }, + }; + })(); +// FfiConverter for ValueOrContainer const FfiConverterTypeValueOrContainer = new FfiConverterObject( - uniffiTypeValueOrContainerObjectFactory + uniffiTypeValueOrContainerImplObjectFactory ); -export interface VersionRangeInterface { +export interface VersionRangeLike { /** * Clear all ranges in the VersionRange */ @@ -18022,10 +18835,7 @@ export interface VersionRangeInterface { /** * Check if this VersionRange contains operations between two VersionVectors */ - containsOpsBetween( - vvA: VersionVectorInterface, - vvB: VersionVectorInterface - ): boolean; + containsOpsBetween(vvA: VersionVectorLike, vvB: VersionVectorLike): boolean; /** * Extend this VersionRange to include the given ID span */ @@ -18060,14 +18870,18 @@ export interface VersionRangeInterface { */ isEmpty(): boolean; } +/** + * @deprecated Use `VersionRangeLike` instead. + */ +export type VersionRangeInterface = VersionRangeLike; export class VersionRange extends UniffiAbstractObject - implements VersionRangeInterface + implements VersionRangeLike { readonly [uniffiTypeNameSymbol] = 'VersionRange'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor() { super(); const pointer = uniffiCaller.rustCall( @@ -18086,7 +18900,7 @@ export class VersionRange /** * Create a VersionRange from a VersionVector */ - public static fromVv(vv: VersionVectorInterface): VersionRangeInterface { + static fromVv(vv: VersionVectorLike): VersionRangeLike { return FfiConverterTypeVersionRange.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18103,7 +18917,7 @@ export class VersionRange /** * Clear all ranges in the VersionRange */ - public clear(): void { + clear(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_versionrange_clear( @@ -18118,7 +18932,7 @@ export class VersionRange /** * Check if this VersionRange contains a specific ID */ - public containsId(id: Id): boolean { + containsId(id: Id): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18136,7 +18950,7 @@ export class VersionRange /** * Check if this VersionRange contains a specific ID span */ - public containsIdSpan(span: IdSpan): boolean { + containsIdSpan(span: IdSpan): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18154,10 +18968,7 @@ export class VersionRange /** * Check if this VersionRange contains operations between two VersionVectors */ - public containsOpsBetween( - vvA: VersionVectorInterface, - vvB: VersionVectorInterface - ): boolean { + containsOpsBetween(vvA: VersionVectorLike, vvB: VersionVectorLike): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18176,7 +18987,7 @@ export class VersionRange /** * Extend this VersionRange to include the given ID span */ - public extendsToIncludeIdSpan(span: IdSpan): void { + extendsToIncludeIdSpan(span: IdSpan): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_versionrange_extends_to_include_id_span( @@ -18193,7 +19004,7 @@ export class VersionRange * Get the counter range for a specific peer * Returns the counter range if the peer exists, null otherwise */ - public get(peer: /*u64*/ bigint): CounterSpan | undefined { + get(peer: /*u64*/ bigint): CounterSpan | undefined { return FfiConverterOptionalTypeCounterSpan.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18211,7 +19022,7 @@ export class VersionRange /** * Get all ranges as a list of (peer, start, end) tuples */ - public getAllRanges(): Array { + getAllRanges(): Array { return FfiConverterArrayTypeVersionRangeItem.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18228,7 +19039,7 @@ export class VersionRange /** * Get all peer IDs in this VersionRange */ - public getPeers(): Array { + getPeers(): Array { return FfiConverterArrayUInt64.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18245,7 +19056,7 @@ export class VersionRange /** * Check if this VersionRange has overlap with the given ID span */ - public hasOverlapWith(span: IdSpan): boolean { + hasOverlapWith(span: IdSpan): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18263,7 +19074,7 @@ export class VersionRange /** * Insert a counter range for a specific peer */ - public insert( + insert( peer: /*u64*/ bigint, start: /*i32*/ number, end: /*i32*/ number @@ -18285,7 +19096,7 @@ export class VersionRange /** * Check if the VersionRange is empty */ - public isEmpty(): boolean { + isEmpty(): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18317,85 +19128,87 @@ export class VersionRange } } -const uniffiTypeVersionRangeObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): VersionRangeInterface { - const instance = Object.create(VersionRange.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'VersionRange'; - return instance; - }, +const uniffiTypeVersionRangeObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): VersionRangeLike { + const instance = Object.create(VersionRange.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'VersionRange'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_versionrange_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_versionrange_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: VersionRangeInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: VersionRangeLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: VersionRangeInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_versionrange( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: VersionRangeLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_versionrange( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_versionrange( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_versionrange( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is VersionRangeInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'VersionRange' - ); - }, - }; -// FfiConverter for VersionRangeInterface + isConcreteType(obj: any): obj is VersionRangeLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'VersionRange' + ); + }, + }; + })(); +// FfiConverter for VersionRangeLike const FfiConverterTypeVersionRange = new FfiConverterObject( uniffiTypeVersionRangeObjectFactory ); -export interface VersionVectorInterface { - diff(rhs: VersionVectorInterface): VersionVectorDiff; +export interface VersionVectorLike { + diff(rhs: VersionVectorLike): VersionVectorDiff; encode(): ArrayBuffer; - eq(other: VersionVectorInterface): boolean; - extendToIncludeVv(other: VersionVectorInterface): void; + eq(other: VersionVectorLike): boolean; + extendToIncludeVv(other: VersionVectorLike): void; getLast(peer: /*u64*/ bigint): /*i32*/ number | undefined; - getMissingSpan(target: VersionVectorInterface): Array; + getMissingSpan(target: VersionVectorLike): Array; includesId(id: Id): boolean; - includesVv(other: VersionVectorInterface): boolean; + includesVv(other: VersionVectorLike): boolean; intersectSpan(target: IdSpan): CounterSpan | undefined; - merge(other: VersionVectorInterface): void; - partialCmp(other: VersionVectorInterface): Ordering | undefined; + merge(other: VersionVectorLike): void; + partialCmp(other: VersionVectorLike): Ordering | undefined; setEnd(id: Id): void; setLast(id: Id): void; toHashmap(): Map; @@ -18404,14 +19217,18 @@ export interface VersionVectorInterface { */ tryUpdateLast(id: Id): boolean; } +/** + * @deprecated Use `VersionVectorLike` instead. + */ +export type VersionVectorInterface = VersionVectorLike; export class VersionVector extends UniffiAbstractObject - implements VersionVectorInterface + implements VersionVectorLike { readonly [uniffiTypeNameSymbol] = 'VersionVector'; - readonly [destructorGuardSymbol]: UniffiRustArcPtr; - readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer; + readonly [destructorGuardSymbol]: UniffiGcObject; + readonly [pointerLiteralSymbol]: UniffiHandle; constructor() { super(); const pointer = uniffiCaller.rustCall( @@ -18427,7 +19244,7 @@ export class VersionVector uniffiTypeVersionVectorObjectFactory.bless(pointer); } - public static decode(bytes: ArrayBuffer): VersionVectorInterface /*throws*/ { + static decode(bytes: ArrayBuffer): VersionVectorLike /*throws*/ { return FfiConverterTypeVersionVector.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeLoroError.lift.bind( @@ -18444,7 +19261,7 @@ export class VersionVector ); } - public diff(rhs: VersionVectorInterface): VersionVectorDiff { + diff(rhs: VersionVectorLike): VersionVectorDiff { return FfiConverterTypeVersionVectorDiff.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18459,7 +19276,7 @@ export class VersionVector ); } - public encode(): ArrayBuffer { + encode(): ArrayBuffer { return FfiConverterArrayBuffer.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18473,7 +19290,7 @@ export class VersionVector ); } - public eq(other: VersionVectorInterface): boolean { + eq(other: VersionVectorLike): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18488,7 +19305,7 @@ export class VersionVector ); } - public extendToIncludeVv(other: VersionVectorInterface): void { + extendToIncludeVv(other: VersionVectorLike): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_versionvector_extend_to_include_vv( @@ -18501,7 +19318,7 @@ export class VersionVector ); } - public getLast(peer: /*u64*/ bigint): /*i32*/ number | undefined { + getLast(peer: /*u64*/ bigint): /*i32*/ number | undefined { return FfiConverterOptionalInt32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18516,7 +19333,7 @@ export class VersionVector ); } - public getMissingSpan(target: VersionVectorInterface): Array { + getMissingSpan(target: VersionVectorLike): Array { return FfiConverterArrayTypeIdSpan.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18531,7 +19348,7 @@ export class VersionVector ); } - public includesId(id: Id): boolean { + includesId(id: Id): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18546,7 +19363,7 @@ export class VersionVector ); } - public includesVv(other: VersionVectorInterface): boolean { + includesVv(other: VersionVectorLike): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18561,7 +19378,7 @@ export class VersionVector ); } - public intersectSpan(target: IdSpan): CounterSpan | undefined { + intersectSpan(target: IdSpan): CounterSpan | undefined { return FfiConverterOptionalTypeCounterSpan.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18576,7 +19393,7 @@ export class VersionVector ); } - public merge(other: VersionVectorInterface): void { + merge(other: VersionVectorLike): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_versionvector_merge( @@ -18589,7 +19406,7 @@ export class VersionVector ); } - public partialCmp(other: VersionVectorInterface): Ordering | undefined { + partialCmp(other: VersionVectorLike): Ordering | undefined { return FfiConverterOptionalTypeOrdering.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18604,7 +19421,7 @@ export class VersionVector ); } - public setEnd(id: Id): void { + setEnd(id: Id): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_versionvector_set_end( @@ -18617,7 +19434,7 @@ export class VersionVector ); } - public setLast(id: Id): void { + setLast(id: Id): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_loro_ffi_fn_method_versionvector_set_last( @@ -18630,7 +19447,7 @@ export class VersionVector ); } - public toHashmap(): Map { + toHashmap(): Map { return FfiConverterMapUInt64Int32.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18647,7 +19464,7 @@ export class VersionVector /** * Update the end counter of the given client if the end is greater. Return whether updated */ - public tryUpdateLast(id: Id): boolean { + tryUpdateLast(id: Id): boolean { return FfiConverterBool.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { @@ -18680,69 +19497,71 @@ export class VersionVector } } -const uniffiTypeVersionVectorObjectFactory: UniffiObjectFactory = - { - create(pointer: UnsafeMutableRawPointer): VersionVectorInterface { - const instance = Object.create(VersionVector.prototype); - instance[pointerLiteralSymbol] = pointer; - instance[destructorGuardSymbol] = this.bless(pointer); - instance[uniffiTypeNameSymbol] = 'VersionVector'; - return instance; - }, +const uniffiTypeVersionVectorObjectFactory: UniffiObjectFactory = + (() => { + return { + create(pointer: UniffiHandle): VersionVectorLike { + const instance = Object.create(VersionVector.prototype); + instance[pointerLiteralSymbol] = pointer; + instance[destructorGuardSymbol] = this.bless(pointer); + instance[uniffiTypeNameSymbol] = 'VersionVector'; + return instance; + }, - bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr { - return uniffiCaller.rustCall( - /*caller:*/ (status) => - nativeModule().ubrn_uniffi_internal_fn_method_versionvector_ffi__bless_pointer( - p, - status - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + bless(p: UniffiHandle): UniffiGcObject { + return uniffiCaller.rustCall( + /*caller:*/ (status) => + nativeModule().ubrn_uniffi_internal_fn_method_versionvector_ffi__bless_pointer( + p, + status + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - unbless(ptr: UniffiRustArcPtr) { - ptr.markDestroyed(); - }, + unbless(ptr: UniffiGcObject) { + ptr.markDestroyed(); + }, - pointer(obj: VersionVectorInterface): UnsafeMutableRawPointer { - if ((obj as any)[destructorGuardSymbol] === undefined) { - throw new UniffiInternalError.UnexpectedNullPointer(); - } - return (obj as any)[pointerLiteralSymbol]; - }, + pointer(obj: VersionVectorLike): UniffiHandle { + if ((obj as any)[destructorGuardSymbol] === undefined) { + throw new UniffiInternalError.UnexpectedNullPointer(); + } + return (obj as any)[pointerLiteralSymbol]; + }, - clonePointer(obj: VersionVectorInterface): UnsafeMutableRawPointer { - const pointer = this.pointer(obj); - return uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_clone_versionvector( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + clonePointer(obj: VersionVectorLike): UniffiHandle { + const pointer = this.pointer(obj); + return uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_clone_versionvector( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - freePointer(pointer: UnsafeMutableRawPointer): void { - uniffiCaller.rustCall( - /*caller:*/ (callStatus) => - nativeModule().ubrn_uniffi_loro_ffi_fn_free_versionvector( - pointer, - callStatus - ), - /*liftString:*/ FfiConverterString.lift - ); - }, + freePointer(pointer: UniffiHandle): void { + uniffiCaller.rustCall( + /*caller:*/ (callStatus) => + nativeModule().ubrn_uniffi_loro_ffi_fn_free_versionvector( + pointer, + callStatus + ), + /*liftString:*/ FfiConverterString.lift + ); + }, - isConcreteType(obj: any): obj is VersionVectorInterface { - return ( - obj[destructorGuardSymbol] && - obj[uniffiTypeNameSymbol] === 'VersionVector' - ); - }, - }; -// FfiConverter for VersionVectorInterface + isConcreteType(obj: any): obj is VersionVectorLike { + return ( + obj[destructorGuardSymbol] && + obj[uniffiTypeNameSymbol] === 'VersionVector' + ); + }, + }; + })(); +// FfiConverter for VersionVectorLike const FfiConverterTypeVersionVector = new FfiConverterObject( uniffiTypeVersionVectorObjectFactory ); @@ -18890,52 +19709,52 @@ const FfiConverterOptionalMapUInt64TypeCounterSpan = new FfiConverterOptional( FfiConverterMapUInt64TypeCounterSpan ); -// FfiConverter for CursorInterface | undefined +// FfiConverter for CursorLike | undefined const FfiConverterOptionalTypeCursor = new FfiConverterOptional( FfiConverterTypeCursor ); -// FfiConverter for FrontiersInterface | undefined +// FfiConverter for FrontiersLike | undefined const FfiConverterOptionalTypeFrontiers = new FfiConverterOptional( FfiConverterTypeFrontiers ); -// FfiConverter for LoroCounterInterface | undefined +// FfiConverter for LoroCounterLike | undefined const FfiConverterOptionalTypeLoroCounter = new FfiConverterOptional( FfiConverterTypeLoroCounter ); -// FfiConverter for LoroDocInterface | undefined +// FfiConverter for LoroDocLike | undefined const FfiConverterOptionalTypeLoroDoc = new FfiConverterOptional( FfiConverterTypeLoroDoc ); -// FfiConverter for LoroListInterface | undefined +// FfiConverter for LoroListLike | undefined const FfiConverterOptionalTypeLoroList = new FfiConverterOptional( FfiConverterTypeLoroList ); -// FfiConverter for LoroMapInterface | undefined +// FfiConverter for LoroMapLike | undefined const FfiConverterOptionalTypeLoroMap = new FfiConverterOptional( FfiConverterTypeLoroMap ); -// FfiConverter for LoroMovableListInterface | undefined +// FfiConverter for LoroMovableListLike | undefined const FfiConverterOptionalTypeLoroMovableList = new FfiConverterOptional( FfiConverterTypeLoroMovableList ); -// FfiConverter for LoroTextInterface | undefined +// FfiConverter for LoroTextLike | undefined const FfiConverterOptionalTypeLoroText = new FfiConverterOptional( FfiConverterTypeLoroText ); -// FfiConverter for LoroTreeInterface | undefined +// FfiConverter for LoroTreeLike | undefined const FfiConverterOptionalTypeLoroTree = new FfiConverterOptional( FfiConverterTypeLoroTree ); -// FfiConverter for LoroUnknownInterface | undefined +// FfiConverter for LoroUnknownLike | undefined const FfiConverterOptionalTypeLoroUnknown = new FfiConverterOptional( FfiConverterTypeLoroUnknown ); @@ -18950,17 +19769,17 @@ const FfiConverterOptionalTypeOnPush = new FfiConverterOptional( FfiConverterTypeOnPush ); -// FfiConverter for SubscriptionInterface | undefined +// FfiConverter for SubscriptionLike | undefined const FfiConverterOptionalTypeSubscription = new FfiConverterOptional( FfiConverterTypeSubscription ); -// FfiConverter for ValueOrContainerInterface | undefined +// FfiConverter for ValueOrContainer | undefined const FfiConverterOptionalTypeValueOrContainer = new FfiConverterOptional( FfiConverterTypeValueOrContainer ); -// FfiConverter for VersionVectorInterface | undefined +// FfiConverter for VersionVectorLike | undefined const FfiConverterOptionalTypeVersionVector = new FfiConverterOptional( FfiConverterTypeVersionVector ); @@ -18998,12 +19817,12 @@ const FfiConverterArrayTypeTextDelta = new FfiConverterArray( FfiConverterTypeTextDelta ); -// FfiConverter for Array +// FfiConverter for Array const FfiConverterArrayTypeValueOrContainer = new FfiConverterArray( FfiConverterTypeValueOrContainer ); -// FfiConverter for Map +// FfiConverter for Map const FfiConverterMapStringOptionalTypeValueOrContainer = new FfiConverterMap( FfiConverterString, FfiConverterOptionalTypeValueOrContainer @@ -19026,7 +19845,7 @@ const FfiConverterOptionalMapStringTypeLoroValue = new FfiConverterOptional( */ function uniffiEnsureInitialized() { // Get the bindings contract version from our ComponentInterface - const bindingsContractVersion = 26; + const bindingsContractVersion = 30; // Get the scaffolding contract version by calling the into the dylib const scaffoldingContractVersion = nativeModule().ubrn_ffi_loro_ffi_uniffi_contract_version(); @@ -19053,7 +19872,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_apply() !== - 32695 + 25723 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_apply' @@ -19061,7 +19880,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_encode() !== - 4426 + 60066 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_encode' @@ -19069,7 +19888,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_encode_all() !== - 29690 + 64538 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_encode_all' @@ -19077,7 +19896,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_get_all_states() !== - 24946 + 34327 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_get_all_states' @@ -19085,7 +19904,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_get_local_state() !== - 47648 + 28243 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_get_local_state' @@ -19093,7 +19912,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_peer() !== - 7626 + 1755 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_peer' @@ -19101,7 +19920,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_remove_outdated() !== - 59591 + 2257 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_remove_outdated' @@ -19109,7 +19928,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_awareness_set_local_state() !== - 12712 + 4706 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_awareness_set_local_state' @@ -19117,7 +19936,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_changeancestorstraveler_travel() !== - 43603 + 56839 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_changeancestorstraveler_travel' @@ -19125,7 +19944,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_changemodifier_set_message() !== - 11943 + 48755 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_changemodifier_set_message' @@ -19133,7 +19952,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_changemodifier_set_timestamp() !== - 5014 + 61958 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_changemodifier_set_timestamp' @@ -19141,7 +19960,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_configure_fork() !== - 3880 + 35786 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_configure_fork' @@ -19149,7 +19968,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_configure_merge_interval() !== - 19914 + 16107 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_configure_merge_interval' @@ -19157,7 +19976,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_configure_record_timestamp() !== - 47148 + 44394 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_configure_record_timestamp' @@ -19165,7 +19984,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_configure_set_merge_interval() !== - 59151 + 54507 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_configure_set_merge_interval' @@ -19173,7 +19992,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_configure_set_record_timestamp() !== - 41593 + 22707 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_configure_set_record_timestamp' @@ -19181,7 +20000,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_configure_text_style_config() !== - 13969 + 48628 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_configure_text_style_config' @@ -19189,7 +20008,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_containeridlike_as_container_id() !== - 5805 + 4068 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_containeridlike_as_container_id' @@ -19197,7 +20016,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_cursor_encode() !== - 36128 + 18171 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_cursor_encode' @@ -19205,7 +20024,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_diffbatch_get_diff() !== - 5540 + 64840 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_diffbatch_get_diff' @@ -19213,7 +20032,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_diffbatch_push() !== - 17472 + 24023 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_diffbatch_push' @@ -19221,7 +20040,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_apply() !== - 1107 + 59470 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_apply' @@ -19229,7 +20048,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_delete() !== - 9629 + 10154 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_delete' @@ -19237,7 +20056,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_encode() !== - 27800 + 59981 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_encode' @@ -19245,7 +20064,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_encode_all() !== - 45592 + 36590 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_encode_all' @@ -19253,7 +20072,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_get() !== - 23330 + 36831 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_get' @@ -19261,7 +20080,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_get_all_states() !== - 26188 + 34807 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_get_all_states' @@ -19269,7 +20088,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_keys() !== - 19682 + 34788 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_keys' @@ -19277,7 +20096,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_remove_outdated() !== - 55398 + 28998 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_remove_outdated' @@ -19285,7 +20104,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_set() !== - 7799 + 21049 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_set' @@ -19293,7 +20112,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_subscribe() !== - 1473 + 29074 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_subscribe' @@ -19301,7 +20120,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralstore_subscribe_local_update() !== - 1506 + 17873 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralstore_subscribe_local_update' @@ -19309,7 +20128,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_ephemeralsubscriber_on_ephemeral_event() !== - 21232 + 57162 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_ephemeralsubscriber_on_ephemeral_event' @@ -19317,30 +20136,22 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_firstcommitfrompeercallback_on_first_commit_from_peer() !== - 54327 + 54262 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_firstcommitfrompeercallback_on_first_commit_from_peer' ); } - if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_fractionalindex_to_string() !== - 5688 - ) { - throw new UniffiInternalError.ApiChecksumMismatch( - 'uniffi_loro_ffi_checksum_method_fractionalindex_to_string' - ); - } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_frontiers_encode() !== - 14564 + 44853 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_frontiers_encode' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_frontiers_eq() !== 19191 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_frontiers_eq() !== 19239 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_frontiers_eq' @@ -19348,7 +20159,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_frontiers_is_empty() !== - 14722 + 40492 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_frontiers_is_empty' @@ -19356,15 +20167,23 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_frontiers_to_vec() !== - 15210 + 36964 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_frontiers_to_vec' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_jsonpathsubscriber_on_jsonpath_changed() !== + 55955 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_jsonpathsubscriber_on_jsonpath_changed' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_localephemerallistener_on_ephemeral_update() !== - 58755 + 50995 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_localephemerallistener_on_ephemeral_update' @@ -19372,7 +20191,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_localupdatecallback_on_local_update() !== - 56990 + 26779 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_localupdatecallback_on_local_update' @@ -19380,7 +20199,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_decrement() !== - 56450 + 19305 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_decrement' @@ -19388,7 +20207,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_doc() !== - 18968 + 24283 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_doc' @@ -19396,7 +20215,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_get_attached() !== - 28917 + 5885 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_get_attached' @@ -19404,7 +20223,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_get_value() !== - 43671 + 21220 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_get_value' @@ -19412,7 +20231,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_id() !== - 35406 + 37540 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_id' @@ -19420,7 +20239,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_increment() !== - 60293 + 56809 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_increment' @@ -19428,7 +20247,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_is_attached() !== - 28676 + 50538 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_is_attached' @@ -19436,7 +20255,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_is_deleted() !== - 38594 + 3090 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_is_deleted' @@ -19444,7 +20263,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorocounter_subscribe() !== - 60261 + 50281 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorocounter_subscribe' @@ -19452,7 +20271,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_apply_diff() !== - 15296 + 28864 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_apply_diff' @@ -19460,7 +20279,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_attach() !== - 48074 + 12214 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_attach' @@ -19468,7 +20287,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_check_state_correctness_slow() !== - 53663 + 2891 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_check_state_correctness_slow' @@ -19476,7 +20295,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_checkout() !== - 61916 + 37949 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_checkout' @@ -19484,7 +20303,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_checkout_to_latest() !== - 62670 + 23434 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_checkout_to_latest' @@ -19492,7 +20311,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_clear_next_commit_options() !== - 21764 + 44526 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_clear_next_commit_options' @@ -19500,7 +20319,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_cmp_with_frontiers() !== - 41551 + 49468 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_cmp_with_frontiers' @@ -19508,7 +20327,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_commit() !== - 25168 + 60082 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_commit' @@ -19516,7 +20335,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_commit_with() !== - 65138 + 24368 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_commit_with' @@ -19524,7 +20343,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_compact_change_store() !== - 59461 + 13752 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_compact_change_store' @@ -19532,7 +20351,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_config() !== - 33471 + 33207 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_config' @@ -19540,7 +20359,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_config_default_text_style() !== - 10240 + 16382 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_config_default_text_style' @@ -19548,7 +20367,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_config_text_style() !== - 17307 + 4164 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_config_text_style' @@ -19556,7 +20375,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_delete_root_container() !== - 4559 + 32868 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_delete_root_container' @@ -19564,22 +20383,30 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_detach() !== - 24925 + 45464 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_detach' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_diff() !== 53647 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_diff() !== 55308 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_diff' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export() !== + 53489 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_export' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_json_in_id_span() !== - 4524 + 36179 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_json_in_id_span' @@ -19587,7 +20414,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_json_updates() !== - 27055 + 18187 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_json_updates' @@ -19595,7 +20422,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_json_updates_without_peer_compression() !== - 42286 + 31488 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_json_updates_without_peer_compression' @@ -19603,7 +20430,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_shallow_snapshot() !== - 20071 + 39593 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_shallow_snapshot' @@ -19611,7 +20438,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_snapshot() !== - 28510 + 63577 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_snapshot' @@ -19619,7 +20446,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_snapshot_at() !== - 37996 + 8796 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_snapshot_at' @@ -19627,7 +20454,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_state_only() !== - 29117 + 53051 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_state_only' @@ -19635,7 +20462,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_updates() !== - 2490 + 57505 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_updates' @@ -19643,7 +20470,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_export_updates_in_range() !== - 62352 + 30992 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_export_updates_in_range' @@ -19651,14 +20478,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_find_id_spans_between() !== - 1704 + 60953 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_find_id_spans_between' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_fork() !== 42814 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_fork() !== 42225 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_fork' @@ -19666,7 +20493,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_fork_at() !== - 26280 + 5389 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_fork_at' @@ -19674,7 +20501,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_free_diff_calculator() !== - 59630 + 64898 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_free_diff_calculator' @@ -19682,7 +20509,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_free_history_cache() !== - 3470 + 60140 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_free_history_cache' @@ -19690,7 +20517,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_frontiers_to_vv() !== - 11507 + 27260 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_frontiers_to_vv' @@ -19698,7 +20525,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_by_path() !== - 41531 + 52116 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_by_path' @@ -19706,7 +20533,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_by_str_path() !== - 12043 + 30228 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_by_str_path' @@ -19714,7 +20541,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_change() !== - 11256 + 27180 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_change' @@ -19722,15 +20549,23 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_changed_containers_in() !== - 34378 + 15351 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_changed_containers_in' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_container() !== + 3663 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_get_container' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_counter() !== - 60124 + 4106 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_counter' @@ -19738,7 +20573,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_cursor_pos() !== - 47 + 51447 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_cursor_pos' @@ -19746,7 +20581,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_deep_value() !== - 38910 + 18679 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_deep_value' @@ -19754,7 +20589,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_deep_value_with_id() !== - 64810 + 17431 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_deep_value_with_id' @@ -19762,7 +20597,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_list() !== - 55819 + 6839 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_list' @@ -19770,7 +20605,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_map() !== - 4871 + 33560 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_map' @@ -19778,7 +20613,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_movable_list() !== - 17784 + 16828 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_movable_list' @@ -19786,7 +20621,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_path_to_container() !== - 13102 + 25113 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_path_to_container' @@ -19794,7 +20629,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_pending_txn_len() !== - 37770 + 63419 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_pending_txn_len' @@ -19802,7 +20637,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_text() !== - 15375 + 63534 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_text' @@ -19810,7 +20645,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_tree() !== - 30197 + 42119 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_tree' @@ -19818,7 +20653,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_get_value() !== - 14086 + 2162 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_get_value' @@ -19826,7 +20661,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_has_container() !== - 21303 + 62190 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_has_container' @@ -19834,7 +20669,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_has_history_cache() !== - 18486 + 60409 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_has_history_cache' @@ -19842,7 +20677,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_import() !== - 35043 + 36238 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_import' @@ -19850,7 +20685,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_import_batch() !== - 39938 + 21386 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_import_batch' @@ -19858,7 +20693,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_import_json_updates() !== - 58091 + 47286 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_import_json_updates' @@ -19866,7 +20701,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_import_with() !== - 21187 + 64971 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_import_with' @@ -19874,7 +20709,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_is_detached() !== - 19296 + 9688 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_is_detached' @@ -19882,7 +20717,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_is_shallow() !== - 52920 + 30662 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_is_shallow' @@ -19890,7 +20725,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_jsonpath() !== - 58280 + 32650 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_jsonpath' @@ -19898,7 +20733,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_len_changes() !== - 43389 + 26187 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_len_changes' @@ -19906,7 +20741,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_len_ops() !== - 1966 + 2618 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_len_ops' @@ -19914,7 +20749,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_minimize_frontiers() !== - 47301 + 65162 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_minimize_frontiers' @@ -19922,7 +20757,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_oplog_frontiers() !== - 35760 + 381 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_oplog_frontiers' @@ -19930,7 +20765,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_oplog_vv() !== - 35992 + 53896 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_oplog_vv' @@ -19938,7 +20773,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_peer_id() !== - 5346 + 5378 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_peer_id' @@ -19946,7 +20781,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_redact_json_updates() !== - 33049 + 158 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_redact_json_updates' @@ -19954,7 +20789,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_revert_to() !== - 13908 + 1969 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_revert_to' @@ -19962,7 +20797,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_change_merge_interval() !== - 35421 + 19046 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_change_merge_interval' @@ -19970,7 +20805,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_hide_empty_root_containers() !== - 61757 + 16301 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_hide_empty_root_containers' @@ -19978,7 +20813,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_message() !== - 47832 + 52140 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_message' @@ -19986,7 +20821,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_options() !== - 53420 + 21121 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_options' @@ -19994,7 +20829,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_origin() !== - 17826 + 14331 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_origin' @@ -20002,7 +20837,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_timestamp() !== - 12708 + 46294 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_next_commit_timestamp' @@ -20010,7 +20845,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_peer_id() !== - 59162 + 12751 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_peer_id' @@ -20018,7 +20853,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_set_record_timestamp() !== - 30166 + 3837 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_set_record_timestamp' @@ -20026,7 +20861,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_shallow_since_vv() !== - 62947 + 59549 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_shallow_since_vv' @@ -20034,7 +20869,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_state_frontiers() !== - 3671 + 12243 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_state_frontiers' @@ -20042,7 +20877,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_state_vv() !== - 14064 + 29031 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_state_vv' @@ -20050,7 +20885,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe() !== - 33289 + 35308 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_subscribe' @@ -20058,15 +20893,23 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_first_commit_from_peer() !== - 65444 + 48800 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_subscribe_first_commit_from_peer' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_jsonpath() !== + 21397 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_subscribe_jsonpath' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_local_update() !== - 46483 + 1924 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_subscribe_local_update' @@ -20074,7 +20917,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_pre_commit() !== - 8982 + 62583 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_subscribe_pre_commit' @@ -20082,7 +20925,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_subscribe_root() !== - 64208 + 55012 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_subscribe_root' @@ -20090,15 +20933,63 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_travel_change_ancestors() !== - 39975 + 32967 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_travel_change_ancestors' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_counter() !== + 9399 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_try_get_counter' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_list() !== + 6950 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_try_get_list' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_map() !== + 3034 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_try_get_map' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_movable_list() !== + 10796 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_try_get_movable_list' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_text() !== + 31311 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_try_get_text' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_try_get_tree() !== + 13197 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorodoc_try_get_tree' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorodoc_vv_to_frontiers() !== - 45843 + 18612 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorodoc_vv_to_frontiers' @@ -20106,7 +20997,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_clear() !== - 59547 + 22505 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_clear' @@ -20114,21 +21005,21 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_delete() !== - 34888 + 29185 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_delete' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_doc() !== 53175 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_doc() !== 32582 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_doc' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get() !== 5256 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get() !== 43799 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_get' @@ -20136,7 +21027,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get_attached() !== - 45494 + 20814 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_get_attached' @@ -20144,7 +21035,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get_cursor() !== - 37701 + 20030 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_get_cursor' @@ -20152,7 +21043,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get_deep_value() !== - 41115 + 27395 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_get_deep_value' @@ -20160,7 +21051,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get_id_at() !== - 29299 + 37426 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_get_id_at' @@ -20168,14 +21059,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_get_value() !== - 35537 + 15209 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_get_value' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_id() !== 43156 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_id() !== 12428 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_id' @@ -20183,7 +21074,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert() !== - 8265 + 8817 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert' @@ -20191,7 +21082,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert_counter_container() !== - 32924 + 47357 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert_counter_container' @@ -20199,7 +21090,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert_list_container() !== - 3124 + 3239 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert_list_container' @@ -20207,7 +21098,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert_map_container() !== - 8686 + 15910 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert_map_container' @@ -20215,7 +21106,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert_movable_list_container() !== - 61399 + 38998 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert_movable_list_container' @@ -20223,7 +21114,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert_text_container() !== - 58385 + 35192 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert_text_container' @@ -20231,7 +21122,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_insert_tree_container() !== - 39269 + 22310 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_insert_tree_container' @@ -20239,7 +21130,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_is_attached() !== - 51464 + 4044 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_is_attached' @@ -20247,7 +21138,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_is_deleted() !== - 17142 + 29486 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_is_deleted' @@ -20255,21 +21146,21 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_is_empty() !== - 3297 + 15657 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_is_empty' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_len() !== 31562 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_len() !== 50705 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_len' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_pop() !== 46637 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_pop() !== 22083 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_pop' @@ -20277,7 +21168,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_push() !== - 48242 + 47680 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_push' @@ -20285,7 +21176,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_subscribe() !== - 37781 + 29467 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_subscribe' @@ -20293,7 +21184,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorolist_to_vec() !== - 48551 + 19165 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorolist_to_vec' @@ -20301,7 +21192,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_clear() !== - 36823 + 40464 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_clear' @@ -20309,21 +21200,21 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_delete() !== - 1727 + 49510 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_delete' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_doc() !== 23666 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_doc() !== 18081 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_doc' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get() !== 3814 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get() !== 28557 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get' @@ -20331,7 +21222,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_attached() !== - 56597 + 29326 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_attached' @@ -20339,7 +21230,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_deep_value() !== - 63734 + 52734 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_deep_value' @@ -20347,7 +21238,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_last_editor() !== - 57747 + 44829 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_last_editor' @@ -20355,7 +21246,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_or_create_counter_container() !== - 54451 + 28549 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_or_create_counter_container' @@ -20363,7 +21254,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_or_create_list_container() !== - 65040 + 35641 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_or_create_list_container' @@ -20371,7 +21262,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_or_create_map_container() !== - 8641 + 48654 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_or_create_map_container' @@ -20379,7 +21270,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_or_create_movable_list_container() !== - 43140 + 34062 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_or_create_movable_list_container' @@ -20387,7 +21278,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_or_create_text_container() !== - 26168 + 51515 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_or_create_text_container' @@ -20395,7 +21286,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_or_create_tree_container() !== - 3661 + 35595 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_or_create_tree_container' @@ -20403,14 +21294,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get_value() !== - 22622 + 28073 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_get_value' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_id() !== 57881 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_id() !== 20896 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_id' @@ -20418,7 +21309,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert() !== - 34158 + 27880 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert' @@ -20426,7 +21317,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert_counter_container() !== - 6141 + 54269 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert_counter_container' @@ -20434,7 +21325,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert_list_container() !== - 42123 + 21726 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert_list_container' @@ -20442,7 +21333,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert_map_container() !== - 17066 + 49215 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert_map_container' @@ -20450,7 +21341,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert_movable_list_container() !== - 57381 + 21652 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert_movable_list_container' @@ -20458,7 +21349,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert_text_container() !== - 28951 + 26115 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert_text_container' @@ -20466,7 +21357,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_insert_tree_container() !== - 57059 + 14812 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_insert_tree_container' @@ -20474,7 +21365,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_is_attached() !== - 41489 + 23513 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_is_attached' @@ -20482,7 +21373,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_is_deleted() !== - 32195 + 56421 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_is_deleted' @@ -20490,21 +21381,21 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_is_empty() !== - 41904 + 65475 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_is_empty' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_keys() !== 52242 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_keys() !== 42516 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_keys' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_len() !== 39413 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_len() !== 55678 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_len' @@ -20512,7 +21403,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_subscribe() !== - 52134 + 24657 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_subscribe' @@ -20520,7 +21411,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_values() !== - 59291 + 42298 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromap_values' @@ -20528,7 +21419,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_clear() !== - 12048 + 63767 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_clear' @@ -20536,7 +21427,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_delete() !== - 9110 + 58421 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_delete' @@ -20544,7 +21435,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_doc() !== - 61310 + 34003 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_doc' @@ -20552,7 +21443,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get() !== - 8877 + 48270 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get' @@ -20560,7 +21451,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_attached() !== - 42721 + 63951 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_attached' @@ -20568,7 +21459,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_creator_at() !== - 27128 + 53965 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_creator_at' @@ -20576,7 +21467,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_cursor() !== - 62502 + 44684 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_cursor' @@ -20584,7 +21475,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_deep_value() !== - 8622 + 30790 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_deep_value' @@ -20592,7 +21483,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_last_editor_at() !== - 37091 + 42594 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_last_editor_at' @@ -20600,7 +21491,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_last_mover_at() !== - 63909 + 63483 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_last_mover_at' @@ -20608,7 +21499,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_get_value() !== - 33102 + 56491 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_get_value' @@ -20616,7 +21507,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_id() !== - 25848 + 49894 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_id' @@ -20624,7 +21515,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert() !== - 47936 + 6776 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert' @@ -20632,7 +21523,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert_counter_container() !== - 38234 + 10785 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert_counter_container' @@ -20640,7 +21531,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert_list_container() !== - 50065 + 53567 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert_list_container' @@ -20648,7 +21539,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert_map_container() !== - 61365 + 31679 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert_map_container' @@ -20656,7 +21547,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert_movable_list_container() !== - 23331 + 1830 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert_movable_list_container' @@ -20664,7 +21555,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert_text_container() !== - 57512 + 60962 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert_text_container' @@ -20672,7 +21563,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_insert_tree_container() !== - 12645 + 56894 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_insert_tree_container' @@ -20680,7 +21571,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_is_attached() !== - 58545 + 3078 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_is_attached' @@ -20688,7 +21579,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_is_deleted() !== - 34830 + 21598 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_is_deleted' @@ -20696,7 +21587,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_is_empty() !== - 37813 + 53013 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_is_empty' @@ -20704,7 +21595,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_len() !== - 30817 + 50016 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_len' @@ -20712,7 +21603,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_mov() !== - 19397 + 49230 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_mov' @@ -20720,7 +21611,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_pop() !== - 7553 + 45015 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_pop' @@ -20728,7 +21619,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_push() !== - 61369 + 11158 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_push' @@ -20736,7 +21627,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set() !== - 26682 + 32811 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set' @@ -20744,7 +21635,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set_counter_container() !== - 47882 + 8075 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set_counter_container' @@ -20752,7 +21643,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set_list_container() !== - 48467 + 58914 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set_list_container' @@ -20760,7 +21651,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set_map_container() !== - 18279 + 50506 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set_map_container' @@ -20768,7 +21659,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set_movable_list_container() !== - 58356 + 20927 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set_movable_list_container' @@ -20776,7 +21667,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set_text_container() !== - 17337 + 58185 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set_text_container' @@ -20784,7 +21675,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_set_tree_container() !== - 10601 + 41399 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_set_tree_container' @@ -20792,7 +21683,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_subscribe() !== - 31212 + 14709 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_subscribe' @@ -20800,7 +21691,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromovablelist_to_vec() !== - 22764 + 56561 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_loromovablelist_to_vec' @@ -20808,7 +21699,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_apply_delta() !== - 31013 + 41282 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_apply_delta' @@ -20816,30 +21707,46 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_char_at() !== - 49891 + 56488 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_char_at' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_convert_pos() !== + 13215 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_convert_pos' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_delete() !== - 50707 + 13366 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_delete' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_delete_utf16() !== + 1964 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_delete_utf16' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_delete_utf8() !== - 47178 + 48612 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_delete_utf8' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_doc() !== 37119 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_doc() !== 16050 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_doc' @@ -20847,7 +21754,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_get_attached() !== - 36679 + 58503 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_get_attached' @@ -20855,7 +21762,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_get_cursor() !== - 14735 + 63228 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_get_cursor' @@ -20863,7 +21770,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_get_editor_at_unicode_pos() !== - 20823 + 49875 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_get_editor_at_unicode_pos' @@ -20871,14 +21778,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_get_richtext_value() !== - 41287 + 46420 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_get_richtext_value' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_id() !== 15221 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_id() !== 62973 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_id' @@ -20886,15 +21793,23 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_insert() !== - 28264 + 45344 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_insert' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_insert_utf16() !== + 12193 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_insert_utf16' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_insert_utf8() !== - 16771 + 61958 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_insert_utf8' @@ -20902,7 +21817,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_is_attached() !== - 58046 + 28935 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_is_attached' @@ -20910,7 +21825,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_is_deleted() !== - 31785 + 34698 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_is_deleted' @@ -20918,7 +21833,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_is_empty() !== - 46465 + 22827 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_is_empty' @@ -20926,7 +21841,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_len_unicode() !== - 20282 + 6982 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_len_unicode' @@ -20934,7 +21849,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_len_utf16() !== - 31093 + 51193 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_len_utf16' @@ -20942,7 +21857,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_len_utf8() !== - 7703 + 46019 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_len_utf8' @@ -20950,15 +21865,31 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_mark() !== - 24092 + 64385 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_mark' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_mark_utf16() !== + 34804 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_mark_utf16' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_mark_utf8() !== + 15042 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_mark_utf8' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_push_str() !== - 46599 + 16169 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_push_str' @@ -20966,23 +21897,47 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_slice() !== - 10385 + 29340 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_slice' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_slice_delta() !== + 33116 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_slice_delta' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_slice_utf16() !== + 19170 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_slice_utf16' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_splice() !== - 53391 + 26889 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_splice' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_splice_utf16() !== + 17916 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_lorotext_splice_utf16' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_subscribe() !== - 55608 + 13769 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_subscribe' @@ -20990,31 +21945,31 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_to_delta() !== - 49666 + 45730 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_to_delta' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_to_string() !== - 28280 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_unmark() !== + 29561 ) { throw new UniffiInternalError.ApiChecksumMismatch( - 'uniffi_loro_ffi_checksum_method_lorotext_to_string' + 'uniffi_loro_ffi_checksum_method_lorotext_unmark' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_unmark() !== - 47537 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_unmark_utf16() !== + 864 ) { throw new UniffiInternalError.ApiChecksumMismatch( - 'uniffi_loro_ffi_checksum_method_lorotext_unmark' + 'uniffi_loro_ffi_checksum_method_lorotext_unmark_utf16' ); } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_update() !== - 25715 + 5107 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_update' @@ -21022,7 +21977,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotext_update_by_line() !== - 58900 + 58904 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotext_update_by_line' @@ -21030,7 +21985,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_children() !== - 34358 + 33596 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_children' @@ -21038,7 +21993,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_children_num() !== - 8923 + 15974 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_children_num' @@ -21046,7 +22001,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_contains() !== - 37670 + 41122 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_contains' @@ -21054,7 +22009,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_create() !== - 38374 + 40493 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_create' @@ -21062,7 +22017,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_create_at() !== - 47251 + 2227 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_create_at' @@ -21070,7 +22025,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_delete() !== - 46062 + 59456 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_delete' @@ -21078,14 +22033,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_disable_fractional_index() !== - 6413 + 14848 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_disable_fractional_index' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_doc() !== 46210 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_doc() !== 60899 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_doc' @@ -21093,7 +22048,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_enable_fractional_index() !== - 60734 + 49451 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_enable_fractional_index' @@ -21101,7 +22056,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_fractional_index() !== - 14495 + 55391 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_fractional_index' @@ -21109,7 +22064,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_get_attached() !== - 59293 + 25827 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_get_attached' @@ -21117,7 +22072,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_get_last_move_id() !== - 40233 + 10316 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_get_last_move_id' @@ -21125,7 +22080,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_get_meta() !== - 33850 + 62694 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_get_meta' @@ -21133,7 +22088,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_get_value() !== - 1865 + 56278 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_get_value' @@ -21141,14 +22096,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_get_value_with_meta() !== - 15594 + 38489 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_get_value_with_meta' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_id() !== 16524 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_id() !== 49388 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_id' @@ -21156,7 +22111,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_is_attached() !== - 57971 + 41078 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_is_attached' @@ -21164,7 +22119,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_is_deleted() !== - 34560 + 42047 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_is_deleted' @@ -21172,7 +22127,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_is_fractional_index_enabled() !== - 28969 + 35791 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_is_fractional_index_enabled' @@ -21180,14 +22135,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_is_node_deleted() !== - 16024 + 60159 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_is_node_deleted' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_mov() !== 20249 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_mov() !== 10199 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_mov' @@ -21195,7 +22150,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_mov_after() !== - 21386 + 27389 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_mov_after' @@ -21203,7 +22158,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_mov_before() !== - 13866 + 43452 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_mov_before' @@ -21211,7 +22166,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_mov_to() !== - 32503 + 62901 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_mov_to' @@ -21219,7 +22174,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_nodes() !== - 19191 + 3820 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_nodes' @@ -21227,7 +22182,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_parent() !== - 19692 + 20261 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_parent' @@ -21235,7 +22190,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_roots() !== - 6925 + 8447 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_roots' @@ -21243,7 +22198,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorotree_subscribe() !== - 4481 + 44406 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorotree_subscribe' @@ -21251,7 +22206,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorounknown_id() !== - 45333 + 31175 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorounknown_id' @@ -21259,14 +22214,14 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_lorovaluelike_as_loro_value() !== - 45291 + 14432 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_lorovaluelike_as_loro_value' ); } if ( - nativeModule().ubrn_uniffi_loro_ffi_checksum_method_onpop_on_pop() !== 48967 + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_onpop_on_pop() !== 16868 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_onpop_on_pop' @@ -21274,7 +22229,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_onpush_on_push() !== - 12923 + 6706 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_onpush_on_push' @@ -21282,7 +22237,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_precommitcallback_on_pre_commit() !== - 57839 + 21898 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_precommitcallback_on_pre_commit' @@ -21290,7 +22245,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_styleconfigmap_get() !== - 5813 + 34004 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_styleconfigmap_get' @@ -21298,7 +22253,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_styleconfigmap_insert() !== - 64615 + 31271 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_styleconfigmap_insert' @@ -21306,7 +22261,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_subscriber_on_diff() !== - 37249 + 16052 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_subscriber_on_diff' @@ -21314,7 +22269,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_subscription_detach() !== - 63099 + 8815 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_subscription_detach' @@ -21322,7 +22277,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_subscription_unsubscribe() !== - 46858 + 47660 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_subscription_unsubscribe' @@ -21330,7 +22285,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_add_exclude_origin_prefix() !== - 63740 + 22426 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_add_exclude_origin_prefix' @@ -21338,7 +22293,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_can_redo() !== - 35475 + 54815 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_can_redo' @@ -21346,7 +22301,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_can_undo() !== - 42348 + 25321 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_can_undo' @@ -21354,7 +22309,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_group_end() !== - 37541 + 55114 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_group_end' @@ -21362,7 +22317,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_group_start() !== - 64372 + 14272 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_group_start' @@ -21370,7 +22325,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_peer() !== - 45180 + 4604 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_peer' @@ -21378,7 +22333,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_record_new_checkpoint() !== - 12209 + 3883 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_record_new_checkpoint' @@ -21386,7 +22341,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_redo() !== - 52607 + 59384 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_redo' @@ -21394,7 +22349,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_redo_count() !== - 12383 + 16261 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_redo_count' @@ -21402,7 +22357,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_set_max_undo_steps() !== - 20261 + 10866 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_set_max_undo_steps' @@ -21410,7 +22365,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_set_merge_interval() !== - 34577 + 4337 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_set_merge_interval' @@ -21418,7 +22373,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_set_on_pop() !== - 54502 + 10610 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_set_on_pop' @@ -21426,7 +22381,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_set_on_push() !== - 23722 + 60889 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_set_on_push' @@ -21434,7 +22389,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_top_redo_meta() !== - 15306 + 23778 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_top_redo_meta' @@ -21442,7 +22397,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_top_redo_value() !== - 57224 + 36239 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_top_redo_value' @@ -21450,7 +22405,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_top_undo_meta() !== - 26343 + 28894 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_top_undo_meta' @@ -21458,7 +22413,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_top_undo_value() !== - 42818 + 62967 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_top_undo_value' @@ -21466,7 +22421,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_undo() !== - 51407 + 63498 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_undo' @@ -21474,7 +22429,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_undomanager_undo_count() !== - 43432 + 5827 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_undomanager_undo_count' @@ -21482,7 +22437,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_unsubscriber_on_unsubscribe() !== - 64065 + 50021 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_unsubscriber_on_unsubscribe' @@ -21490,7 +22445,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_container() !== - 16799 + 42110 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_container' @@ -21498,7 +22453,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_counter() !== - 36547 + 53314 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_counter' @@ -21506,7 +22461,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_list() !== - 46429 + 30961 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_list' @@ -21514,7 +22469,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_map() !== - 40964 + 11200 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_map' @@ -21522,7 +22477,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_movable_list() !== - 56652 + 14129 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_movable_list' @@ -21530,7 +22485,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_text() !== - 7756 + 13868 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_text' @@ -21538,7 +22493,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_tree() !== - 13237 + 52885 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_tree' @@ -21546,7 +22501,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_unknown() !== - 3157 + 22812 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_loro_unknown' @@ -21554,7 +22509,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_as_value() !== - 16217 + 59369 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_as_value' @@ -21562,7 +22517,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_container_type() !== - 14339 + 1471 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_container_type' @@ -21570,7 +22525,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_is_container() !== - 13147 + 62677 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_is_container' @@ -21578,7 +22533,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_valueorcontainer_is_value() !== - 20846 + 30013 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_valueorcontainer_is_value' @@ -21586,7 +22541,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_clear() !== - 22575 + 48984 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_clear' @@ -21594,7 +22549,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_contains_id() !== - 4971 + 2135 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_contains_id' @@ -21602,7 +22557,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_contains_id_span() !== - 52504 + 354 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_contains_id_span' @@ -21610,7 +22565,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_contains_ops_between() !== - 61529 + 51746 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_contains_ops_between' @@ -21618,7 +22573,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_extends_to_include_id_span() !== - 16625 + 45425 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_extends_to_include_id_span' @@ -21626,7 +22581,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_get() !== - 50783 + 32621 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_get' @@ -21634,7 +22589,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_get_all_ranges() !== - 20760 + 10172 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_get_all_ranges' @@ -21642,7 +22597,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_get_peers() !== - 40505 + 56723 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_get_peers' @@ -21650,7 +22605,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_has_overlap_with() !== - 65383 + 34382 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_has_overlap_with' @@ -21658,7 +22613,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_insert() !== - 44262 + 58608 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_insert' @@ -21666,7 +22621,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionrange_is_empty() !== - 60658 + 38493 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionrange_is_empty' @@ -21674,7 +22629,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_diff() !== - 2647 + 31453 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_diff' @@ -21682,7 +22637,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_encode() !== - 6292 + 24253 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_encode' @@ -21690,7 +22645,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_eq() !== - 43362 + 46641 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_eq' @@ -21698,7 +22653,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_extend_to_include_vv() !== - 31287 + 18145 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_extend_to_include_vv' @@ -21706,7 +22661,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_get_last() !== - 2350 + 47068 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_get_last' @@ -21714,7 +22669,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_get_missing_span() !== - 31140 + 53847 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_get_missing_span' @@ -21722,7 +22677,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_includes_id() !== - 60251 + 3872 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_includes_id' @@ -21730,7 +22685,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_includes_vv() !== - 39671 + 9524 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_includes_vv' @@ -21738,7 +22693,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_intersect_span() !== - 53818 + 41766 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_intersect_span' @@ -21746,7 +22701,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_merge() !== - 25828 + 11299 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_merge' @@ -21754,7 +22709,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_partial_cmp() !== - 25946 + 43067 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_partial_cmp' @@ -21762,7 +22717,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_set_end() !== - 54771 + 61955 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_set_end' @@ -21770,7 +22725,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_set_last() !== - 28435 + 64951 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_set_last' @@ -21778,7 +22733,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_to_hashmap() !== - 56398 + 36085 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_to_hashmap' @@ -21786,7 +22741,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_versionvector_try_update_last() !== - 58412 + 42303 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_method_versionvector_try_update_last' @@ -21794,7 +22749,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_awareness_new() !== - 18821 + 37207 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_awareness_new' @@ -21802,7 +22757,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_cursor_decode() !== - 31913 + 33890 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_cursor_decode' @@ -21810,7 +22765,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_cursor_new() !== - 32460 + 54829 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_cursor_new' @@ -21818,7 +22773,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_diffbatch_new() !== - 22613 + 19555 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_diffbatch_new' @@ -21826,7 +22781,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_ephemeralstore_new() !== - 38977 + 31491 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_ephemeralstore_new' @@ -21834,7 +22789,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_fractionalindex_from_bytes() !== - 9241 + 32286 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_fractionalindex_from_bytes' @@ -21842,7 +22797,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_fractionalindex_from_hex_string() !== - 44261 + 54535 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_fractionalindex_from_hex_string' @@ -21850,7 +22805,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_frontiers_decode() !== - 45600 + 45695 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_frontiers_decode' @@ -21858,7 +22813,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_frontiers_from_id() !== - 7560 + 62202 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_frontiers_from_id' @@ -21866,7 +22821,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_frontiers_from_ids() !== - 62627 + 61802 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_frontiers_from_ids' @@ -21874,7 +22829,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_frontiers_new() !== - 15591 + 19870 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_frontiers_new' @@ -21882,7 +22837,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_lorocounter_new() !== - 21553 + 45569 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_lorocounter_new' @@ -21890,7 +22845,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_lorodoc_new() !== - 34555 + 54449 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_lorodoc_new' @@ -21898,7 +22853,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_lorolist_new() !== - 41972 + 56534 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_lorolist_new' @@ -21906,7 +22861,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_loromap_new() !== - 27269 + 4843 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_loromap_new' @@ -21914,7 +22869,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_loromovablelist_new() !== - 1821 + 4184 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_loromovablelist_new' @@ -21922,7 +22877,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_lorotext_new() !== - 9497 + 39663 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_lorotext_new' @@ -21930,7 +22885,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_lorotree_new() !== - 27388 + 45261 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_lorotree_new' @@ -21938,7 +22893,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_styleconfigmap_default_rich_text_config() !== - 65451 + 15944 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_styleconfigmap_default_rich_text_config' @@ -21946,7 +22901,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_styleconfigmap_new() !== - 63349 + 35144 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_styleconfigmap_new' @@ -21954,7 +22909,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_undomanager_new() !== - 31025 + 26513 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_undomanager_new' @@ -21962,7 +22917,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_versionrange_from_vv() !== - 10426 + 38529 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_versionrange_from_vv' @@ -21970,7 +22925,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_versionrange_new() !== - 7136 + 29484 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_versionrange_new' @@ -21978,7 +22933,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_versionvector_decode() !== - 54438 + 47705 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_versionvector_decode' @@ -21986,7 +22941,7 @@ function uniffiEnsureInitialized() { } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_constructor_versionvector_new() !== - 28341 + 16502 ) { throw new UniffiInternalError.ApiChecksumMismatch( 'uniffi_loro_ffi_checksum_constructor_versionvector_new' @@ -21997,6 +22952,7 @@ function uniffiEnsureInitialized() { uniffiCallbackInterfaceContainerIdLike.register(); uniffiCallbackInterfaceEphemeralSubscriber.register(); uniffiCallbackInterfaceFirstCommitFromPeerCallback.register(); + uniffiCallbackInterfaceJsonPathSubscriber.register(); uniffiCallbackInterfaceLocalEphemeralListener.register(); uniffiCallbackInterfaceLocalUpdateCallback.register(); uniffiCallbackInterfaceLoroValueLike.register(); @@ -22013,9 +22969,11 @@ export default Object.freeze({ FfiConverterTypeAbsolutePosition, FfiConverterTypeAwareness, FfiConverterTypeAwarenessPeerUpdate, + FfiConverterTypeCannotFindRelativePosition, FfiConverterTypeChangeAncestorsTraveler, FfiConverterTypeChangeMeta, FfiConverterTypeChangeModifier, + FfiConverterTypeChangeTravelError, FfiConverterTypeCommitOptions, FfiConverterTypeConfigure, FfiConverterTypeContainerDiff, @@ -22036,6 +22994,7 @@ export default Object.freeze({ FfiConverterTypeEphemeralSubscriber, FfiConverterTypeEventTriggerKind, FfiConverterTypeExpandType, + FfiConverterTypeExportMode, FfiConverterTypeFirstCommitFromPeerCallback, FfiConverterTypeFirstCommitFromPeerPayload, FfiConverterTypeFractionalIndex, @@ -22047,11 +23006,15 @@ export default Object.freeze({ FfiConverterTypeImportBlobMetadata, FfiConverterTypeImportStatus, FfiConverterTypeIndex, + FfiConverterTypeJsonPathError, + FfiConverterTypeJsonPathSubscriber, FfiConverterTypeListDiffItem, FfiConverterTypeLocalEphemeralListener, FfiConverterTypeLocalUpdateCallback, FfiConverterTypeLoroCounter, FfiConverterTypeLoroDoc, + FfiConverterTypeLoroEncodeError, + FfiConverterTypeLoroError, FfiConverterTypeLoroList, FfiConverterTypeLoroMap, FfiConverterTypeLoroMovableList, @@ -22067,6 +23030,7 @@ export default Object.freeze({ FfiConverterTypePathItem, FfiConverterTypePeerInfo, FfiConverterTypePosQueryResult, + FfiConverterTypePosType, FfiConverterTypePreCommitCallback, FfiConverterTypePreCommitCallbackPayload, FfiConverterTypeSide, @@ -22085,6 +23049,7 @@ export default Object.freeze({ FfiConverterTypeUndoOrRedo, FfiConverterTypeUnsubscriber, FfiConverterTypeUpdateOptions, + FfiConverterTypeUpdateTimeoutError, FfiConverterTypeValueOrContainer, FfiConverterTypeVersionRange, FfiConverterTypeVersionRangeItem, diff --git a/src/index.tsx b/src/index.tsx index fff9c56..50f8f42 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -27,6 +27,13 @@ if (!initialized) { initialized = true; } export * from './extension'; +// This provides parity with the index.web.ts version of this file. +// The web version relies on an asynchronous fetch, which this doesn't +// need, so we just no-op. +export async function uniffiInitAsync() { + // NOOP. +} + // Export the crates as individually namespaced objects. export default { loro, diff --git a/yarn.lock b/yarn.lock index 60f0902..f0fc9a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8368,7 +8368,7 @@ __metadata: release-it: ^17.10.0 turbo: ^1.10.7 typescript: ^5.8.3 - uniffi-bindgen-react-native: 0.28.3-5 + uniffi-bindgen-react-native: 0.31.0-2 peerDependencies: react: "*" react-native: "*" @@ -11969,13 +11969,13 @@ __metadata: languageName: node linkType: hard -"uniffi-bindgen-react-native@npm:0.28.3-5": - version: 0.28.3-5 - resolution: "uniffi-bindgen-react-native@npm:0.28.3-5" +"uniffi-bindgen-react-native@npm:0.31.0-2": + version: 0.31.0-2 + resolution: "uniffi-bindgen-react-native@npm:0.31.0-2" bin: ubrn: bin/cli.cjs uniffi-bindgen-react-native: bin/cli.cjs - checksum: c08dc54024c2d8158c52283e8b8ce0e256bca22e20ea4a7d89b2af438ca57e2405b52f2790c89a1b368c5062d3f5528aebd9dc88953c5add83e39a075ca6060b + checksum: 7cd9a7a2714edc6c2e5416126362c6d9120071b917115667fa0bb5498df3797aa4c11a64480995b6b73f3b979d368420b1d60bf11a43c7a5cc3131c5b722a4ad languageName: node linkType: hard From 00baf1f816ddbd36c65664277f2a4e873afbdf70 Mon Sep 17 00:00:00 2001 From: Leon Zhao Date: Sun, 14 Jun 2026 15:18:37 +0800 Subject: [PATCH 2/3] chore: upgrade react native binding to 1.13.1 --- example/ios/Podfile.lock | 4 +- loro-rs/Cargo.lock | 30 ++++--- loro-rs/Cargo.toml | 4 +- package.json | 2 +- src/generated/loro-ffi.ts | 36 +++++++++ src/generated/loro.ts | 162 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 217 insertions(+), 21 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 3ed5288..5fac5e3 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -8,7 +8,7 @@ PODS: - hermes-engine (0.79.2): - hermes-engine/Pre-built (= 0.79.2) - hermes-engine/Pre-built (0.79.2) - - loro-react-native (1.12.0): + - loro-react-native (1.13.1): - DoubleConversion - glog - hermes-engine @@ -1917,7 +1917,7 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 hermes-engine: 314be5250afa5692b57b4dd1705959e1973a8ebe - loro-react-native: 2808df0cb6889cb4a64a5ba093907545873a39a4 + loro-react-native: 20b44780910281515017a631b3f6003185366cef RCT-Folly: 36fe2295e44b10d831836cc0d1daec5f8abcf809 RCTDeprecation: 83ffb90c23ee5cea353bd32008a7bca100908f8c RCTRequired: eb7c0aba998009f47a540bec9e9d69a54f68136e diff --git a/loro-rs/Cargo.lock b/loro-rs/Cargo.lock index c7d7d42..dbd336a 100644 --- a/loro-rs/Cargo.lock +++ b/loro-rs/Cargo.lock @@ -726,9 +726,9 @@ dependencies = [ [[package]] name = "loro" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc16ee5fdda7bff6bbbd4ff276c31aa9747bc90ad1bdccf8f0da97cd2949c8a" +checksum = "7bd1b63cd2f0cf66acbbb3191c41feaff03c94c3f6c6bb1e61d2ab3062c301c7" dependencies = [ "enum-as-inner 0.6.1", "generic-btree", @@ -742,9 +742,9 @@ dependencies = [ [[package]] name = "loro-common" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193e88dedf3bc07f3b25ec8bb609dd461349b26942e43933cb0f599bc09d9c5b" +checksum = "b51042936156a1d537df8a38938ec8ed24b45de14530af933c1d02de39c9e056" dependencies = [ "arbitrary", "enum-as-inner 0.6.1", @@ -760,9 +760,9 @@ dependencies = [ [[package]] name = "loro-delta" -version = "1.9.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eafa788a72c1cbf0b7dc08a862cd7cc31b96d99c2ef749cdc94c2330f9494d3" +checksum = "96f381e7fb5d4bf5605b4f4a9241f3adf61403ded978d757552004c8302cccbb" dependencies = [ "arrayvec", "enum-as-inner 0.5.1", @@ -772,9 +772,7 @@ dependencies = [ [[package]] name = "loro-ffi" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212322ccd989eb5408b18c43764eef4872d3d17bc2d0fd910346ba0b9cf70ceb" +version = "1.13.1" dependencies = [ "loro", "serde_json", @@ -783,9 +781,9 @@ dependencies = [ [[package]] name = "loro-internal" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d42db22ea93c266d5b6ef09ba94af080b6a4d131942e9a28bfa6a218b312b5f" +checksum = "252a84196402ac55a7dd064af87a747a430fc176ec744d5bb99f4ed92e639fa8" dependencies = [ "append-only-bytes", "arref", @@ -830,9 +828,9 @@ dependencies = [ [[package]] name = "loro-kv-store" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18853eed186c39e0b9d541a1f847161ad05bcf366c412068c9d257d5d981a9b5" +checksum = "950cc8bcc64dcff536e949fbc56ccc3d0759646fa441c7f76b3cd7c3eafa2096" dependencies = [ "bytes", "ensure-cov", @@ -858,7 +856,7 @@ dependencies = [ [[package]] name = "loro-rs" -version = "1.12.0" +version = "1.13.1" dependencies = [ "loro-ffi", "uniffi", @@ -872,9 +870,9 @@ checksum = "3f3d053a135388e6b1df14e8af1212af5064746e9b87a06a345a7a779ee9695a" [[package]] name = "loro_fractional_index" -version = "1.6.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c8ea186958094052b971fe7e322a934b034c3bf62f0458ccea04fcd687ba1" +checksum = "aca7180674d0273ddf37049a5efcde4547fd5330d24abb7519bb9d9eb6780d5b" dependencies = [ "once_cell", "rand", diff --git a/loro-rs/Cargo.toml b/loro-rs/Cargo.toml index 633fb76..808d40f 100644 --- a/loro-rs/Cargo.toml +++ b/loro-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loro-rs" -version = "1.12.0" +version = "1.13.1" edition = "2021" [lib] @@ -11,7 +11,7 @@ name = "uniffi-bindgen" path = "src/uniffi-bindgen.rs" [dependencies] -loro-ffi = { version = "1.12.0" } +loro-ffi = { version = "1.13.1" } uniffi = { version = "0.31.1" } [build-dependencies] diff --git a/package.json b/package.json index d73ed80..03b484a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loro-react-native", - "version": "1.12.0", + "version": "1.13.1", "description": "React native binding for Loro", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/src/generated/loro-ffi.ts b/src/generated/loro-ffi.ts index 48073ba..86b3f6a 100644 --- a/src/generated/loro-ffi.ts +++ b/src/generated/loro-ffi.ts @@ -1062,6 +1062,36 @@ interface NativeModuleInterface { ptr: bigint, uniffi_out_err: UniffiRustCallStatus ): Uint8Array; + ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_counter( + ptr: bigint, + key: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): bigint; + ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_list( + ptr: bigint, + key: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): bigint; + ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_map( + ptr: bigint, + key: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): bigint; + ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_movable_list( + ptr: bigint, + key: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): bigint; + ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_text( + ptr: bigint, + key: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): bigint; + ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_tree( + ptr: bigint, + key: Uint8Array, + uniffi_out_err: UniffiRustCallStatus + ): bigint; ubrn_uniffi_loro_ffi_fn_method_loromap_get( ptr: bigint, key: Uint8Array, @@ -2384,6 +2414,12 @@ interface NativeModuleInterface { ubrn_uniffi_loro_ffi_checksum_method_loromap_clear(): number; ubrn_uniffi_loro_ffi_checksum_method_loromap_delete(): number; ubrn_uniffi_loro_ffi_checksum_method_loromap_doc(): number; + ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_counter(): number; + ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_list(): number; + ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_map(): number; + ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_movable_list(): number; + ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_text(): number; + ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_tree(): number; ubrn_uniffi_loro_ffi_checksum_method_loromap_get(): number; ubrn_uniffi_loro_ffi_checksum_method_loromap_get_attached(): number; ubrn_uniffi_loro_ffi_checksum_method_loromap_get_deep_value(): number; diff --git a/src/generated/loro.ts b/src/generated/loro.ts index 262fde1..bff4458 100644 --- a/src/generated/loro.ts +++ b/src/generated/loro.ts @@ -12705,6 +12705,12 @@ export interface LoroMapLike { * Get the LoroDoc from this container */ doc(): LoroDocLike | undefined; + ensureMergeableCounter(key: string) /*throws*/ : LoroCounterLike; + ensureMergeableList(key: string) /*throws*/ : LoroListLike; + ensureMergeableMap(key: string) /*throws*/ : LoroMapLike; + ensureMergeableMovableList(key: string) /*throws*/ : LoroMovableListLike; + ensureMergeableText(key: string) /*throws*/ : LoroTextLike; + ensureMergeableTree(key: string) /*throws*/ : LoroTreeLike; /** * Get the value of the map with the given key. */ @@ -12907,6 +12913,114 @@ export class LoroMap extends UniffiAbstractObject implements LoroMapLike { ); } + ensureMergeableCounter(key: string): LoroCounterLike /*throws*/ { + return FfiConverterTypeLoroCounter.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_counter( + uniffiTypeLoroMapObjectFactory.clonePointer(this), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + ensureMergeableList(key: string): LoroListLike /*throws*/ { + return FfiConverterTypeLoroList.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_list( + uniffiTypeLoroMapObjectFactory.clonePointer(this), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + ensureMergeableMap(key: string): LoroMapLike /*throws*/ { + return FfiConverterTypeLoroMap.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_map( + uniffiTypeLoroMapObjectFactory.clonePointer(this), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + ensureMergeableMovableList(key: string): LoroMovableListLike /*throws*/ { + return FfiConverterTypeLoroMovableList.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_movable_list( + uniffiTypeLoroMapObjectFactory.clonePointer(this), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + ensureMergeableText(key: string): LoroTextLike /*throws*/ { + return FfiConverterTypeLoroText.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_text( + uniffiTypeLoroMapObjectFactory.clonePointer(this), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + + ensureMergeableTree(key: string): LoroTreeLike /*throws*/ { + return FfiConverterTypeLoroTree.lift( + uniffiCaller.rustCallWithError( + /*liftError:*/ FfiConverterTypeLoroError.lift.bind( + FfiConverterTypeLoroError + ), + /*caller:*/ (callStatus) => { + return nativeModule().ubrn_uniffi_loro_ffi_fn_method_loromap_ensure_mergeable_tree( + uniffiTypeLoroMapObjectFactory.clonePointer(this), + FfiConverterString.lower(key), + callStatus + ); + }, + /*liftString:*/ FfiConverterString.lift + ) + ); + } + /** * Get the value of the map with the given key. */ @@ -21213,6 +21327,54 @@ function uniffiEnsureInitialized() { 'uniffi_loro_ffi_checksum_method_loromap_doc' ); } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_counter() !== + 45050 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_counter' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_list() !== + 52705 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_list' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_map() !== + 9978 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_map' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_movable_list() !== + 54435 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_movable_list' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_text() !== + 48183 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_text' + ); + } + if ( + nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_tree() !== + 32019 + ) { + throw new UniffiInternalError.ApiChecksumMismatch( + 'uniffi_loro_ffi_checksum_method_loromap_ensure_mergeable_tree' + ); + } if ( nativeModule().ubrn_uniffi_loro_ffi_checksum_method_loromap_get() !== 28557 ) { From 23fc6f0fbd4489c5d14b312b04260d75a1b246db Mon Sep 17 00:00:00 2001 From: Leon Zhao Date: Sun, 14 Jun 2026 16:06:05 +0800 Subject: [PATCH 3/3] chore: use published loro ffi 1.13.1 --- loro-rs/Cargo.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loro-rs/Cargo.lock b/loro-rs/Cargo.lock index dbd336a..06cbddd 100644 --- a/loro-rs/Cargo.lock +++ b/loro-rs/Cargo.lock @@ -773,6 +773,8 @@ dependencies = [ [[package]] name = "loro-ffi" version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128045da1884d235943b6e35595dc4fb3128b39af75ca93ea1d466b3a000f28a" dependencies = [ "loro", "serde_json",