Skip to content

Instantly share code, notes, and snippets.

@zicklag
Created March 12, 2025 19:48
Show Gist options
  • Save zicklag/5422510b01ac00506fe0a417a9952f73 to your computer and use it in GitHub Desktop.
Save zicklag/5422510b01ac00506fe0a417a9952f73 to your computer and use it in GitHub Desktop.
{
"version": 1,
"nodes": [
{
"name": "storage",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 22,
"col": 7,
"byteIndex": 872
},
"declarationKind": "export",
"jsDoc": {
"doc": "Storage related implementations and interfaces.\n",
"tags": [
{
"kind": "module"
}
]
},
"kind": "namespace",
"namespaceDef": {
"elements": [
{
"name": "StorageKey",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 12,
"col": 0,
"byteIndex": 284
},
"declarationKind": "export",
"jsDoc": {
"doc": "The key to a record in the {@linkcode StorageInterface}."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "array",
"array": {
"repr": "string",
"kind": "keyword",
"keyword": "string"
}
},
"typeParams": []
}
},
{
"name": "StorageInterface",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 15,
"col": 0,
"byteIndex": 394
},
"declarationKind": "export",
"jsDoc": {
"doc": "The backend storage interfaced used by {@linkcode StorageManager}."
},
"kind": "interface",
"interfaceDef": {
"extends": [],
"constructors": [],
"methods": [
{
"name": "load",
"jsDoc": {
"doc": "Load the bytes at a given key."
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 17,
"col": 2,
"byteIndex": 472
},
"params": [
{
"kind": "identifier",
"name": "key",
"optional": false,
"tsType": {
"repr": "StorageKey",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageKey"
}
}
}
],
"optional": false,
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "",
"kind": "union",
"union": [
{
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
},
{
"repr": "undefined",
"kind": "keyword",
"keyword": "undefined"
}
]
}
],
"typeName": "Promise"
}
},
"typeParams": []
},
{
"name": "save",
"jsDoc": {
"doc": "Save the given data to the provided key."
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 19,
"col": 2,
"byteIndex": 580
},
"params": [
{
"kind": "identifier",
"name": "key",
"optional": false,
"tsType": {
"repr": "StorageKey",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageKey"
}
}
},
{
"kind": "identifier",
"name": "data",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"optional": false,
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "void",
"kind": "keyword",
"keyword": "void"
}
],
"typeName": "Promise"
}
},
"typeParams": []
},
{
"name": "remove",
"jsDoc": {
"doc": "Remove the data at a given key."
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 21,
"col": 2,
"byteIndex": 679
},
"params": [
{
"kind": "identifier",
"name": "key",
"optional": false,
"tsType": {
"repr": "StorageKey",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageKey"
}
}
}
],
"optional": false,
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "void",
"kind": "keyword",
"keyword": "void"
}
],
"typeName": "Promise"
}
},
"typeParams": []
},
{
"name": "loadRange",
"jsDoc": {
"doc": "Load all values and keys that are prefixed by the given key."
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 23,
"col": 2,
"byteIndex": 791
},
"params": [
{
"kind": "identifier",
"name": "key",
"optional": false,
"tsType": {
"repr": "StorageKey",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageKey"
}
}
}
],
"optional": false,
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "",
"kind": "array",
"array": {
"repr": "",
"kind": "typeLiteral",
"typeLiteral": {
"constructors": [],
"methods": [],
"properties": [
{
"name": "key",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 25,
"col": 15,
"byteIndex": 837
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "StorageKey",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageKey"
}
},
"typeParams": []
},
{
"name": "data",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 25,
"col": 32,
"byteIndex": 854
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "",
"kind": "union",
"union": [
{
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
},
{
"repr": "undefined",
"kind": "keyword",
"keyword": "undefined"
}
]
},
"typeParams": []
}
],
"callSignatures": [],
"indexSignatures": []
}
}
}
],
"typeName": "Promise"
}
},
"typeParams": []
},
{
"name": "removeRange",
"jsDoc": {
"doc": "Remove all values that are prefixed by the given key."
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 27,
"col": 2,
"byteIndex": 954
},
"params": [
{
"kind": "identifier",
"name": "key",
"optional": false,
"tsType": {
"repr": "StorageKey",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageKey"
}
}
}
],
"optional": false,
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "void",
"kind": "keyword",
"keyword": "void"
}
],
"typeName": "Promise"
}
},
"typeParams": []
}
],
"properties": [],
"callSignatures": [],
"indexSignatures": [],
"typeParams": []
}
},
{
"name": "StorageManager",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 46,
"col": 0,
"byteIndex": 1521
},
"declarationKind": "export",
"jsDoc": {
"doc": "Storage interface for saving and loading {@linkcode Entity}s from a {@linkcode StorageInterface}.\n\nThe storage manager keeps track of the latest snapshots that have been loaded from storage so\nthat it can delete old snapshots and update storage even in the presence of multiple concurrent\nreaders / writers to the same data store."
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [
{
"jsDoc": {
"doc": "Construct a new {@linkcode StorageManager} for the given {@linkcode StorageInterface}."
},
"accessibility": null,
"hasBody": true,
"name": "constructor",
"params": [
{
"kind": "identifier",
"name": "storage",
"optional": false,
"tsType": {
"repr": "StorageInterface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageInterface"
}
}
}
],
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 51,
"col": 2,
"byteIndex": 1744
}
}
],
"properties": [
{
"jsDoc": {
"doc": "The backing storage interface for this storage manager."
},
"tsType": {
"repr": "StorageInterface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageInterface"
}
},
"readonly": false,
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "storage",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 48,
"col": 2,
"byteIndex": 1618
}
},
{
"jsDoc": {
"doc": "The chunks that we most-recently loaded from storage."
},
"tsType": {
"repr": "Map",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
},
{
"repr": "",
"kind": "array",
"array": {
"repr": "ChunkInfo",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ChunkInfo"
}
}
}
],
"typeName": "Map"
}
},
"readonly": false,
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "loadedChunks",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 56,
"col": 2,
"byteIndex": 1883
}
},
{
"jsDoc": {
"doc": "The heads that we most-recently loaded from storage."
},
"tsType": {
"repr": "Map",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
},
{
"repr": "Frontiers",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Frontiers"
}
}
],
"typeName": "Map"
}
},
"readonly": false,
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "loadedFrontiers",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 58,
"col": 2,
"byteIndex": 2004
}
}
],
"indexSignatures": [],
"methods": [
{
"jsDoc": {
"doc": "Load an entity from storage.\n\nIf there is no data for the entity in storage this will leave the entity un-modified.\n\nIf there is data in storage, it will be loaded and merged into this entity.\n",
"tags": [
{
"kind": "param",
"name": "entity",
"doc": "The entity to load data into."
},
{
"kind": "return",
"doc": "Returns `true` if the entity was found in storage and `false` if it was not."
}
]
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "load",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "entity",
"optional": false,
"tsType": {
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
}
}
],
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "boolean",
"kind": "keyword",
"keyword": "boolean"
}
],
"typeName": "Promise"
}
},
"hasBody": true,
"isAsync": true,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 70,
"col": 2,
"byteIndex": 2438
}
},
{
"jsDoc": {
"doc": "Persist an entity to storage.\n",
"tags": [
{
"kind": "param",
"name": "entity",
"doc": "The entity to save."
}
]
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "save",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "entity",
"optional": false,
"tsType": {
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
}
}
],
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "void",
"kind": "keyword",
"keyword": "void"
}
],
"typeName": "Promise"
}
},
"hasBody": true,
"isAsync": true,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 107,
"col": 2,
"byteIndex": 3422
}
}
],
"extends": null,
"implements": [],
"typeParams": [],
"superTypeParams": []
}
},
{
"name": "namespacedSubstorage",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"line": 160,
"col": 0,
"byteIndex": 5366
},
"declarationKind": "export",
"jsDoc": {
"doc": "Takes another {@linkcode StorageInterface} and creates a sub-interface with the given key namespace."
},
"kind": "function",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "storage",
"optional": false,
"tsType": {
"repr": "StorageInterface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageInterface"
}
}
},
{
"kind": "rest",
"arg": {
"kind": "identifier",
"name": "namespace",
"optional": false,
"tsType": null
},
"tsType": {
"repr": "",
"kind": "array",
"array": {
"repr": "string",
"kind": "keyword",
"keyword": "string"
}
}
}
],
"returnType": {
"repr": "StorageInterface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageInterface"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
}
}
]
}
},
{
"name": "sync1",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 23,
"col": 7,
"byteIndex": 913
},
"declarationKind": "export",
"jsDoc": {
"doc": "Synchronization tools that can be used to sync documents over the network with other peers.\n\n**Note:** This module is called `sync1` because it is a temporary placeholder for the more\npermanent sync implementation that will come later and be built, most-likely on\n[Keyhive](https://www.inkandswitch.com/beehive/notebook/).\n\nThe name is annoying, but is intentionally temporary.\n",
"tags": [
{
"kind": "module"
}
]
},
"kind": "namespace",
"namespaceDef": {
"elements": [
{
"name": "Sync1Interface",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 22,
"col": 0,
"byteIndex": 767
},
"declarationKind": "export",
"jsDoc": {
"doc": "An implementation of an entity synchronizer. A synchronizer allows you to sync entities with other\npeers, possibly over the network, etc.\n\nDifferent syncers can be used to sync an entity across different protocols or connection types."
},
"kind": "interface",
"interfaceDef": {
"extends": [],
"constructors": [],
"methods": [
{
"name": "syncSnapshots",
"jsDoc": {
"doc": "Get the latest snapshots of the given entity and provide our latest snapshot as well.\n\nThis will be called once when an entity is first starting to sync to get the latest known\nstate, and to update the remote with our latest state.\n\n**TODO:** This needs to be made more sophisticated so that the entire snapshot doesn't need to\nbe shared over the network when partial updates can be synced. At the same time, we may just\nwant to wait for Sedimentree.\n",
"tags": [
{
"kind": "param",
"name": "entityId",
"doc": "The entity ID to fetch snapshots for."
}
]
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 35,
"col": 2,
"byteIndex": 1368
},
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "snapshot",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"optional": false,
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "",
"kind": "array",
"array": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"typeName": "Promise"
}
},
"typeParams": []
},
{
"name": "subscribe",
"jsDoc": {
"doc": "Subscribe to updates for a given entity.\n\nEvery time the sync interface has an update for the entity it will call `handleUpdate`, passing\nit the entity ID and the update.\n",
"tags": [
{
"kind": "param",
"name": "entityId",
"doc": "The entity ID to subscribe to."
},
{
"kind": "param",
"name": "handleUpdate",
"doc": "The handler function to be invoked when the sync interface has a new\nupdate."
},
{
"kind": "return",
"doc": "Returns a function that may be called to unsubscribe."
}
]
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 51,
"col": 2,
"byteIndex": 1902
},
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "handleUpdate",
"optional": false,
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "update",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"typeParams": []
}
}
}
],
"optional": false,
"returnType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [],
"typeParams": []
}
},
"typeParams": []
},
{
"name": "sendUpdate",
"jsDoc": {
"doc": "Send an update for a given entity. This must be called to send local changes to remote peers."
},
"kind": "method",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 59,
"col": 2,
"byteIndex": 2143
},
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "update",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"optional": false,
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"typeParams": []
}
],
"properties": [],
"callSignatures": [],
"indexSignatures": [],
"typeParams": []
}
},
{
"name": "Syncer1",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 66,
"col": 0,
"byteIndex": 2328
},
"declarationKind": "export",
"jsDoc": {
"doc": "A syncer that can be used to keep {@linkcode Entity}s up-to-date with other peers across a sync\ninterface."
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [
{
"jsDoc": {
"doc": "Create a new syncer using the provided {@linkcode Sync1Interface}."
},
"accessibility": null,
"hasBody": true,
"name": "constructor",
"params": [
{
"kind": "identifier",
"name": "sync",
"optional": false,
"tsType": {
"repr": "Sync1Interface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Sync1Interface"
}
}
}
],
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 78,
"col": 2,
"byteIndex": 2559
}
}
],
"properties": [
{
"tsType": {
"repr": "Sync1Interface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Sync1Interface"
}
},
"readonly": false,
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "inter",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 67,
"col": 2,
"byteIndex": 2353
}
},
{
"tsType": {
"repr": "Map",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
},
{
"repr": "",
"kind": "typeLiteral",
"typeLiteral": {
"constructors": [],
"methods": [],
"properties": [
{
"name": "entity",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 72,
"col": 6,
"byteIndex": 2422
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
},
"typeParams": []
},
{
"name": "unsubscribe",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 73,
"col": 6,
"byteIndex": 2444
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [],
"typeParams": []
}
},
"typeParams": []
}
],
"callSignatures": [],
"indexSignatures": []
}
}
],
"typeName": "Map"
}
},
"readonly": false,
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "syncing",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 69,
"col": 2,
"byteIndex": 2379
}
}
],
"indexSignatures": [],
"methods": [
{
"jsDoc": {
"doc": "Start syncing an entity. All local updates will be pushed to peers, and incoming changes will\nbe automatically merged into the entity."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "sync",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "entity",
"optional": false,
"tsType": {
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
}
}
],
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 87,
"col": 2,
"byteIndex": 2814
}
},
{
"jsDoc": {
"doc": "Stop syncing an entity."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "unsync",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "id",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
}
],
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 146,
"col": 2,
"byteIndex": 5052
}
}
],
"extends": null,
"implements": [],
"typeParams": [],
"superTypeParams": []
}
},
{
"name": "memorySync1Adapters",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"line": 163,
"col": 13,
"byteIndex": 5405
},
"declarationKind": "export",
"kind": "variable",
"variableDef": {
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "",
"kind": "array",
"array": {
"repr": "MemorySync1Adaptr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "MemorySync1Adaptr"
}
}
},
"params": [
{
"kind": "assign",
"left": {
"kind": "identifier",
"name": "count",
"optional": false,
"tsType": {
"repr": "number",
"kind": "keyword",
"keyword": "number"
}
},
"right": "2",
"tsType": null
}
],
"typeParams": []
}
},
"kind": "const"
}
}
]
}
},
{
"name": "",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 1,
"col": 0,
"byteIndex": 0
},
"declarationKind": "export",
"jsDoc": {
"doc": "Welcome to the Leaf SDK! Leaf is an opinionated wrapper around CRDT tools for building\nlocal-first apps!\n\nLeaf is built around an Entity-Component data model designed to help you build inter-operable\napps.\n\nIf you are new to Leaf, first check out {@linkcode defComponent} and then look at\n{@linkcode Entity} to get an idea of how things are put together. Finally you'll want to use a\n{@linkcode Peer} in most cases to sync your entities with storage and sync interfaces.\n\nLeaf is currently built on [Loro](https://loro.dev) as it's underlying CRDT, and\n{@link Entity.doc} is in fact a {@linkcode LoroDoc}, so reading the Loro documentation will be\nnecessary to understand how to fully interact with the Leaf entity data.\n",
"tags": [
{
"kind": "module"
}
]
},
"kind": "moduleDoc"
},
{
"name": "entityIdPrefix",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 41,
"col": 13,
"byteIndex": 1337
},
"declarationKind": "export",
"jsDoc": {
"doc": "The prefix for the string representation of {@linkcode EntityId}s."
},
"kind": "variable",
"variableDef": {
"tsType": {
"repr": "leaf:",
"kind": "literal",
"literal": {
"kind": "template",
"tsTypes": [
{
"repr": "leaf:",
"kind": "literal",
"literal": {
"kind": "string",
"string": "leaf:"
}
}
]
}
},
"kind": "const"
}
},
{
"name": "EntityIdStr",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 44,
"col": 0,
"byteIndex": 1421
},
"declarationKind": "export",
"jsDoc": {
"doc": "String representation of an {@linkcode EntityId}."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "${typeof entityIdPrefix}${\u001b[0m\u001b[36mstring\u001b[0m}",
"kind": "literal",
"literal": {
"kind": "template",
"tsTypes": [
{
"repr": "",
"kind": "literal",
"literal": {
"kind": "string",
"string": ""
}
},
{
"repr": "entityIdPrefix",
"kind": "typeQuery",
"typeQuery": "entityIdPrefix"
},
{
"repr": "",
"kind": "literal",
"literal": {
"kind": "string",
"string": ""
}
},
{
"repr": "string",
"kind": "keyword",
"keyword": "string"
},
{
"repr": "",
"kind": "literal",
"literal": {
"kind": "string",
"string": ""
}
}
]
}
},
"typeParams": []
}
},
{
"name": "ComponentType",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 47,
"col": 0,
"byteIndex": 1575
},
"declarationKind": "export",
"jsDoc": {
"doc": "A Loro CRDT type that may be used as the type of a {@link defComponent|component}."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "union",
"union": [
{
"repr": "LoroCounter",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "LoroCounter"
}
},
{
"repr": "LoroList",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "LoroList"
}
},
{
"repr": "LoroMap",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "LoroMap"
}
},
{
"repr": "LoroMovableList",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "LoroMovableList"
}
},
{
"repr": "LoroText",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "LoroText"
}
},
{
"repr": "LoroTree",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "LoroTree"
}
}
]
},
"typeParams": []
}
},
{
"name": "ComponentConstructor",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 55,
"col": 0,
"byteIndex": 1745
},
"declarationKind": "export",
"jsDoc": {
"doc": "A constructor for a {@linkcode ComponentType}."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": true,
"tsType": {
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
},
"params": [],
"typeParams": []
}
},
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
}
},
{
"name": "ComponentId",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 58,
"col": 0,
"byteIndex": 1850
},
"declarationKind": "export",
"jsDoc": {
"doc": "The ID for a component."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "string",
"kind": "keyword",
"keyword": "string"
},
"typeParams": []
}
},
{
"name": "ComponentDef",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 67,
"col": 0,
"byteIndex": 2103
},
"declarationKind": "export",
"jsDoc": {
"doc": "A component definition.\n\nComponent definitions have the information needed to get and initialize the component on an Entity.\n\nUse {@linkcode defComponent} to create a new {@linkcode ComponentDef}."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "typeLiteral",
"typeLiteral": {
"constructors": [],
"methods": [],
"properties": [
{
"name": "id",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 68,
"col": 2,
"byteIndex": 2159
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "ComponentId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentId"
}
},
"typeParams": []
},
{
"name": "constructor",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 69,
"col": 2,
"byteIndex": 2178
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "ComponentConstructor",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentConstructor"
}
},
"typeParams": []
},
{
"name": "init",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 70,
"col": 2,
"byteIndex": 2218
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [
{
"kind": "identifier",
"name": "container",
"optional": false,
"tsType": {
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
}
],
"typeParams": []
}
},
"typeParams": []
}
],
"callSignatures": [],
"indexSignatures": []
}
},
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
}
},
{
"name": "defComponent",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 149,
"col": 0,
"byteIndex": 5890
},
"declarationKind": "export",
"jsDoc": {
"doc": "Define a new component type.\n\nAll data in Leaf is made up of components. These components are meant to be small, re-usable, and\nsemantically meaningful pieces of data, such as a `Name`, `Image`, or `Description`.\n\nBefore you can use a component you must define it, which sets its unique ID, it's type, and it's\ninitialization function.\n\n## Example\n\nHere's an example of a `Name` component that requires a first name and optionally has a last\nname.\n\n```ts\nexport const Name = defComponent(\n \"name:01JNVY76XPH6Q5AVA385HP04G7\",\n LoroMap<{ first: string; last?: string }>,\n (map) => map.set(\"first\", \"\")\n);\n```\n\nAfter defining a component you may use it with an {@linkcode Entity}.\n\nLet's break it down piece-by-piece.\n\n#### Exported Variable\nNotice that we store the definition in a variable and we export it from the module. This allows\n us to use the same component definition throughout the codebase, and even in other projects\n that might depend on this module, if we are writing a library.\n\nThis is not required, of course, but will often be useful in real projects.\n\n#### Unique ID\nThe unique ID makes sure that this component is distinguished from any other component that might\n exist. By using exported variables and unique IDs, we don't have to worry about conflicting\n names for different components.\n\n#### Component Type\nThe next argument is the type we want to use for the component. This must be one of the\n {@linkcode ComponentType}s and should usually include extra type annotations describing the\n data that will go inside.\n\nIn this example we say that `Name` is a {@linkcode LoroMap} and we annotate the inner data as\nrequiring a `string` `first` name and optionally having a `string` `last` name.\n\nNote that components must be a so called \"container type\", such as a map, array, rich text, etc.\nIf you wish to store only one primitive value such as a `string` or `number` in a component, you\ncan always store it in a map with one field.\n\n#### Initialization Function\n\nFinally, the last argument is an initialization function. When the component gets created it will\nbe the empty, default value of whatever {@linkcode ComponentType} that you specified.\n\nIn this case, that means `Name` will start off as an empty map which, notably, does not match our\ntype annotation of requiring a first name.\n\nTherefore it is important, when annotating your component type, that you also supply an\ninitialization function to set any required fields so that your returned component will match\nyour annotated type.\n\nIn this case, we just initialize the first name to an empty string.\n",
"tags": [
{
"kind": "param",
"name": "id",
"doc": "The globally unique ID of the component type. Often this will include a\n[ULID](https://ulidgenerator.com/) or [UUID](https://www.uuidgenerator.net/) prefixed by a short\nhuman-readable name to assist in debugging."
},
{
"kind": "param",
"name": "constructor",
"doc": "One of the {@linkcode ComponentType}s. This will be used to construct the\ncomponent initially, in addition to the `init` function if provided."
},
{
"kind": "param",
"name": "init",
"doc": "An optional function that will be called to initialize the component when it is first\nadded to an Entity. Since the constructor will initialize an empty version of whatever type you\nselect, you must use this init function if you want to make sure that it has any of the initial\ndata necessary to match your annotated type."
},
{
"kind": "return",
"doc": "A component definition that can be used to add, edit, and delete components on an\n{@linkcode Entity}."
}
]
},
"kind": "function",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "id",
"optional": false,
"tsType": {
"repr": "string",
"kind": "keyword",
"keyword": "string"
}
},
{
"kind": "identifier",
"name": "constructor",
"optional": false,
"tsType": {
"repr": "ComponentConstructor",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentConstructor"
}
}
},
{
"kind": "assign",
"left": {
"kind": "identifier",
"name": "init",
"optional": false,
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [
{
"kind": "identifier",
"name": "container",
"optional": false,
"tsType": {
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
}
],
"typeParams": []
}
}
},
"right": "[UNSUPPORTED]",
"tsType": null
}
],
"returnType": {
"repr": "ComponentDef",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentDef"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
}
},
{
"name": "IntoEntityId",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 162,
"col": 0,
"byteIndex": 6179
},
"declarationKind": "export",
"jsDoc": {
"doc": "A type that can be converted to an {@linkcode EntityId}"
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "union",
"union": [
{
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
},
{
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
},
{
"repr": "EntityId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityId"
}
}
]
},
"typeParams": []
}
},
{
"name": "intoEntityId",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 164,
"col": 0,
"byteIndex": 6312
},
"declarationKind": "export",
"jsDoc": {
"doc": "A helper to convert a compatible type to an {@linkcode EntityId}."
},
"kind": "function",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "id",
"optional": false,
"tsType": {
"repr": "IntoEntityId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "IntoEntityId"
}
}
}
],
"returnType": {
"repr": "EntityId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityId"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
}
},
{
"name": "EntityId",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 184,
"col": 0,
"byteIndex": 6836
},
"declarationKind": "export",
"jsDoc": {
"doc": "The ID of an {@linkcode Entity}.\n\nIn string from an Entity ID looks like this:\n\n leaf:ey02v80j9x376qgcczy8sq0pwvdbx01kbx0n7nbj90f87fnj5c50\n\nLeaf entity IDs always start with `leaf:` and end with a Crockford base32 encoded sequence of 32\nbytes.\n\nCurrently these are random bytes, in the future they will be public keys."
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [
{
"jsDoc": {
"doc": "Create a new Entity ID.\n\nIf `id` is not specified a random ID will be generated.\n",
"tags": [
{
"kind": "param",
"name": "id",
"doc": "a string starting with `leaf:` and ending with 32 bytes encoded as a Crockford\nbase32 string."
}
]
},
"accessibility": null,
"hasBody": true,
"name": "constructor",
"params": [
{
"kind": "identifier",
"name": "id",
"optional": true,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
}
],
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 195,
"col": 2,
"byteIndex": 7146
}
}
],
"properties": [
{
"jsDoc": {
"doc": "The raw bytes of the Entity ID."
},
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
},
"readonly": false,
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "bytes",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 186,
"col": 2,
"byteIndex": 6903
}
}
],
"indexSignatures": [],
"methods": [
{
"jsDoc": {
"doc": "Get the string formatted Entity ID"
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "toString",
"kind": "method",
"functionDef": {
"params": [],
"returnType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 218,
"col": 2,
"byteIndex": 7911
}
}
],
"extends": null,
"implements": [],
"typeParams": [],
"superTypeParams": []
}
},
{
"name": "entityComponentsKey",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 228,
"col": 13,
"byteIndex": 8177
},
"declarationKind": "export",
"jsDoc": {
"doc": "The key under which the list of components in an {@linkcode Entity} are stored in it's internal\n{@linkcode LoroDoc}.\n",
"tags": [
{
"kind": "internal"
}
]
},
"kind": "variable",
"variableDef": {
"tsType": {
"repr": "___leaf_components___",
"kind": "literal",
"literal": {
"kind": "string",
"string": "___leaf_components___"
}
},
"kind": "const"
}
},
{
"name": "EntityDoc",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 231,
"col": 0,
"byteIndex": 8282
},
"declarationKind": "export",
"jsDoc": {
"doc": "The type of the Loro doc for {@linkcode Entity}s."
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "LoroDoc",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "",
"kind": "intersection",
"intersection": [
{
"repr": "Record",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "string",
"kind": "keyword",
"keyword": "string"
},
{
"repr": "Container",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Container"
}
}
],
"typeName": "Record"
}
},
{
"repr": "",
"kind": "typeLiteral",
"typeLiteral": {
"constructors": [],
"methods": [],
"properties": [
{
"name": "entityComponentsKey",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 233,
"col": 4,
"byteIndex": 8351
},
"params": [],
"computed": true,
"optional": false,
"tsType": {
"repr": "LoroMap",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "Record",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "string",
"kind": "keyword",
"keyword": "string"
},
{
"repr": "",
"kind": "union",
"union": [
{
"repr": "true",
"kind": "literal",
"literal": {
"kind": "boolean",
"boolean": true
}
},
{
"repr": "undefined",
"kind": "keyword",
"keyword": "undefined"
}
]
}
],
"typeName": "Record"
}
}
],
"typeName": "LoroMap"
}
},
"typeParams": []
}
],
"callSignatures": [],
"indexSignatures": []
}
}
]
}
],
"typeName": "LoroDoc"
}
},
"typeParams": []
}
},
{
"name": "Entity",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 256,
"col": 0,
"byteIndex": 8951
},
"declarationKind": "export",
"jsDoc": {
"doc": "An entity.\n\nEntities are containers for collections of {@link defComponent|Components}. All data in Leaf is\nstored in components that have been attached to {@linkcode Entity}s.\n\n## Example\n\n For example, assuming you have defined a `Name` component as demonstrated in the\n {@linkcode defComponent} example, you could add it to a new entity like so:\n\n```ts\nconst ent = new Entity();\n\nconst name = ent.getOrInit(Name)\nname.set(\"first\", \"John\")\nname.set(\"last\", \"Smith\")\n```"
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [
{
"jsDoc": {
"doc": "Create a new {@linkcode Entity}.\n\nBy default the entity will have a new random ID and be initialize with no components.\n",
"tags": [
{
"kind": "param",
"name": "id",
"doc": "Specifying the ID will create an entity with a specific ID instead of a random ID.\nThe document will sill be empty, by default, so if you are loading a specific entity you may\nneed to load the entity with a {@linkcode StorageManager}, for instance."
}
]
},
"accessibility": null,
"hasBody": true,
"name": "constructor",
"params": [
{
"kind": "identifier",
"name": "id",
"optional": true,
"tsType": {
"repr": "IntoEntityId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "IntoEntityId"
}
}
}
],
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 301,
"col": 2,
"byteIndex": 10614
}
}
],
"properties": [],
"indexSignatures": [],
"methods": [
{
"jsDoc": {
"doc": "Get the internal {@linkcode LoroDoc}.\n\nThis can be used to do anything that Loro allows, such as exporting snapshots, doing time\ntravel, etc.\n\n### Entity Storage Format\n**Note:** The {@linkcode Entity}'s components are stored in this doc. If you modify the\ncomponents directly through the {@linkcode LoroDoc} you may confuse the normal entity API when\nit tries to read or write components.\n\nIn the Loro doc the `Entity` stores one special container using the value in\n{@linkcode entityComponentsKey} as it's ID. It is important that no component use this key as\nit's ID.\n\nThis container will be a map that contains an entry for each component ID on the entity. The\nvalue will always be `true`. For every key in that map, the component is considered to be on\nthe entity.\n\nEvery other root container in the Loro document will be a component, and it's ID will be the\ncomponent ID."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "doc",
"kind": "getter",
"functionDef": {
"params": [],
"returnType": {
"repr": "EntityDoc",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityDoc"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 283,
"col": 2,
"byteIndex": 10055
}
},
{
"jsDoc": {
"doc": "The Entity's unique ID."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "id",
"kind": "getter",
"functionDef": {
"params": [],
"returnType": {
"repr": "EntityId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityId"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 288,
"col": 2,
"byteIndex": 10140
}
},
{
"jsDoc": {
"doc": "Check whether the entity has a given component on it.\n\n```ts\nif (!entity.has(Name)) throw \"Person must have name!\";\n```"
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "has",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "def",
"optional": false,
"tsType": {
"repr": "ComponentDef",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentDef"
}
}
}
],
"returnType": {
"repr": "boolean",
"kind": "keyword",
"keyword": "boolean"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 313,
"col": 2,
"byteIndex": 10898
}
},
{
"jsDoc": {
"doc": "Delete a component from the entity."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "delete",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "def",
"optional": false,
"tsType": {
"repr": "ComponentDef",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentDef"
}
}
}
],
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 318,
"col": 2,
"byteIndex": 11083
}
},
{
"jsDoc": {
"doc": "Initialize a component with it's default value and add it to the entity, if the entity does not\nalready have a component of that type."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "init",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "def",
"optional": false,
"tsType": {
"repr": "ComponentDef",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentDef"
}
}
}
],
"returnType": {
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 348,
"col": 2,
"byteIndex": 12143
}
},
{
"jsDoc": {
"doc": "Get the component of the given type on the entity, initializing it with it's default value if\nit does not already exist on the entity."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "getOrInit",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "def",
"optional": false,
"tsType": {
"repr": "ComponentDef",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentDef"
}
}
}
],
"returnType": {
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 360,
"col": 2,
"byteIndex": 12583
}
},
{
"jsDoc": {
"doc": "Get the component of the given type from the entity, or `undefined` if the component is not on\nthe entity."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "get",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "def",
"optional": false,
"tsType": {
"repr": "ComponentDef",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
}
],
"typeName": "ComponentDef"
}
}
}
],
"returnType": {
"repr": "",
"kind": "union",
"union": [
{
"repr": "T",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "T"
}
},
{
"repr": "undefined",
"kind": "keyword",
"keyword": "undefined"
}
]
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": [
{
"name": "T",
"constraint": {
"repr": "ComponentType",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "ComponentType"
}
}
}
]
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 372,
"col": 2,
"byteIndex": 12992
}
},
{
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "commit",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "options",
"optional": true,
"tsType": {
"repr": "",
"kind": "indexedAccess",
"indexedAccess": {
"readonly": false,
"objType": {
"repr": "Parameters",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "this.doc.commit",
"kind": "typeQuery",
"typeQuery": "this.doc.commit"
}
],
"typeName": "Parameters"
}
},
"indexType": {
"repr": "0",
"kind": "literal",
"literal": {
"kind": "number",
"number": 0.0
}
}
}
}
}
],
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 377,
"col": 2,
"byteIndex": 13139
}
}
],
"extends": null,
"implements": [],
"typeParams": [],
"superTypeParams": []
}
},
{
"name": "StorageConfig",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 401,
"col": 0,
"byteIndex": 13960
},
"declarationKind": "export",
"jsDoc": {
"doc": "A policy describing how to"
},
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "typeLiteral",
"typeLiteral": {
"constructors": [],
"methods": [],
"properties": [
{
"name": "read",
"jsDoc": {
"doc": "Whether this storage should be read from when loading documents. Defaults to `true`."
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 403,
"col": 2,
"byteIndex": 14086
},
"params": [],
"computed": false,
"optional": true,
"tsType": {
"repr": "boolean",
"kind": "keyword",
"keyword": "boolean"
},
"typeParams": []
},
{
"name": "write",
"jsDoc": {
"doc": "Whether this storage should be written to when documents change. Defaults to `true`."
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 405,
"col": 2,
"byteIndex": 14198
},
"params": [],
"computed": false,
"optional": true,
"tsType": {
"repr": "boolean",
"kind": "keyword",
"keyword": "boolean"
},
"typeParams": []
},
{
"name": "writeThrottle",
"jsDoc": {
"doc": "Custom throttle function that can be used to debounce or throttle writes to this storage. The\nfunction should call `write()` when it wants to actually trigger the pending write to storage."
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 410,
"col": 2,
"byteIndex": 14428
},
"params": [],
"computed": false,
"optional": true,
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [
{
"kind": "identifier",
"name": "write",
"optional": false,
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [],
"typeParams": []
}
}
}
],
"typeParams": []
}
},
"typeParams": []
},
{
"name": "manager",
"jsDoc": {
"doc": "The storage manager to use."
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 412,
"col": 2,
"byteIndex": 14512
},
"params": [],
"computed": false,
"optional": false,
"tsType": {
"repr": "StorageManager",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageManager"
}
},
"typeParams": []
}
],
"callSignatures": [],
"indexSignatures": []
}
},
"typeParams": []
}
},
{
"name": "PeerOption",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 415,
"col": 0,
"byteIndex": 14541
},
"declarationKind": "export",
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "union",
"union": [
{
"repr": "StorageManager",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageManager"
}
},
{
"repr": "Syncer1",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Syncer1"
}
},
{
"repr": "StorageConfig",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageConfig"
}
}
]
},
"typeParams": []
}
},
{
"name": "Peer",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 421,
"col": 0,
"byteIndex": 14787
},
"declarationKind": "export",
"jsDoc": {
"doc": "The entrypoint for opening {@linkcode Entity}s, loading and saving them automatically from\n{@linkcode StorageManager}s, and syncing them with {@linkcode Syncer1}s."
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [
{
"accessibility": null,
"hasBody": true,
"name": "constructor",
"params": [
{
"kind": "rest",
"arg": {
"kind": "identifier",
"name": "options",
"optional": false,
"tsType": null
},
"tsType": {
"repr": "",
"kind": "array",
"array": {
"repr": "PeerOption",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "PeerOption"
}
}
}
}
],
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 427,
"col": 2,
"byteIndex": 14991
}
}
],
"properties": [],
"indexSignatures": [],
"methods": [
{
"jsDoc": {
"doc": "Open the entity with the given ID.\n\nThis will try to load the entity from all read storages and await on that before returning.\n\nIt will also start syncing the entity with all of the peer's syncers."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "open",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "id",
"optional": true,
"tsType": {
"repr": "IntoEntityId",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "IntoEntityId"
}
}
}
],
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
}
],
"typeName": "Promise"
}
},
"hasBody": true,
"isAsync": true,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 448,
"col": 2,
"byteIndex": 15598
}
},
{
"jsDoc": {
"doc": "Commit the entity, stop syncing it, and flush it to storage."
},
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "close",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "id",
"optional": false,
"tsType": {
"repr": "Entity",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Entity"
}
}
}
],
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 491,
"col": 2,
"byteIndex": 16856
}
}
],
"extends": null,
"implements": [],
"typeParams": [],
"superTypeParams": []
}
},
{
"name": "SuperPeerOption",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 511,
"col": 0,
"byteIndex": 17368
},
"declarationKind": "export",
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "union",
"union": [
{
"repr": "StorageConfig",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageConfig"
}
},
{
"repr": "StorageManager",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "StorageManager"
}
}
]
},
"typeParams": []
}
},
{
"name": "SuperPeer",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 522,
"col": 0,
"byteIndex": 17870
},
"declarationKind": "export",
"jsDoc": {
"doc": "A {@linkcode SuperPeer} is a peer that accepts connections from any peer, syncs every\n{@linkcode Entity} that it becomes aware of, and persists the entities to storage.\n\nIt is meant to be run as a part of a sync server that can be used to persist and synchronize\n{@linkcode Entity}s between multiple client peers, or possibly other super peers."
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [
{
"accessibility": null,
"hasBody": true,
"name": "constructor",
"params": [
{
"kind": "rest",
"arg": {
"kind": "identifier",
"name": "options",
"optional": false,
"tsType": null
},
"tsType": {
"repr": "",
"kind": "array",
"array": {
"repr": "SuperPeerOption",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "SuperPeerOption"
}
}
}
}
],
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 526,
"col": 2,
"byteIndex": 18019
}
}
],
"properties": [],
"indexSignatures": [],
"methods": [
{
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "syncSnapshots",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "snapshot",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"returnType": {
"repr": "Promise",
"kind": "typeRef",
"typeRef": {
"typeParams": [
{
"repr": "",
"kind": "array",
"array": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"typeName": "Promise"
}
},
"hasBody": true,
"isAsync": true,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 538,
"col": 2,
"byteIndex": 18313
}
},
{
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "subscribe",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "handleUpdate",
"optional": false,
"tsType": {
"repr": "Subscriber",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Subscriber"
}
}
}
],
"returnType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [],
"typeParams": []
}
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 587,
"col": 2,
"byteIndex": 19772
}
},
{
"accessibility": null,
"optional": false,
"isAbstract": false,
"isStatic": false,
"name": "sendUpdate",
"kind": "method",
"functionDef": {
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "update",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"returnType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"hasBody": true,
"isAsync": false,
"isGenerator": false,
"typeParams": []
},
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 599,
"col": 2,
"byteIndex": 20140
}
}
],
"extends": null,
"implements": [
{
"repr": "Sync1Interface",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Sync1Interface"
}
}
],
"typeParams": [],
"superTypeParams": []
}
},
{
"name": "Subscriber",
"isDefault": false,
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 513,
"col": 0,
"byteIndex": 17431
},
"declarationKind": "private",
"kind": "typeAlias",
"typeAliasDef": {
"tsType": {
"repr": "",
"kind": "fnOrConstructor",
"fnOrConstructor": {
"constructor": false,
"tsType": {
"repr": "void",
"kind": "keyword",
"keyword": "void"
},
"params": [
{
"kind": "identifier",
"name": "entityId",
"optional": false,
"tsType": {
"repr": "EntityIdStr",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "EntityIdStr"
}
}
},
{
"kind": "identifier",
"name": "update",
"optional": false,
"tsType": {
"repr": "Uint8Array",
"kind": "typeRef",
"typeRef": {
"typeParams": null,
"typeName": "Uint8Array"
}
}
}
],
"typeParams": []
}
},
"typeParams": []
}
},
{
"name": "decodeBase32",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 19,
"col": 0,
"byteIndex": 780
},
"declarationKind": "private",
"jsDoc": {
"doc": "Welcome to the Leaf SDK! Leaf is an opinionated wrapper around CRDT tools for building\nlocal-first apps!\n\nLeaf is built around an Entity-Component data model designed to help you build inter-operable\napps.\n\nIf you are new to Leaf, first check out {@linkcode defComponent} and then look at\n{@linkcode Entity} to get an idea of how things are put together. Finally you'll want to use a\n{@linkcode Peer} in most cases to sync your entities with storage and sync interfaces.\n\nLeaf is currently built on [Loro](https://loro.dev) as it's underlying CRDT, and\n{@link Entity.doc} is in fact a {@linkcode LoroDoc}, so reading the Loro documentation will be\nnecessary to understand how to fully interact with the Leaf entity data.\n",
"tags": [
{
"kind": "module"
}
]
},
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/base32-decode/index.d.ts",
"imported": "default"
}
},
{
"name": "encodeBase32",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 20,
"col": 0,
"byteIndex": 822
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/base32-encode/index.d.ts",
"imported": "default"
}
},
{
"name": "Container",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "Container"
}
},
{
"name": "LoroCounter",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroCounter"
}
},
{
"name": "LoroDoc",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroDoc"
}
},
{
"name": "LoroList",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroList"
}
},
{
"name": "LoroMap",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroMap"
}
},
{
"name": "LoroMovableList",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroMovableList"
}
},
{
"name": "LoroText",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroText"
}
},
{
"name": "LoroTree",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 26,
"col": 0,
"byteIndex": 971
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/node_modules/.deno/[email protected]/node_modules/loro-crdt/bundler/index.d.ts",
"imported": "LoroTree"
}
},
{
"name": "Sync1Interface",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 36,
"col": 0,
"byteIndex": 1105
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"imported": "Sync1Interface"
}
},
{
"name": "Syncer1",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 36,
"col": 0,
"byteIndex": 1105
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/src/sync1.ts",
"imported": "Syncer1"
}
},
{
"name": "StorageManager",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 37,
"col": 0,
"byteIndex": 1159
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/src/storage.ts",
"imported": "StorageManager"
}
},
{
"name": "getOrDefault",
"location": {
"filename": "file:///home/zicklag/git/muni-town/leaf/src/leaf.ts",
"line": 38,
"col": 0,
"byteIndex": 1206
},
"declarationKind": "private",
"kind": "import",
"importDef": {
"src": "file:///home/zicklag/git/muni-town/leaf/src/utils.ts",
"imported": "getOrDefault"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment