Giant pass: storage API docs, trust/consensus/routing code, category guides
Complete manual documentation cleanup for the storage stack and expand category-level guides across the library. Documentation (23 storage modules): - Rewrite Methods sections in all storage-hypercore, storage-hyperbee, storage-autobase, and storage-hyperdrive api.md files from index.js - Remove every "module-specific (see implementation)" placeholder in storage - Fix bitfield-scheduler, bee-batch-write, bee-range-watch, drive-gc-sweep APIs Category READMEs (modules/): - trust-security, consensus-coordination, routing-advanced — tables + hub links - MODULE_CATEGORIES.md typo fix (scaffold tier description) Code: - hyper-p2p-trust-graph: hasEdge(), nodeCount(), getStats with protocol - hyper-p2p-circuit-breaker: listCircuitIds(), reset() - hyper-p2p-distributed-lock: getStats merges metrics + active lock counts Parent workspace (not in this repo) also received doc hubs for all 29 categories in docs/README.md and MODULE_DOC_PASS.md giant-pass tracker. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -20,63 +20,63 @@ const mod = new HyperP2PBeeDiffFollow(opts)
|
||||
|
||||
## Methods
|
||||
|
||||
### `attach(…)`
|
||||
### `attach(bee) → this`
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
Validates bee via `assertBee`.
|
||||
|
||||
- **Throws:** — (none in method body)
|
||||
### `followSince(version = 0) → number`
|
||||
|
||||
### `followSince(…)`
|
||||
Resets `_cursor` and emits `follow`.
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
- **Returns:** new cursor version
|
||||
- **Throws:** `version must be non-negative`
|
||||
|
||||
- **Throws:**
|
||||
- `Error: version must be non-negative`
|
||||
### `recordDiff(entry) → boolean`
|
||||
|
||||
### `recordDiff(…)`
|
||||
Buffers entries with `version > _cursor`, sorted ascending.
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
- **Returns:** `true` when buffered, `false` when version is stale
|
||||
- **Throws:** `entry with version required`
|
||||
|
||||
- **Throws:**
|
||||
- `Error: entry with version required`
|
||||
### `pullDiff(max = 100) → entry[]`
|
||||
|
||||
### `pullDiff(…)`
|
||||
Drains buffered entries ahead of the cursor up to `max`.
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
- **Throws:** `max must be non-negative`
|
||||
|
||||
- **Throws:**
|
||||
- `Error: max must be non-negative`
|
||||
### `applyDiff(entry) → boolean`
|
||||
|
||||
### `applyDiff(…)`
|
||||
Advances cursor when `entry.version >= _cursor`; emits `applied`.
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
- **Returns:** `false` when entry is older than cursor
|
||||
- **Throws:** `entry with version required`
|
||||
|
||||
- **Throws:**
|
||||
- `Error: entry with version required`
|
||||
### `diffCursor() → number`
|
||||
|
||||
### `diffCursor(…)`
|
||||
- **Returns:** current version cursor
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
### `applyBatch(entries) → number`
|
||||
|
||||
- **Throws:** — (none in method body)
|
||||
Calls `applyDiff` for each array element.
|
||||
|
||||
### `getStats(…)`
|
||||
- **Returns:** count of entries applied
|
||||
- **Throws:** `entries must be an array`
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
### `clearBuffer() → number`
|
||||
|
||||
- **Throws:** — (none in method body)
|
||||
- **Returns:** number of buffered entries discarded
|
||||
|
||||
### `ready(…)`
|
||||
### `getStats() → object`
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
`{ follows, pulled, applied, cursor, buffered, protocol }`.
|
||||
|
||||
- **Throws:** — (none in method body)
|
||||
### `async ready() → this`
|
||||
|
||||
### `close(…)`
|
||||
No-op resolve (library-only).
|
||||
|
||||
- **Returns:** module-specific (see implementation)
|
||||
### `async close() → void`
|
||||
|
||||
- **Throws:** — (none in method body)
|
||||
Clears buffer; emits `closed`.
|
||||
|
||||
## Events
|
||||
|
||||
|
||||
Reference in New Issue
Block a user