Skip to content

Commit 60eebc5

Browse files
committed
fix(typescript): clarify input to parseIndex
Narrowing the type of the parameter from `any` makes it obvious that the input is an `Object`, rather than a `String`. With the `any` type as input, it was not obvious how to use this function. See krisk#524 and krisk#624 for people bitten by this.
1 parent 43eebfa commit 60eebc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.d.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ declare class Fuse<T> {
9191
): FuseIndex<U>
9292

9393
public static parseIndex<U>(
94-
index: any,
94+
index: {
95+
keys: ReadonlyArray<string>
96+
records: FuseIndexRecords
97+
},
9598
options?: FuseIndexOptions<U>
9699
): FuseIndex<U>
97100

0 commit comments

Comments
 (0)