diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ce72204..fdfb304 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,10 +11,12 @@ jobs: DEVELOPER_DIR: /Applications/Xcode_15.4.app steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.80.0 + toolchain: 1.82.0 default: true - name: get xcode information run: | diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index 55cbacb..3b31b3d 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -13,7 +13,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 + submodules: recursive token: ${{ secrets.GITHUB_TOKEN }} - name: Extract version from tag diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ff36dfc --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "loro-ffi"] + path = loro-ffi + url = https://github.com/loro-dev/loro-ffi.git diff --git a/loro-ffi b/loro-ffi new file mode 160000 index 0000000..f7b57b5 --- /dev/null +++ b/loro-ffi @@ -0,0 +1 @@ +Subproject commit f7b57b579316dce33f679e4fa7ba0dde5a261b53 diff --git a/loro-rs/.gitignore b/loro-rs/.gitignore deleted file mode 100644 index c41cc9e..0000000 --- a/loro-rs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target \ No newline at end of file diff --git a/loro-rs/Cargo.lock b/loro-rs/Cargo.lock deleted file mode 100644 index e1b6959..0000000 --- a/loro-rs/Cargo.lock +++ /dev/null @@ -1,1949 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" -dependencies = [ - "anstyle", - "once_cell", - "windows-sys", -] - -[[package]] -name = "anyhow" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" - -[[package]] -name = "append-only-bytes" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac436601d6bdde674a0d7fb593e829ffe7b3387c351b356dd20e2d40f5bf3ee5" - -[[package]] -name = "arbitrary" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" -dependencies = [ - "derive_arbitrary", -] - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "arref" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccd462b64c3c72f1be8305905a85d85403d768e8690c9b8bd3b9009a5761679" - -[[package]] -name = "askama" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" -dependencies = [ - "askama_derive", - "askama_escape", -] - -[[package]] -name = "askama_derive" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" -dependencies = [ - "askama_parser", - "basic-toml", - "mime", - "mime_guess", - "proc-macro2", - "quote", - "serde", - "syn 2.0.98", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" -dependencies = [ - "nom", -] - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "basic-toml" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" -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.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" - -[[package]] -name = "bitmaps" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" -dependencies = [ - "typenum", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" - -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "4.5.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.98", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "derive_arbitrary" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "ensure-cov" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33753185802e107b8fa907192af1f0eca13b1fb33327a59266d650fef29b2b4e" - -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "enum_dispatch" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" -dependencies = [ - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generator" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" -dependencies = [ - "cfg-if", - "libc", - "log", - "rustversion", - "windows", -] - -[[package]] -name = "generic-btree" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210507e6dec78bb1304e52a174bd99efdd83894219bf20d656a066a0ce2fedc5" -dependencies = [ - "arref", - "fxhash", - "heapless 0.7.17", - "itertools 0.11.0", - "loro-thunderdome", - "proc-macro2", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "goblin" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" -dependencies = [ - "log", - "plain", - "scroll", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version", - "serde", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32 0.3.1", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "im" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" -dependencies = [ - "bitmaps", - "rand_core", - "rand_xoshiro", - "serde", - "sized-chunks", - "typenum", - "version_check", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" - -[[package]] -name = "loom" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "loro" -version = "1.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a861e6a012edc8deb08a8d09c4d9eb78e5523011f2f2ab7bf878bcacd8debbfd" -dependencies = [ - "enum-as-inner 0.6.1", - "fxhash", - "generic-btree", - "loro-common", - "loro-delta", - "loro-internal", - "loro-kv-store", - "tracing", -] - -[[package]] -name = "loro-common" -version = "1.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b84787030d7925d43f125841d3ce7e4850ffac80d2687cdaa9fd571e67129b" -dependencies = [ - "arbitrary", - "enum-as-inner 0.6.1", - "fxhash", - "leb128", - "loro-rle", - "nonmax", - "serde", - "serde_columnar", - "serde_json", - "thiserror", -] - -[[package]] -name = "loro-delta" -version = "1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b920ad564430b2e392ac6f0e8f97ef5745960cc40edc482be57a407db1c243" -dependencies = [ - "arrayvec", - "enum-as-inner 0.5.1", - "generic-btree", - "heapless 0.8.0", -] - -[[package]] -name = "loro-ffi" -version = "1.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4964187ec4d1eb50da5f0a6b162689834d5d2f9f9bcd6c0941f20791d6d442" -dependencies = [ - "loro", - "serde_json", -] - -[[package]] -name = "loro-internal" -version = "1.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1467b6b499e3d41909cbf524a5000bcbbc21af1205d2ee20290bed140395124b" -dependencies = [ - "append-only-bytes", - "arref", - "bytes", - "either", - "ensure-cov", - "enum-as-inner 0.6.1", - "enum_dispatch", - "fxhash", - "generic-btree", - "getrandom", - "im", - "itertools 0.12.1", - "leb128", - "loom", - "loro-common", - "loro-delta", - "loro-kv-store", - "loro-rle", - "loro_fractional_index", - "md5", - "nonmax", - "num", - "num-traits", - "once_cell", - "postcard", - "pretty_assertions", - "rand", - "serde", - "serde_columnar", - "serde_json", - "smallvec", - "thiserror", - "thread_local", - "tracing", - "wasm-bindgen", - "xxhash-rust", -] - -[[package]] -name = "loro-kv-store" -version = "1.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1e5fe58c0245e62775784b6ac69cbe04a081f3348ec3b9742ecc7901085c18" -dependencies = [ - "bytes", - "ensure-cov", - "fxhash", - "loro-common", - "lz4_flex", - "once_cell", - "quick_cache", - "tracing", - "xxhash-rust", -] - -[[package]] -name = "loro-rle" -version = "1.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "077b51e4eac04e7f18574f7e6ac0201ffd98ff65015343eee3702bc3e7c49dc8" -dependencies = [ - "append-only-bytes", - "num", - "smallvec", -] - -[[package]] -name = "loro-swift" -version = "1.5.0" -dependencies = [ - "loro-ffi", - "uniffi", -] - -[[package]] -name = "loro-thunderdome" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f3d053a135388e6b1df14e8af1212af5064746e9b87a06a345a7a779ee9695a" - -[[package]] -name = "loro_fractional_index" -version = "1.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e387a04d7d6a74ebb3434c906c84ddcae4413e5ef8bcd8e7d5138959d416a512" -dependencies = [ - "once_cell", - "rand", - "serde", -] - -[[package]] -name = "lz4_flex" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" -dependencies = [ - "twox-hash", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "md5" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nonmax" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "postcard" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" -dependencies = [ - "cobs", - "embedded-io 0.4.0", - "embedded-io 0.6.1", - "heapless 0.7.17", - "serde", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "pretty_assertions" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" -dependencies = [ - "diff", - "yansi", -] - -[[package]] -name = "proc-macro2" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick_cache" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f67cfc9c723c39f3615eb0840b00c4cb9e2b068d2fa761a30d845ec91730a59" -dependencies = [ - "ahash", - "equivalent", - "hashbrown", - "parking_lot", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core", -] - -[[package]] -name = "redox_syscall" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "ryu" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scroll" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" -dependencies = [ - "scroll_derive", -] - -[[package]] -name = "scroll_derive" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "semver" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_columnar" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5910a00acc21b3f106b9e3977cabf8d4c15b62ea585664f08ec6fedb118d88e0" -dependencies = [ - "itertools 0.11.0", - "postcard", - "serde", - "serde_columnar_derive", - "thiserror", -] - -[[package]] -name = "serde_columnar_derive" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cea1995b758f1b344f484e77a02d9d85c8a62c9ce0e5f1850e27e2f7eebbc9" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "serde_derive" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "serde_json" -version = "1.0.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps", - "typenum", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -dependencies = [ - "serde", -] - -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" -dependencies = [ - "smawk", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "tracing-core" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[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.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" - -[[package]] -name = "uniffi" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cb08c58c7ed7033150132febe696bef553f891b1ede57424b40d87a89e3c170" -dependencies = [ - "anyhow", - "camino", - "cargo_metadata", - "clap", - "uniffi_bindgen", - "uniffi_build", - "uniffi_core", - "uniffi_macros", -] - -[[package]] -name = "uniffi_bindgen" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cade167af943e189a55020eda2c314681e223f1e42aca7c4e52614c2b627698f" -dependencies = [ - "anyhow", - "askama", - "camino", - "cargo_metadata", - "fs-err", - "glob", - "goblin", - "heck 0.5.0", - "once_cell", - "paste", - "serde", - "textwrap", - "toml", - "uniffi_meta", - "uniffi_udl", -] - -[[package]] -name = "uniffi_build" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7cf32576e08104b7dc2a6a5d815f37616e66c6866c2a639fe16e6d2286b75b" -dependencies = [ - "anyhow", - "camino", - "uniffi_bindgen", -] - -[[package]] -name = "uniffi_checksum_derive" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" -dependencies = [ - "quote", - "syn 2.0.98", -] - -[[package]] -name = "uniffi_core" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7687007d2546c454d8ae609b105daceb88175477dac280707ad6d95bcd6f1f" -dependencies = [ - "anyhow", - "bytes", - "log", - "once_cell", - "paste", - "static_assertions", -] - -[[package]] -name = "uniffi_macros" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12c65a5b12ec544ef136693af8759fb9d11aefce740fb76916721e876639033b" -dependencies = [ - "bincode", - "camino", - "fs-err", - "once_cell", - "proc-macro2", - "quote", - "serde", - "syn 2.0.98", - "toml", - "uniffi_meta", -] - -[[package]] -name = "uniffi_meta" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a74ed96c26882dac1ca9b93ca23c827e284bacbd7ec23c6f0b0372f747d59e4" -dependencies = [ - "anyhow", - "bytes", - "siphasher", - "uniffi_checksum_derive", -] - -[[package]] -name = "uniffi_testing" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6f984f0781f892cc864a62c3a5c60361b1ccbd68e538e6c9fbced5d82268ac" -dependencies = [ - "anyhow", - "camino", - "cargo_metadata", - "fs-err", - "once_cell", -] - -[[package]] -name = "uniffi_udl" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037820a4cfc4422db1eaa82f291a3863c92c7d1789dc513489c36223f9b4cdfc" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.98", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "weedle2" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" -dependencies = [ - "nom", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" -dependencies = [ - "windows-core", - "windows-targets", -] - -[[package]] -name = "windows-core" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-strings", - "windows-targets", -] - -[[package]] -name = "windows-implement" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result", - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "xxhash-rust" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" - -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] diff --git a/loro-rs/Cargo.toml b/loro-rs/Cargo.toml deleted file mode 100644 index 5a44e4e..0000000 --- a/loro-rs/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "loro-swift" -version = "1.5.0" -edition = "2021" - -[lib] -name = "loro" -crate-type = ["cdylib", "staticlib"] - -[[bin]] -# This can be whatever name makes sense for your project, but the rest of this tutorial assumes uniffi-bindgen. -name = "uniffi-bindgen" -path = "src/uniffi-bindgen.rs" - - -[dependencies] -loro-ffi = "1.5.8" -# loro-ffi = { path = "../../loro/crates/loro-ffi" } -uniffi = { version = "0.28.3" } - -[build-dependencies] -uniffi = { version = "0.28.3", features = ["build"] } - -[features] -cli = ["uniffi/cli"] diff --git a/loro-rs/build.rs b/loro-rs/build.rs deleted file mode 100644 index ea599d6..0000000 --- a/loro-rs/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - uniffi::generate_scaffolding("src/loro.udl").unwrap(); -} diff --git a/loro-rs/src/json_bk.udl b/loro-rs/src/json_bk.udl deleted file mode 100644 index 6d63f1f..0000000 --- a/loro-rs/src/json_bk.udl +++ /dev/null @@ -1,77 +0,0 @@ -dictionary JsonSchema{ - u8 schema_version; - Frontiers start_version; - sequence peers; - sequence changes; -}; - -dictionary JsonChange{ - ID id; - i64 timestamp; - sequence deps; - u32 Lamport; - string? msg; - sequence ops; -}; - -dictionary JsonOp{ - JsonOpContent content; - ContainerID container; - i32 counter; -}; - -[Enum] -interface JsonOpContent{ - List(JsonListOp); - MovableList(JsonMovableListOp); - Map(JsonMapOp); - Text(JsonTextOp); - Tree(JsonTreeOp); - Future(JsonFutureOpWrapper); -}; - -dictionary JsonFutureOpWrapper{ - JsonFutureOp value; - i32 prop; -}; - -[Enum] -interface JsonListOp{ - Insert(u32 pos, LoroValue value); - Delete(i32 pos, i32 len, ID start_id); -}; - -[Enum] -interface JsonMovableListOp{ - Insert(u32 pos, LoroValue value); - Delete(i32 pos, i32 len, ID start_id); - Move(u32 from, u32 to, IdLp elem_id); - Set(IdLp elem_id, LoroValue value); -}; - -[Enum] -interface JsonMapOp{ - Insert(string key, LoroValue value); - Delete(string key); -}; - -[Enum] -interface JsonTextOp{ - Insert(u32 pos, string text); - Delete(i32 pos, i32 len, ID start_id); - Mark(u32 start, u32 end, string style_key, LoroValue style_value, u8 info); - MarkEnd(); -}; - -[Enum] -interface JsonTreeOp{ - Create(TreeID target, TreeID? parent, FractionalIndex fractional_index); - Move(TreeID target, TreeID? parent, FractionalIndex fractional_index); - Delete(TreeID target); -}; - -[Enum] -interface JsonFutureOp{ - Counter(OwnedValue value); - Unknown(OwnedValue value); -}; \ No newline at end of file diff --git a/loro-rs/src/lib.rs b/loro-rs/src/lib.rs deleted file mode 100644 index 83cb291..0000000 --- a/loro-rs/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -use loro_ffi::*; -uniffi::include_scaffolding!("loro"); diff --git a/loro-rs/src/loro.udl b/loro-rs/src/loro.udl deleted file mode 100644 index a5512a4..0000000 --- a/loro-rs/src/loro.udl +++ /dev/null @@ -1,1872 +0,0 @@ -namespace loro{ - /// Decodes the metadata for an imported blob from the provided bytes. - [Throws=LoroError] - ImportBlobMetadata decode_import_blob_meta([ByRef] bytes bytes, boolean check_checksum); - string get_version(); -}; - -// ============= Traits ============= - -[Trait] -interface ValueOrContainer{ - boolean is_value(); - boolean is_container(); - ContainerType? container_type(); - LoroValue? as_value(); - ContainerID? as_container(); - LoroText? as_loro_text(); - LoroList? as_loro_list(); - LoroMap? as_loro_map(); - LoroTree? as_loro_tree(); - LoroCounter? as_loro_counter(); - LoroMovableList? as_loro_movable_list(); - LoroUnknown? as_loro_unknown(); -}; - -[Trait, WithForeign] -interface LoroValueLike{ - LoroValue as_loro_value(); -}; - -[Trait, WithForeign] -interface ContainerIdLike{ - ContainerID as_container_id(ContainerType ty); -}; - -[Trait, WithForeign] -interface Subscriber{ - void on_diff(DiffEvent diff); -}; - -[Trait, WithForeign] -interface LocalUpdateCallback{ - void on_local_update(bytes update); -}; - -[Trait, WithForeign] -interface Unsubscriber{ - void on_unsubscribe(); -}; - -[Trait, WithForeign] -interface OnPush{ - UndoItemMeta on_push(UndoOrRedo undo_or_redo, CounterSpan span, DiffEvent? diff_event); -}; - -[Trait, WithForeign] -interface OnPop{ - void on_pop(UndoOrRedo undo_or_redo, CounterSpan span, UndoItemMeta undo_meta); -}; - -// [Trait, WithForeign] -// interface JsonSchemaLike{ -// [Throws=LoroError] -// JsonSchema into_json_schema(); -// }; - -[Trait, WithForeign] -interface ChangeAncestorsTraveler{ - boolean travel(ChangeMeta change); -}; - -[Trait, WithForeign] -interface FirstCommitFromPeerCallback{ - void on_first_commit_from_peer(FirstCommitFromPeerPayload payload); -}; - -[Trait, WithForeign] -interface PreCommitCallback{ - void on_pre_commit(PreCommitCallbackPayload payload); -}; - -[Trait, WithForeign] -interface LocalEphemeralListener{ - void on_ephemeral_update(bytes update); -}; - -[Trait, WithForeign] -interface EphemeralSubscriber{ - void on_ephemeral_event(EphemeralStoreEvent event); -}; - -// ============= LORO DOC ============= -/// `LoroDoc` is the entry for the whole document. -/// When it's dropped, all the associated [`Handler`]s will be invalidated. -/// -/// **Important:** Loro is a pure library and does not handle network protocols. -/// 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. -interface LoroDoc{ - /// Create a new `LoroDoc` instance. - constructor(); - - /// Duplicate the document with a different PeerID - /// - /// The time complexity and space complexity of this operation are both O(n), - /// - /// 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())`. - LoroDoc fork(); - - /// Fork the document at the given frontiers. - /// - /// The created doc will only contain the history before the specified frontiers. - LoroDoc fork_at([ByRef] Frontiers frontiers); - - /// Get the configurations of the document. - Configure config(); - - /// Get `Change` at the given id. - /// - /// `Change` is a grouped continuous operations that share the same id, timestamp, commit message. - /// - /// - The id of the `Change` is the id of its first op. - /// - The second op's id is `{ peer: change.id.peer, counter: change.id.counter + 1 }` - /// - /// The same applies on `Lamport`: - /// - /// - The lamport of the `Change` is the lamport of its first op. - /// - The second op's lamport is `change.lamport + 1` - /// - /// The length of the `Change` is how many operations it contains - ChangeMeta? get_change(ID id); - - /// Set whether to record the timestamp of each change. Default is `false`. - /// - /// If enabled, the Unix timestamp will be recorded for each change automatically. - /// - /// You can set each timestamp manually when committing a change. - /// - /// NOTE: Timestamps are forced to be in ascending order. - /// If you commit a new change with a timestamp that is less than the existing one, - /// the largest existing timestamp will be used instead. - void set_record_timestamp(boolean record); - - /// Set the interval of mergeable changes, **in seconds**. - /// - /// If two continuous local changes are within the interval, they will be merged into one change. - /// The default value is 1000 seconds. - /// - /// 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 - void set_change_merge_interval(i64 interval); - - /// Set the rich text format configuration of the document. - /// - /// You need to config it if you use rich text `mark` method. - /// Specifically, you need to config the `expand` property of each style. - /// - /// Expand is used to specify the behavior of expanding when new text is inserted at the - /// beginning or end of the style. - void config_text_style(StyleConfigMap text_style); - - /// Configures the default text style for the document. - /// - /// This method sets the default text style configuration for the document when using LoroText. - /// If `None` is provided, the default style is reset. - /// - /// # Parameters - /// - /// - `text_style`: The style configuration to set as the default. `None` to reset. - void config_default_text_style(StyleConfig? text_style); - - /// Attach the document state to the latest known version. - /// - /// > The document becomes detached during a `checkout` operation. - /// > Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`. - /// > 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`. - void attach(); - - /// Checkout the `DocState` to a specific version. - /// - /// The document becomes detached during a `checkout` operation. - /// Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`. - /// 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`. - /// - /// You should call `attach` to attach the `DocState` to the latest version of `OpLog`. - [Throws=LoroError] - void checkout([ByRef] Frontiers frontiers); - - /// Checkout the `DocState` to the latest version. - /// - /// > The document becomes detached during a `checkout` operation. - /// > Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`. - /// > 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`. - /// - /// This has the same effect as `attach`. - void checkout_to_latest(); - - /// Compare the frontiers with the current OpLog's version. - /// - /// If `other` contains any version that's not contained in the current OpLog, return [Ordering::Less]. - Ordering cmp_with_frontiers([ByRef] Frontiers other); - - - // cmp_frontiers(); - - /// Force the document enter the detached mode. - /// - /// In this mode, when you importing new updates, the [loro_internal::DocState] will not be changed. - /// - /// Learn more at https://loro.dev/docs/advanced/doc_state_and_oplog#attacheddetached-status - void detach(); - - /// Import a batch of updates/snapshot. - /// - /// The data can be in arbitrary order. The import result will be the same. - [Throws=LoroError] - ImportStatus import_batch([ByRef] sequence bytes); - - /// 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. - LoroMovableList get_movable_list(ContainerIdLike id); - - /// Get a [LoroList] by container id. - /// - /// If the provided id is string, it will be converted into a root container id with the name of the string. - LoroList get_list(ContainerIdLike id); - - /// 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. - LoroMap get_map(ContainerIdLike id); - - /// Get a [LoroText] by container id. - /// - /// If the provided id is string, it will be converted into a root container id with the name of the string. - LoroText get_text(ContainerIdLike id); - - /// 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. - LoroTree get_tree(ContainerIdLike id); - - /// 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. - LoroCounter get_counter(ContainerIdLike id); - - /// Commit the cumulative auto commit transaction. - /// - /// There is a transaction behind every operation. - /// The events will be emitted after a transaction is committed. A transaction is committed when: - /// - /// - `doc.commit()` is called. - /// - `doc.export(mode)` is called. - /// - `doc.import(data)` is called. - /// - `doc.checkout(version)` is called. - void commit(); - - void commit_with(CommitOptions options); - - /// Set commit message for the current uncommitted changes - /// - /// It will be persisted. - void set_next_commit_message([ByRef] string msg); - - /// Set `origin` for the current uncommitted changes, it can be used to track the source of changes in an event. - /// - /// It will NOT be persisted. - void set_next_commit_origin([ByRef] string origin); - - /// Set the timestamp of the next commit. - /// - /// It will be persisted and stored in the `OpLog`. - /// You can get the timestamp from the [`Change`] type. - void set_next_commit_timestamp(i64 timestamp); - - /// Set the options of the next commit. - /// - /// It will be used when the next commit is performed. - void set_next_commit_options(CommitOptions options); - - /// Clear the options of the next commit. - void clear_next_commit_options(); - - /// Whether the document is in detached mode, where the [loro_internal::DocState] is not - /// synchronized with the latest version of the [loro_internal::OpLog]. - boolean is_detached(); - - /// Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`]. - [Throws=LoroError] - ImportStatus import([ByRef]bytes bytes); - - /// Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`]. - /// - /// It marks the import with a custom `origin` string. It can be used to track the import source - /// in the generated events. - [Throws=LoroError] - ImportStatus import_with([ByRef] bytes bytes, [ByRef] string origin); - - [Throws=LoroError] - ImportStatus import_json_updates([ByRef]string json); - - /// Export the current state with json-string format of the document. - string export_json_updates([ByRef]VersionVector start_vv, [ByRef]VersionVector end_vv); - - /// Export all the ops not included in the given `VersionVector` - [Throws=LoroEncodeError] - bytes export_updates([ByRef] VersionVector vv); - - /// Export the current state and history of the document. - [Throws=LoroEncodeError] - bytes export_snapshot(); - - /// Convert `Frontiers` into `VersionVector` - VersionVector? frontiers_to_vv([ByRef] Frontiers frontiers); - - /// Minimize the frontiers by removing the unnecessary entries. - FrontiersOrID minimize_frontiers([ByRef] Frontiers frontiers); - - /// Convert `VersionVector` into `Frontiers` - Frontiers vv_to_frontiers([ByRef] VersionVector vv); - // with_oplog - - /// Get the `VersionVector` version of `OpLog` - VersionVector oplog_vv(); - - /// Get the `VersionVector` version of `DocState` - VersionVector state_vv(); - - /// Get the `VersionVector` of trimmed history - /// - /// The ops included by the trimmed history are not in the doc. - VersionVector shallow_since_vv(); - - /// Get the total number of operations in the `OpLog` - u64 len_ops(); - - /// Get the total number of changes in the `OpLog` - u64 len_changes(); - - /// Get the shallow value of the document. - LoroValue get_value(); - - /// Get the entire state of the current DocState - LoroValue get_deep_value(); - - /// Get the entire state of the current DocState with container id - LoroValue get_deep_value_with_id(); - - /// Get the `Frontiers` version of `OpLog` - Frontiers oplog_frontiers(); - - /// Get the `Frontiers` version of `DocState` - /// - /// Learn more about [`Frontiers`](https://loro.dev/docs/advanced/version_deep_dive) - Frontiers state_frontiers(); - - /// Get the PeerID - u64 peer_id(); - - /// Change the PeerID - /// - /// NOTE: You need to make sure there is no chance two peer have the same PeerID. - /// If it happens, the document will be corrupted. - [Throws=LoroError] - void set_peer_id(u64 peer); - - /// Subscribe the events of a container. - /// - /// The callback will be invoked when the container is changed. - /// Returns a subscription that can be used to unsubscribe. - /// - /// The events will be emitted after a transaction is committed. A transaction is committed when: - /// - /// - `doc.commit()` is called. - /// - `doc.export(mode)` is called. - /// - `doc.import(data)` is called. - /// - `doc.checkout(version)` is called. - Subscription subscribe([ByRef] ContainerID container_id, Subscriber subscriber); - - /// 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. - Subscription subscribe_root(Subscriber subscriber); - - /// Subscribe the local update of the document. - Subscription subscribe_local_update(LocalUpdateCallback callback); - - /// Estimate the size of the document states in memory. - void log_estimate_size(); - - /// Check the correctness of the document state by comparing it with the state - /// calculated by applying all the history. - void check_state_correctness_slow(); - - /// Get the handler by the path. - ValueOrContainer? get_by_path([ByRef] sequence path); - - /// The path can be specified in different ways depending on the container type: - /// - /// For Tree: - /// 1. Using node IDs: `tree/{node_id}/property` - /// 2. Using indices: `tree/0/1/property` - /// - /// For List and MovableList: - /// - Using indices: `list/0` or `list/1/property` - /// - /// For Map: - /// - Using keys: `map/key` or `map/nested/property` - /// - /// For tree structures, index-based paths follow depth-first traversal order. - /// The indices start from 0 and represent the position of a node among its siblings. - /// - /// # Examples - /// ``` - /// # use loro::{LoroDoc, LoroValue}; - /// let doc = LoroDoc::new(); - /// - /// // Tree example - /// let tree = doc.get_tree("tree"); - /// let root = tree.create(None).unwrap(); - /// tree.get_meta(root).unwrap().insert("name", "root").unwrap(); - /// // Access tree by ID or index - /// let name1 = doc.get_by_str_path(&format!("tree/{}/name", root)).unwrap().into_value().unwrap(); - /// let name2 = doc.get_by_str_path("tree/0/name").unwrap().into_value().unwrap(); - /// assert_eq!(name1, name2); - /// - /// // List example - /// let list = doc.get_list("list"); - /// list.insert(0, "first").unwrap(); - /// list.insert(1, "second").unwrap(); - /// // Access list by index - /// let item = doc.get_by_str_path("list/0"); - /// assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "first".into()); - /// - /// // Map example - /// let map = doc.get_map("map"); - /// map.insert("key", "value").unwrap(); - /// // Access map by key - /// let value = doc.get_by_str_path("map/key"); - /// assert_eq!(value.unwrap().into_value().unwrap().into_string().unwrap(), "value".into()); - /// - /// // MovableList example - /// let mlist = doc.get_movable_list("mlist"); - /// mlist.insert(0, "item").unwrap(); - /// // Access movable list by index - /// let item = doc.get_by_str_path("mlist/0"); - /// assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "item".into()); - /// ``` - ValueOrContainer? get_by_str_path([ByRef] string path); - - [Throws=CannotFindRelativePosition] - PosQueryResult get_cursor_pos([ByRef]Cursor cursor); - - boolean has_history_cache(); - - /// Free the history cache that is used for making checkout faster. - /// - /// 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. - void free_history_cache(); - - /// Free the cached diff calculator that is used for checkout. - void free_diff_calculator(); - - /// Encoded all ops and history cache to bytes and store them in the kv store. - /// - /// The parsed ops will be dropped - void compact_change_store(); - - // /// Export the document in the given mode. - // bytes export(ExportMode mode); - - [Throws=LoroEncodeError] - bytes export_updates_in_range([ByRef]sequence spans); - - [Throws=LoroEncodeError] - bytes export_shallow_snapshot([ByRef]Frontiers frontiers); - - [Throws=LoroEncodeError] - bytes export_snapshot_at([ByRef]Frontiers frontiers); - - [Throws=LoroEncodeError] - bytes export_state_only(Frontiers? frontiers); - - // /// Analyze the container info of the doc - // /// - // /// This is used for development and debugging. It can be slow. - // DocAnalysis analyze(); - - /// Get the path from the root to the container - sequence? get_path_to_container([ByRef] ContainerID id); - - /// Evaluate a JSONPath expression on the document and return matching values or handlers. - /// - /// This method allows querying the document structure using JSONPath syntax. - /// It returns a vector of `ValueOrHandler` which can represent either primitive values - /// or container handlers, depending on what the JSONPath expression matches. - /// - /// # Arguments - /// - /// * `path` - A string slice containing the JSONPath expression to evaluate. - /// - /// # Returns - /// - /// A `Result` containing either: - /// - `Ok(Vec)`: A vector of matching values or handlers. - /// - `Err(String)`: An error message if the JSONPath expression is invalid or evaluation fails. - /// - /// # Example - /// - /// ``` - /// # use loro::LoroDoc; - /// let doc = LoroDoc::new(); - /// let map = doc.get_map("users"); - /// map.insert("alice", 30).unwrap(); - /// map.insert("bob", 25).unwrap(); - /// - /// let result = doc.jsonpath("$.users.alice").unwrap(); - /// assert_eq!(result.len(), 1); - /// assert_eq!(result[0].to_json_value(), serde_json::json!(30)); - /// ``` - [Throws=JsonPathError] - sequence jsonpath([ByRef] string path); - - /// 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. - [Throws=ChangeTravelError] - void travel_change_ancestors([ByRef] sequence ids, ChangeAncestorsTraveler f); - - /// Gets container IDs modified in the given ID range. - /// - /// **NOTE:** This method will implicitly commit. - /// - /// This method can be used in conjunction with `doc.travel_change_ancestors()` to traverse - /// the history and identify all changes that affected specific containers. - /// - /// # Arguments - /// - /// * `id` - The starting ID of the change range - /// * `len` - The length of the change range to check - sequence get_changed_containers_in(ID id, u32 len); - - /// Check if the doc contains the full history. - boolean is_shallow(); - - /// Get the number of operations in the pending transaction. - /// - /// 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)`. - u32 get_pending_txn_len(); - - /// Export the current state with json-string format of the document, without peer compression. - /// - /// 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. - string export_json_updates_without_peer_compression([ByRef] VersionVector start_vv, [ByRef] VersionVector end_vv); - - /// Exports changes within the specified ID span to JSON schema format. - /// - /// The JSON schema format produced by this method is identical to the one generated by `export_json_updates`. - /// It ensures deterministic output, making it ideal for hash calculations and integrity checks. - /// - /// This method can also export pending changes from the uncommitted transaction that have not yet been applied to the OpLog. - /// - /// This method will NOT trigger a new commit implicitly. - sequence export_json_in_id_span(IdSpan id_span); - - /// Find the operation id spans that between the `from` version and the `to` version. - VersionVectorDiff find_id_spans_between([ByRef] Frontiers from, [ByRef] Frontiers to); - - /// Revert the current document state back to the target version - /// - /// Internally, it will generate a series of local operations that can revert the - /// 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. - [Throws=LoroError] - void revert_to([ByRef] Frontiers version); - - /// Apply a diff to the current document state. - /// - /// Internally, it will apply the diff to the current state. - [Throws=LoroError] - void apply_diff([ByRef] DiffBatch diff); - - /// Calculate the diff between two versions - [Throws=LoroError] - DiffBatch diff([ByRef] Frontiers a, [ByRef] Frontiers b); - - /// Check if the doc contains the target container. - /// - /// A root container always exists, while a normal container exists - /// if it has ever been created on the doc. - boolean has_container([ByRef] ContainerID id); - - /// Subscribe to the first commit from a peer. Operations performed on the `LoroDoc` within this callback - /// will be merged into the current commit. - /// - /// 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. - Subscription subscribe_first_commit_from_peer(FirstCommitFromPeerCallback callback); - - /// 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`]. - Subscription subscribe_pre_commit(PreCommitCallback callback); - - // TODO: version range - // [Throws=LoroError] - // string redact_json_updates([ByRef] string json, VersionRange version_range); - - /// Set whether to hide empty root containers. - void set_hide_empty_root_containers(boolean hide); - - /// Delete all content from a root container and hide it from the document. - /// - /// When a root container is empty and hidden: - /// - It won't show up in `get_deep_value()` results - /// - It won't be included in document snapshots - /// - /// Only works on root containers (containers without parents). - void delete_root_container(ContainerID cid); -}; - -dictionary ContainerPath{ - ContainerID id; - Index path; -}; - -// ============= CONTAINERS ============= - -interface LoroText{ - /// Create a new container that is detached from the document. - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - constructor(); - - /// Whether the container is attached to a document - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - boolean is_attached(); - - /// If a detached container is attached, this method will return its corresponding attached handler. - LoroText? get_attached(); - - /// Get the [ContainerID] of the text container. - ContainerID id(); - - /// Insert a string at the given unicode position. - [Throws=LoroError] - void insert(u32 pos, [ByRef] string s); - - /// Insert a string at the given utf-8 position. - [Throws=LoroError] - void insert_utf8(u32 pos, [ByRef] string s); - - /// Delete a range of text at the given unicode position with unicode length. - [Throws=LoroError] - void delete(u32 pos, u32 len); - - /// Delete a range of text at the given utf-8 position with utf-8 length. - [Throws=LoroError] - void delete_utf8(u32 pos, u32 len); - - /// Get a string slice at the given Unicode range - [Throws=LoroError] - string slice(u32 start_index, u32 end_index); - - /// Delete specified character and insert string at the same position at given unicode position. - [Throws=LoroError] - string splice(u32 pos, u32 len, [ByRef] string s); - - /// Whether the text container is empty. - boolean is_empty(); - - /// Get the length of the text container in UTF-8. - u32 len_utf8(); - - /// Get the length of the text container in Unicode. - u32 len_unicode(); - - /// Get the length of the text container in UTF-16. - u32 len_utf16(); - - /// Update the current text based on the provided text. - /// - /// It will calculate the minimal difference and apply it to the current text. - /// It uses Myers' diff algorithm to compute the optimal difference. - /// - /// This could take a long time for large texts (e.g. > 50_000 characters). - /// In that case, you should use `updateByLine` instead. - [Throws=UpdateTimeoutError] - void update([ByRef] string s, UpdateOptions options); - - /// Apply a [delta](https://quilljs.com/docs/delta/) to the text container. - [Throws=LoroError] - void apply_delta(sequence delta); - - /// Update the current text based on the provided text. - /// - /// This update calculation is line-based, which will be more efficient but less precise. - [Throws=UpdateTimeoutError] - void update_by_line([ByRef] string s, UpdateOptions options); - - /// Mark a range of text with a key-value pair. - /// - /// You can use it to create a highlight, make a range of text bold, or add a link to a range of text. - /// - /// You can specify the `expand` option to set the behavior when inserting text at the boundary of the range. - /// - /// - `after`(default): when inserting text right after the given range, the mark will be expanded to include the inserted text - /// - `before`: when inserting text right before the given range, the mark will be expanded to include the inserted text - /// - `none`: the mark will not be expanded to include the inserted text at the boundaries - /// - `both`: when inserting text either right before or right after the given range, the mark will be expanded to include the inserted text - /// - /// *You should make sure that a key is always associated with the same expand type.* - /// - /// Note: this is not suitable for unmergeable annotations like comments. - [Throws=LoroError] - void mark(u32 from, u32 to, [ByRef] string key, LoroValueLike value); - - /// Unmark a range of text with a key and a value. - /// - /// You can use it to remove highlights, bolds or links - /// - /// You can specify the `expand` option to set the behavior when inserting text at the boundary of the range. - /// - /// **Note: You should specify the same expand type as when you mark the text.** - /// - /// - `after`(default): when inserting text right after the given range, the mark will be expanded to include the inserted text - /// - `before`: when inserting text right before the given range, the mark will be expanded to include the inserted text - /// - `none`: the mark will not be expanded to include the inserted text at the boundaries - /// - `both`: when inserting text either right before or right after the given range, the mark will be expanded to include the inserted text - /// - /// *You should make sure that a key is always associated with the same expand type.* - /// - /// Note: you cannot delete unmergeable annotations like comments by this method. - [Throws=LoroError] - void unmark(u32 from, u32 to, [ByRef] string key); - - /// Get the text in [Delta](https://quilljs.com/docs/delta/) format. - sequence to_delta(); - - /// Get the text in [Delta](https://quilljs.com/docs/delta/) format. - LoroValue get_richtext_value(); - - /// Get the text content of the text container. - string to_string(); - - /// Get the cursor at the given position in the given Unicode position.. - /// - /// Using "index" to denote cursor positions can be unstable, as positions may - /// shift with document edits. To reliably represent a position or range within - /// a document, it is more effective to leverage the unique ID of each item/character - /// in a List CRDT or Text CRDT. - /// - /// Loro optimizes State metadata by not storing the IDs of deleted elements. This - /// approach complicates tracking cursors since they rely on these IDs. The solution - /// recalculates position by replaying relevant history to update stable positions - /// accurately. To minimize the performance impact of history replay, the system - /// updates cursor info to reference only the IDs of currently present elements, - /// thereby reducing the need for replay. - Cursor? get_cursor(u32 pos, Side side); - - /// Whether the container is deleted. - boolean is_deleted(); - - /// Push a string to the end of the text container. - [Throws=LoroError] - void push_str([ByRef] string s); - - /// Get the editor of the text at the given position. - u64? get_editor_at_unicode_pos(u32 pos); - - /// Get the LoroDoc from this container - LoroDoc? doc(); -}; - -interface LoroList{ - /// Create a new container that is detached from the document. - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - constructor(); - - /// Whether the container is attached to a document - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - boolean is_attached(); - - /// If a detached container is attached, this method will return its corresponding attached handler. - LoroList? get_attached(); - - /// Insert a value at the given position. - [Throws=LoroError] - void insert(u32 pos, LoroValueLike v); - - /// Delete values at the given position. - [Throws=LoroError] - void delete(u32 pos, u32 len); - - /// Get the value at the given position. - ValueOrContainer? get(u32 index); - - /// Get the deep value of the container. - LoroValue get_deep_value(); - - /// Get the shallow value of the container. - /// - /// This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container]. - LoroValue get_value(); - - /// Get the ID of the container. - ContainerID id(); - - u32 len(); - - boolean is_empty(); - - /// Pop the last element of the list. - [Throws=LoroError] - LoroValue? pop(); - - [Throws=LoroError] - void push(LoroValueLike v); - - // TODO: for_each - [Throws=LoroError] - LoroList insert_list_container(u32 pos, LoroList child); - - [Throws=LoroError] - LoroMap insert_map_container(u32 pos, LoroMap child); - - [Throws=LoroError] - LoroTree insert_tree_container(u32 pos, LoroTree child); - - [Throws=LoroError] - LoroMovableList insert_movable_list_container(u32 pos, LoroMovableList child); - - [Throws=LoroError] - LoroText insert_text_container(u32 pos, LoroText child); - - [Throws=LoroError] - LoroCounter insert_counter_container(u32 pos, LoroCounter child); - - Cursor? get_cursor(u32 pos, Side side); - - /// Converts the LoroList to a Vec of LoroValue. - /// - /// This method unwraps the internal Arc and clones the data if necessary, - /// returning a Vec containing all the elements of the LoroList as LoroValue. - sequence to_vec(); - - /// Delete all elements in the list. - [Throws=LoroError] - void clear(); - - /// Get the ID of the list item at the given position. - ID? get_id_at(u32 pos); - - /// Whether the container is deleted. - boolean is_deleted(); - - /// Get the LoroDoc from this container - LoroDoc? doc(); -}; - -interface LoroMap{ - /// Create a new container that is detached from the document. - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - constructor(); - - /// Whether the container is attached to a document. - boolean is_attached(); - - /// If a detached container is attached, this method will return its corresponding attached handler. - LoroMap? get_attached(); - - /// Delete a key-value pair from the map. - [Throws=LoroError] - void delete([ByRef] string key); - - /// Insert a key-value pair into the map. - /// - /// > **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. - [Throws=LoroError] - void insert([ByRef] string key, LoroValueLike v); - - /// Get the length of the map. - u32 len(); - - /// Get the ID of the map. - ContainerID id(); - - /// Whether the map is empty. - boolean is_empty(); - - /// Get the value of the map with the given key. - ValueOrContainer? get([ByRef] string key); - - // TODO: uniffi v0.29 - [Throws=LoroError] - LoroList get_or_create_list_container([ByRef] string key, LoroList child); - [Throws=LoroError] - LoroMap get_or_create_map_container([ByRef] string key, LoroMap child); - [Throws=LoroError] - LoroTree get_or_create_tree_container([ByRef] string key, LoroTree child); - [Throws=LoroError] - LoroMovableList get_or_create_movable_list_container([ByRef] string key, LoroMovableList child); - [Throws=LoroError] - LoroText get_or_create_text_container([ByRef] string key, LoroText child); - [Throws=LoroError] - LoroCounter get_or_create_counter_container([ByRef] string key, LoroCounter child); - - [Throws=LoroError] - LoroList insert_list_container([ByRef] string key, LoroList child); - [Throws=LoroError] - LoroMap insert_map_container([ByRef] string key, LoroMap child); - [Throws=LoroError] - LoroTree insert_tree_container([ByRef] string key, LoroTree child); - [Throws=LoroError] - LoroMovableList insert_movable_list_container([ByRef] string key, LoroMovableList child); - [Throws=LoroError] - LoroText insert_text_container([ByRef] string key, LoroText child); - [Throws=LoroError] - LoroCounter insert_counter_container([ByRef] string key, LoroCounter child); - - /// Get the shallow value of the map. - /// - /// It will not convert the state of sub-containers, but represent them as [LoroValue::Container]. - LoroValue get_value(); - - /// Get the deep value of the map. - /// - /// It will convert the state of sub-containers into a nested JSON value. - LoroValue get_deep_value(); - - /// Whether the container is deleted. - boolean is_deleted(); - - /// Get the peer id of the last editor on the given entry - u64? get_last_editor([ByRef] string key); - - /// Delete all key-value pairs in the map. - [Throws=LoroError] - void clear(); - - // TODO: iter? - /// Get the keys of the map. - sequence keys(); - - /// Get the values of the map. - sequence values(); - - /// Get the LoroDoc from this container - LoroDoc? doc(); -}; - -interface LoroTree{ - /// Create a new container that is detached from the document. - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - constructor(); - - /// Whether the container is attached to a document - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - boolean is_attached(); - - /// If a detached container is attached, this method will return its corresponding attached handler. - LoroTree? get_attached(); - - /// Create a new tree node and return the [`TreeID`]. - /// - /// 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. - [Throws=LoroError] - TreeID create(TreeParentId parent); - - /// Create a new tree node at the given index and return the [`TreeID`]. - /// - /// 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. - [Throws=LoroError] - TreeID create_at(TreeParentId parent, u32 index); - - /// Move the `target` node to be a child of the `parent` node. - /// - /// If the `parent` is `None`, the `target` node will be a root. - [Throws=LoroError] - void mov(TreeID target, TreeParentId parent); - - /// 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. - [Throws=LoroError] - void mov_to(TreeID target, TreeParentId parent, u32 to); - - /// Move the `target` node to be a child after the `after` node with the same parent. - [Throws=LoroError] - void mov_after(TreeID target, TreeID after); - - /// Move the `target` node to be a child before the `before` node with the same parent. - [Throws=LoroError] - void mov_before(TreeID target, TreeID before); - - /// Delete a tree node. - /// - /// Note: If the deleted node has children, the children do not appear in the state - /// rather than actually being deleted. - [Throws=LoroError] - void delete(TreeID target); - - /// Get the associated metadata map handler of a tree node. - [Throws=LoroError] - LoroMap get_meta(TreeID target); - - /// Return the parent of target node. - /// - /// - If the target node does not exist, throws Error. - /// - If the target node is a root node, return nil. - [Throws=LoroError] - TreeParentId parent(TreeID target); - - /// Return whether target node exists. - boolean contains(TreeID target); - - /// Return whether target node is deleted. - /// - /// # Errors - /// - If the target node does not exist, return `LoroTreeError::TreeNodeNotExist`. - [Throws=LoroError] - boolean is_node_deleted(TreeID target); - - /// Return all nodes, including deleted nodes - sequence nodes(); - - /// Get the root nodes of the forest. - sequence roots(); - - /// Return all children of the target node. - /// - /// If the parent node does not exist, return `None`. - sequence? children(TreeParentId parent); - - /// Return the number of children of the target node. - u32? children_num(TreeParentId parent); - - /// Return container id of the tree. - ContainerID id(); - - /// Return the fractional index of the target node with hex format. - string? fractional_index(TreeID target); - - /// Return the flat array of the forest. - /// - /// 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()`. - LoroValue get_value(); - - /// Return the flat array of the forest, each node is with metadata. - LoroValue get_value_with_meta(); - - /// Whether the fractional index is enabled. - boolean is_fractional_index_enabled(); - - /// Enable fractional index for Tree Position. - /// - /// The jitter is used to avoid conflicts when multiple users are creating the node at the same position. - /// value 0 is default, which means no jitter, any value larger than 0 will enable jitter. - /// - /// 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) - void enable_fractional_index(u8 jitter); - - /// Disable the fractional index generation when you don't need the Tree's siblings to be sorted. - /// The fractional index will always be set to the same default value 0. - /// - /// After calling this, you cannot use `tree.moveTo()`, `tree.moveBefore()`, `tree.moveAfter()`, - /// and `tree.createAt()`. - void disable_fractional_index(); - - /// Get the last move id of the target node. - ID? get_last_move_id([ByRef] TreeID target); - - /// Whether the container is deleted. - boolean is_deleted(); - - /// Get the LoroDoc from this container - LoroDoc? doc(); -}; - -interface LoroMovableList{ - /// Create a new container that is detached from the document. - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - constructor(); - - /// Whether the container is attached to a document - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - boolean is_attached(); - - /// If a detached container is attached, this method will return its corresponding attached handler. - LoroMovableList? get_attached(); - - /// Get the container id. - ContainerID id(); - - /// Insert a value at the given position. - [Throws=LoroError] - void insert(u32 pos, LoroValueLike v); - - /// Delete values at the given position. - [Throws=LoroError] - void delete(u32 pos, u32 len); - - /// Get the value at the given position. - ValueOrContainer? get(u32 index); - - u32 len(); - - boolean is_empty(); - - /// Get the deep value of the container. - LoroValue get_deep_value(); - - /// Get the shallow value of the container. - /// - /// This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container]. - LoroValue get_value(); - - /// Pop the last element of the list. - [Throws=LoroError] - ValueOrContainer? pop(); - - [Throws=LoroError] - void push(LoroValueLike v); - - [Throws=LoroError] - LoroList insert_list_container(u32 pos, LoroList child); - - [Throws=LoroError] - LoroMap insert_map_container(u32 pos, LoroMap child); - - [Throws=LoroError] - LoroTree insert_tree_container(u32 pos, LoroTree child); - - [Throws=LoroError] - LoroMovableList insert_movable_list_container(u32 pos, LoroMovableList child); - - [Throws=LoroError] - LoroText insert_text_container(u32 pos, LoroText child); - - [Throws=LoroError] - LoroCounter insert_counter_container(u32 pos, LoroCounter child); - - [Throws=LoroError] - LoroList set_list_container(u32 pos, LoroList child); - - [Throws=LoroError] - LoroMap set_map_container(u32 pos, LoroMap child); - - [Throws=LoroError] - LoroTree set_tree_container(u32 pos, LoroTree child); - - [Throws=LoroError] - LoroMovableList set_movable_list_container(u32 pos, LoroMovableList child); - - [Throws=LoroError] - LoroText set_text_container(u32 pos, LoroText child); - - [Throws=LoroError] - LoroCounter set_counter_container(u32 pos, LoroCounter child); - - /// Get the cursor at the given position. - /// - /// Using "index" to denote cursor positions can be unstable, as positions may - /// shift with document edits. To reliably represent a position or range within - /// a document, it is more effective to leverage the unique ID of each item/character - /// in a List CRDT or Text CRDT. - /// - /// Loro optimizes State metadata by not storing the IDs of deleted elements. This - /// approach complicates tracking cursors since they rely on these IDs. The solution - /// recalculates position by replaying relevant history to update stable positions - /// accurately. To minimize the performance impact of history replay, the system - /// updates cursor info to reference only the IDs of currently present elements, - /// thereby reducing the need for replay. - Cursor? get_cursor(u32 pos, Side side); - - /// Set the value at the given position. - [Throws=LoroError] - void set(u32 pos, LoroValueLike value); - - /// Move the value at the given position to the given position. - [Throws=LoroError] - void mov(u32 from, u32 to); - - /// Get the elements of the list as a vector of LoroValues. - /// - /// This method returns a vector containing all the elements in the list as LoroValues. - /// It provides a convenient way to access the entire contents of the LoroMovableList - /// as a standard Rust vector. - sequence to_vec(); - - /// Delete all elements in the list. - [Throws=LoroError] - void clear(); - - - /// Whether the container is deleted. - boolean is_deleted(); - - // TODO: for each - u64? get_creator_at(u32 pos); - - /// Get the last mover of the list item at the given position. - u64? get_last_mover_at(u32 pos); - - /// Get the last editor of the list item at the given position. - u64? get_last_editor_at(u32 pos); - - /// Get the LoroDoc from this container - LoroDoc? doc(); -}; - -interface LoroCounter{ - /// Create a new Counter. - constructor(); - - /// Return container id of the Counter. - ContainerID id(); - - /// Whether the container is attached to a document - /// - /// The edits on a detached container will not be persisted. - /// To attach the container to the document, please insert it into an attached container. - boolean is_attached(); - - /// If a detached container is attached, this method will return its corresponding attached handler. - LoroCounter? get_attached(); - - /// Increment the counter by the given value. - [Throws=LoroError] - void increment(double value); - - /// Decrement the counter by the given value. - [Throws=LoroError] - void decrement(double value); - - /// Get the current value of the counter. - f64 get_value(); - - /// Whether the container is deleted. - boolean is_deleted(); - - /// Get the LoroDoc from this container - LoroDoc? doc(); -}; - -interface LoroUnknown{ - /// Get the container id. - ContainerID id(); -}; - -// ============= TYPES ============= - -// TODO: https://github.com/mozilla/uniffi-rs/issues/1372 -// [Enum] -// interface ExportMode{ -// Snapshot(); -// Updates(VersionVector from); -// UpdatesInRange(sequence spans); -// GcSnapshot(Frontiers frontiers); -// StateOnly(Frontiers? frontiers); -// }; - -dictionary ChangeMeta{ - /// Lamport timestamp of the Change - u32 lamport; - /// The first Op id of the Change - ID id; - /// [Unix time](https://en.wikipedia.org/wiki/Unix_time) - /// It is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970. - i64 timestamp; - /// The commit message of the change - string? message; - /// The dependencies of the first op of the change - Frontiers deps; - /// The total op num inside this change - u32 len; -}; - -dictionary ImportBlobMetadata{ - /// The partial start version vector. - /// - /// Import blob includes all the ops from `partial_start_vv` to `partial_end_vv`. - /// However, it does not constitute a complete version vector, as it only contains counters - /// from peers included within the import blob. - VersionVector partial_start_vv; - /// The partial end version vector. - /// - /// Import blob includes all the ops from `partial_start_vv` to `partial_end_vv`. - /// However, it does not constitute a complete version vector, as it only contains counters - /// from peers included within the import blob. - VersionVector partial_end_vv; - i64 start_timestamp; - Frontiers start_frontiers; - i64 end_timestamp; - u32 change_num; - string mode; -}; - -dictionary ImportStatus{ - record success; - record? pending; -}; - -enum Ordering{ - "Less", "Equal", "Greater" -}; - -dictionary PreCommitCallbackPayload{ - ChangeMeta change_meta; - string origin; - ChangeModifier modifier; -}; - -dictionary FirstCommitFromPeerPayload{ - u64 peer; -}; - -interface ChangeModifier{ - void set_message([ByRef] string msg); - void set_timestamp(i64 timestamp); -}; - -// ============= CONFIG ============= - -interface Configure{ - Configure fork(); - boolean record_timestamp(); - void set_record_timestamp(boolean record); - i64 merge_interval(); - void set_merge_interval(i64 interval); - StyleConfigMap text_style_config(); -}; - -interface StyleConfigMap{ - constructor(); - [Name=default_rich_text_config] - constructor(); - void insert([ByRef] string key, StyleConfig value); - StyleConfig? get([ByRef] string key); -}; - -dictionary StyleConfig{ - ExpandType expand; -}; - -enum ExpandType{ - "Before", - "After", - "Both", - "None", -}; - -dictionary CommitOptions{ - string? origin; - boolean immediate_renew; - i64? timestamp; - string? commit_msg; -}; - -// ============= CURSOR ============= - - -enum Side{ - "Left", - "Middle", - "Right", -}; - -interface Cursor{ - constructor(ID? id, ContainerID container, Side side, u32 origin_pos); -}; - -dictionary PosQueryResult{ - Cursor? update; - AbsolutePosition current; -}; - -dictionary AbsolutePosition{ - u32 pos; - Side side; -}; - -/// Deprecated, use `EphemeralStore` instead. -interface Awareness{ - constructor(u64 peer, i64 timeout); - bytes encode([ByRef]sequence peers); - bytes encode_all(); - AwarenessPeerUpdate apply([ByRef]bytes encoded_peers_info); - void set_local_state(LoroValueLike value); - LoroValue? get_local_state(); - sequence remove_outdated(); - record get_all_states(); - u64 peer(); -}; - -dictionary AwarenessPeerUpdate{ - sequence updated; - sequence added; -}; - -dictionary PeerInfo{ - LoroValue state; - i32 counter; - i64 timestamp; -}; - -interface EphemeralStore{ - constructor(i64 timeout); - bytes encode([ByRef] string key); - bytes encode_all(); - void apply([ByRef] bytes data); - void set([ByRef] string key, LoroValueLike value); - void delete([ByRef] string key); - LoroValue? get([ByRef] string key); - void remove_outdated(); - sequence keys(); - record get_all_states(); - Subscription subscribe_local_update(LocalEphemeralListener listener); - Subscription subscribe(EphemeralSubscriber listener); -}; - -dictionary EphemeralStoreEvent{ - EphemeralEventTrigger by; - sequence added; - sequence removed; - sequence updated; -}; - -enum EphemeralEventTrigger{ - "Local", - "Import", - "Timeout", -}; - -// ============= VERSIONS ============= -interface VersionVector{ - constructor(); - void set_last(ID id); - i32? get_last(u64 peer); - void set_end(ID id); - // boolean try_update_last(ID id); - sequence get_missing_span([ByRef] VersionVector target); - void merge([ByRef] VersionVector other); - boolean includes_vv([ByRef] VersionVector other); - boolean includes_id(ID id); - CounterSpan? intersect_span(IdSpan target); - void extend_to_include_vv([ByRef]VersionVector other); - VersionVectorDiff diff([ByRef]VersionVector rhs); - bytes encode(); - [Name=decode, Throws=LoroError] - constructor([ByRef]bytes bytes); - Ordering? partial_cmp([ByRef]VersionVector other); - boolean eq([ByRef]VersionVector other); -}; - -interface Frontiers{ - constructor(); - [Name=from_id] - constructor(ID id); - [Name=from_ids] - constructor(sequence ids); - bytes encode(); - [Name=decode, Throws=LoroError] - constructor([ByRef]bytes bytes); - boolean eq([ByRef]Frontiers other); -}; - -dictionary VersionVectorDiff{ - /// need to add these spans to move from right to left - record retreat; - /// need to add these spans to move from left to right - record forward; -}; - -// ============= UNDO MANAGER ============= - -interface UndoManager{ - /// Create a new UndoManager. - constructor([ByRef] LoroDoc doc); - - /// Undo the last change made by the peer. - [Throws=LoroError] - boolean undo(); - - /// Redo the last change made by the peer. - [Throws=LoroError] - boolean redo(); - - /// Record a new checkpoint. - [Throws=LoroError] - void record_new_checkpoint(); - - /// Whether the undo manager can undo. - boolean can_undo(); - - /// Whether the undo manager can redo. - boolean can_redo(); - - // TODO: undo count - // TODO: redo count - - /// If a local event's origin matches the given prefix, it will not be recorded in the - /// undo stack. - void add_exclude_origin_prefix([ByRef] string prefix); - - /// Set the maximum number of undo steps. The default value is 100. - void set_max_undo_steps(u32 size); - - /// Set the merge interval in ms. The default value is 0, which means no merge. - void set_merge_interval(i64 interval); - - /// Set the listener for push events. - /// The listener will be called when a new undo/redo item is pushed into the stack. - void set_on_push(OnPush? on_push); - - /// Set the listener for pop events. - /// The listener will be called when an undo/redo item is popped from the stack. - void set_on_pop(OnPop? on_pop); -}; - -enum UndoOrRedo{ - "Undo", "Redo", -}; - -dictionary CounterSpan{ - i32 start; - i32 end; -}; - -dictionary UndoItemMeta{ - LoroValue value; - sequence cursors; -}; - -dictionary CursorWithPos{ - Cursor cursor; - AbsolutePosition pos; -}; - -dictionary AbsolutePosition{ - u32 pos; - Side side; -}; - -// ============= EVENTS ============= - -dictionary DiffEvent{ - /// How the event is triggered. - EventTriggerKind triggered_by; - /// The origin of the event. - string origin; - /// The current receiver of the event. - ContainerID? current_target; - /// The diffs of the event. - sequence events; -}; - -/// A diff of a container. -dictionary ContainerDiff{ - /// The target container id of the diff. - ContainerID target; - /// The path of the diff. - sequence path; - /// Whether the diff is from unknown container. - boolean is_unknown; - /// The diff - Diff diff; -}; - -[Enum] -interface Diff{ - List(sequence diff); - Text(sequence diff); - Map(MapDelta diff); - Tree(TreeDiff diff); - Counter(double diff); - Unknown(); -}; - -[Enum] -interface TextDelta{ - Retain(u32 retain, record? attributes); - Insert(string insert, record? attributes); - Delete(u32 delete); -}; - -[Enum] -interface ListDiffItem{ - /// Insert a new element into the list. - Insert(sequence insert, boolean is_move); - /// Delete n elements from the list at the current index. - Delete(u32 delete); - /// Retain n elements in the list. - /// - /// This is used to keep the current index unchanged. - Retain(u32 retain); -}; - -dictionary MapDelta{ - record updated; -}; - -dictionary TreeDiff{ - sequence diff; -}; - - -dictionary TreeDiffItem{ - TreeID target; - TreeExternalDiff action; -}; - -[Enum] -interface TreeExternalDiff{ - Create(TreeParentId parent, u32 index, string fractional_index); - Move(TreeParentId parent, u32 index, string fractional_index, TreeParentId old_parent, u32 old_index); - Delete(TreeParentId old_parent, u32 old_index); -}; - -dictionary PathItem{ - ContainerID container; - Index index; -}; - -/// The kind of the event trigger. -enum EventTriggerKind{ - /// The event is triggered by a local transaction. - "Local", - /// The event is triggered by importing - "Import", - /// The event is triggered by checkout - "Checkout", -}; - -[Enum] -interface Index{ - Key(string key); - Seq(u32 index); - Node(TreeID target); -}; - -/// A handle to a subscription created by GPUI. When dropped, the subscription -/// is cancelled and the callback will no longer be invoked. -interface Subscription{ - /// Detaches the subscription from this handle. The callback will - /// continue to be invoked until the views or models it has been - /// subscribed to are dropped - [Self=ByArc] - void detach(); - - /// Unsubscribes the subscription. - [Self=ByArc] - void unsubscribe(); -}; - -interface DiffBatch{ - constructor(); - - /// Push a new event to the batch. - /// - /// If the cid already exists in the batch, return Err - Diff? push(ContainerID cid, Diff diff); - - /// Returns an iterator over the diffs in this batch, in the order they were added. - /// - /// The iterator yields tuples of `(&ContainerID, &Diff)` where: - /// - `ContainerID` is the ID of the container that was modified - /// - `Diff` contains the actual changes made to that container - /// - /// The order of the diffs is preserved from when they were originally added to the batch. - sequence get_diff(); -}; - -dictionary ContainerIDAndDiff{ - ContainerID cid; - Diff diff; -}; - -// ============= TYPES ============= -dictionary TreeID{ - u64 peer; - i32 counter; -}; - -[Enum] -interface TreeParentId{ - Node(TreeID id); - Root(); - Deleted(); - Unexist(); -}; - -dictionary UpdateOptions{ - f64? timeout_ms; - boolean use_refined_diff; -}; - -interface FractionalIndex{ - [Name=from_bytes] - constructor(bytes bytes); - [Name=from_hex_string] - constructor([ByRef] string str); - string to_string(); -}; - - -dictionary ID{ - u64 peer; - i32 counter; -}; - -dictionary IdLp{ - u32 lamport; - u64 peer; -}; - -dictionary IdSpan{ - u64 peer; - CounterSpan counter; -}; - -dictionary CounterSpan{ - i32 start; - i32 end; -}; - - -[Enum] -interface ContainerType{ - Text(); - Map(); - List(); - MovableList(); - Tree(); - Counter(); - Unknown(u8 kind); -}; - -[Enum] -interface ContainerID{ - Root(string name, ContainerType container_type); - Normal(u64 peer,i32 counter, ContainerType container_type); -}; - -dictionary FrontiersOrID{ - Frontiers? frontiers; - ID? id; -}; - -[Enum] -interface LoroValue{ - Null(); - Bool(boolean value); - Double(f64 value); - I64(i64 value); - Binary(bytes value); - String(string value); - List(sequence value); - Map(record value); - Container(ContainerID value); -}; - -[Error] -enum LoroError { - "UnmatchedContext", - "DecodeVersionVectorError", - "DecodeError", - "DecodeDataCorruptionError", - "DecodeChecksumMismatchError", - "IncompatibleFutureEncodingError", - "JsError", - "LockError", - "DuplicatedTransactionError", - "NotFoundError", - "TransactionError", - "OutOfBound", - "UsedOpID", - "TreeError", - "ArgErr", - "AutoCommitNotStarted", - "StyleConfigMissing", - "Unknown", - "FrontiersNotFound", - "ImportWhenInTxn", - "MisuseDetachedContainer" , - "NotImplemented", - "ReattachAttachedContainer", - "EditWhenDetached", - "UndoInvalidIdSpan", - "UndoWithDifferentPeerId", - "InvalidJsonSchema", - "UTF8InUnicodeCodePoint", - "UTF16InUnicodeCodePoint", - "EndIndexLessThanStartIndex", - "InvalidRootContainerName", - "ImportUpdatesThatDependsOnOutdatedVersion", - "SwitchToVersionBeforeShallowRoot", - "ContainerDeleted", - "ConcurrentOpsWithSamePeerID", - "InvalidPeerID", - "ContainersNotFound", - "UndoGroupAlreadyStarted", -}; - -[Error] -enum CannotFindRelativePosition{ - "ContainerDeleted", - "HistoryCleared", - "IdNotFound" -}; - -[Error] -enum JsonPathError{ - "InvalidJsonPath", - "EvaluationError" -}; - -[Error, NonExhaustive] -enum LoroEncodeError{ - "FrontiersNotFound", - "ShallowSnapshotIncompatibleWithOldFormat", - "UnknownContainer", -}; - -[Error] -enum ChangeTravelError{ - "TargetIdNotFound", - "TargetVersionNotIncluded" -}; - -[Error] -enum UpdateTimeoutError{ - "Timeout" -}; \ No newline at end of file diff --git a/loro-rs/src/uniffi-bindgen.rs b/loro-rs/src/uniffi-bindgen.rs deleted file mode 100644 index dbb99cc..0000000 --- a/loro-rs/src/uniffi-bindgen.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - #[cfg(feature = "cli")] - uniffi::uniffi_bindgen_main() -} diff --git a/loro-rs/uniffi.toml b/loro-rs/uniffi.toml deleted file mode 100644 index 3bdcd24..0000000 --- a/loro-rs/uniffi.toml +++ /dev/null @@ -1,3 +0,0 @@ -[bindings.swift] -module_name = "loro" -experimental_sendable_value_types = true diff --git a/scripts/build_macos.sh b/scripts/build_macos.sh index 8fe5920..9593894 100755 --- a/scripts/build_macos.sh +++ b/scripts/build_macos.sh @@ -7,7 +7,7 @@ set -euxo pipefail THIS_SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" LIB_NAME="libloro.a" -RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-rs" +RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-ffi" FRAMEWORK_NAME="loroFFI" SWIFT_FOLDER="$THIS_SCRIPT_DIR/../gen-swift" diff --git a/scripts/build_swift_ffi.sh b/scripts/build_swift_ffi.sh index be7906c..a30717f 100755 --- a/scripts/build_swift_ffi.sh +++ b/scripts/build_swift_ffi.sh @@ -7,7 +7,7 @@ set -euxo pipefail THIS_SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" LIB_NAME="libloro.a" -RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-rs" +RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-ffi" FRAMEWORK_NAME="loroFFI" SWIFT_FOLDER="$THIS_SCRIPT_DIR/../gen-swift" diff --git a/scripts/update_version.sh b/scripts/update_version.sh deleted file mode 100644 index e69de29..0000000