docs: baked a lot of API docs
This commit is contained in:
+44
-1
@@ -8,4 +8,47 @@ references:
|
||||
|
||||
The Sync API provides functions for interacting with the sync engine when the client runs in Sync mode.
|
||||
|
||||
${spacelua.renderApiDocumentation("sync")}
|
||||
<!--#lua spacelua.renderApiDocumentation("sync") -->
|
||||
## sync.hasInitialSyncCompleted
|
||||
|
||||
`sync.hasInitialSyncCompleted()`
|
||||
|
||||
Checks whether the initial client synchronization has completed.
|
||||
|
||||
**Returns:**
|
||||
|
||||
- `boolean` — Whether initial sync is complete.
|
||||
|
||||
## sync.performFileSync
|
||||
|
||||
`sync.performFileSync(path)`
|
||||
|
||||
Prioritizes a file for immediate synchronization and waits for completion.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
- `path` (`string`) — Space-relative file path.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
sync.performFileSync("notes/important.md")
|
||||
```
|
||||
|
||||
## sync.performSpaceSync
|
||||
|
||||
`sync.performSpaceSync()`
|
||||
|
||||
Starts an immediate full-space synchronization and waits for completion.
|
||||
|
||||
**Returns:**
|
||||
|
||||
- `number` — Number of sync operations, or zero without an active worker.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
local changes = sync.performSpaceSync()
|
||||
```
|
||||
<!--/lua-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user