Skip to content

Commit 83f17c3

Browse files
dahliaclaude
andcommitted
Fix Twoslash type errors for KvStore.list() in docs
Add required list() method stubs to MyCustomKvStore examples in the KvStore documentation to satisfy the KvStore interface requirements. Also increase Node.js memory limit for docs build to prevent OOM errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent aeaa13f commit 83f17c3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

docs/manual/kv.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ class MyCustomKvStore implements KvStore {
506506
options?: KvStoreSetOptions
507507
): Promise<void> { }
508508
async delete(key: KvKey): Promise<void> { }
509+
async *list(): AsyncIterable<{ key: KvKey; value: unknown }> { }
509510
// ---cut-before---
510511
async get<T = unknown>(key: KvKey): Promise<T | undefined> {
511512
const serializedKey = this.serializeKey(key);
@@ -555,6 +556,7 @@ class MyCustomKvStore implements KvStore {
555556
return undefined;
556557
}
557558
async delete(key: KvKey): Promise<void> { }
559+
async *list(): AsyncIterable<{ key: KvKey; value: unknown }> { }
558560
// ---cut-before---
559561
async set(
560562
key: KvKey,
@@ -611,6 +613,7 @@ class MyCustomKvStore implements KvStore {
611613
value: unknown,
612614
options?: KvStoreSetOptions
613615
): Promise<void> { }
616+
async *list(): AsyncIterable<{ key: KvKey; value: unknown }> { }
614617
// ---cut-before---
615618
async delete(key: KvKey): Promise<void> {
616619
const serializedKey = this.serializeKey(key);
@@ -667,6 +670,7 @@ class MyCustomKvStore implements KvStore {
667670
options?: KvStoreSetOptions
668671
): Promise<void> { }
669672
async delete(key: KvKey): Promise<void> { }
673+
async *list(): AsyncIterable<{ key: KvKey; value: unknown }> { }
670674
// ---cut-before---
671675
async cas(
672676
key: KvKey,
@@ -780,6 +784,8 @@ class MyCustomKvStore implements KvStore {
780784
}
781785
async delete(key: KvKey): Promise<void> {
782786
}
787+
async *list(): AsyncIterable<{ key: KvKey; value: unknown }> {
788+
}
783789
}
784790
// ---cut-before---
785791
import { createFederation } from "@fedify/fedify";

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"scripts": {
6464
"dev": "cd ../ && pnpm run --filter '!{docs}' --filter='!./examples/**' -r build && cd docs/ && vitepress dev --host",
65-
"build": "cd ../ && pnpm run --filter '!{docs}' --filter '!./examples/**' -r build && cd docs/ && vitepress build",
65+
"build": "cd ../ && pnpm run --filter '!{docs}' --filter '!./examples/**' -r build && cd docs/ && NODE_OPTIONS='--max-old-space-size=8192' vitepress build",
6666
"preview": "cd ../ && pnpm run --filter '!{docs}' --filter '!./examples/**' -r build && cd docs/ && vitepress preview"
6767
}
6868
}

0 commit comments

Comments
 (0)