leaf

Welcome to the Leaf SDK! Leaf is an opinionated wrapper around CRDT tools for building local-first apps!

Leaf is built around an Entity-Component data model designed to help you build inter-operable apps.

If you are new to Leaf, first check out defComponent and then look at Entity to get an idea of how things are put together.

Leaf is currently built on Loro as it's underlying CRDT, and Entity.doc is in fact a LoroDoc, so reading the Loro documentation will be necessary to understand how to fully interact with the Leaf entity data.

Namespaces

storage
sync1

Classes

Awareness
AwarenessWasm
Cursor
Entity
EntityId
Loro
LoroCounter
LoroDoc
LoroList
LoroMap
LoroMovableList
LoroText
LoroTree
LoroTreeNode
UndoManager
VersionVector

Interfaces

Change
ImportBlobMetadata
Listener
LoroEvent
LoroEventBatch
TextUpdateOptions

Type Aliases

AwarenessListener
ComponentConstructor
ComponentDef
ComponentId
ComponentType
Container
ContainerID
ContainerType
CounterDiff
CounterSpan
Delta
Diff
EntityDoc
EntityIdStr
ExportMode
Frontiers
IdSpan
ImportStatus
JsonChange
JsonContainerID
JsonDiff
JsonOp
JsonOpID
JsonSchema
JsonValue
ListDiff
ListJsonDiff
ListOp
MapDiff
MapJsonDiff
MapOp
MovableListOp
NonNullableType
OpId
Path
PeerID
Side
Subscription
TextDiff
TextOp
TreeDiff
TreeDiffItem
TreeID
TreeNodeJSON
TreeNodeShallowValue
TreeNodeValue
TreeOp
UndoConfig
UnknownOp
Value
VersionVectorDiff

Variables

entityComponentsKey
entityIdPrefix

Functions

decodeFrontiers
decodeImportBlobMeta
defComponent
encodeFrontiers
getType
isContainer
isContainerId
LORO_VERSION
newContainerID
newRootContainerID
run
setDebug