Skip to content

Commit 58c7c73

Browse files
kriskclaude
andcommitted
fix(types): correct keys type in parseIndex parameter
The keys parameter in parseIndex was typed as ReadonlyArray<string> but the serialized index from toJSON() contains full key objects with path, id, weight, src, and getFn properties. Closes #794 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a1451be commit 58c7c73

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

dist/fuse.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ declare class Fuse<T> {
9292

9393
public static parseIndex<U>(
9494
index: {
95-
keys: ReadonlyArray<string>
95+
keys: ReadonlyArray<{
96+
path: string[]
97+
id: string
98+
weight: number
99+
src: string | string[]
100+
getFn?: (...args: any[]) => any
101+
}>
96102
records: FuseIndexRecords
97103
},
98104
options?: FuseIndexOptions<U>

src/index.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ declare class Fuse<T> {
9292

9393
public static parseIndex<U>(
9494
index: {
95-
keys: ReadonlyArray<string>
95+
keys: ReadonlyArray<{
96+
path: string[]
97+
id: string
98+
weight: number
99+
src: string | string[]
100+
getFn?: (...args: any[]) => any
101+
}>
96102
records: FuseIndexRecords
97103
},
98104
options?: FuseIndexOptions<U>

0 commit comments

Comments
 (0)