Editor for papermario-dx mods
README.md

Loroscope#

Typed structs for Loro CRDTs.

Loro is a CRDT library — it gives you conflict-free replicated containers (lists, maps, trees, rich text, etc.) with undo/redo, sync, and time travel. But working with it directly means string-keyed container lookups and manual LoroValue matching.

#[loroscope] generates typed accessors from a struct definition, so field access is checked at compile time.

Example#

use loroscope::loroscope;

#[loroscope]
struct TodoItem {
    title: Text,
    done: bool,
}

#[loroscope]
struct App {
    todos: List<TodoItem>,
}

let app = App::new();

let item = app.todos().push_new();
item.title().insert(0, "Buy milk").unwrap();
item.set_done(false);

assert_eq!(app.todos().len(), 1);
assert!(!app.todos().get(0).unwrap().done());

// The underlying LoroDoc is always available for export, import,
// undo, subscriptions, etc.
let _doc = app.doc();