Skip to content

Commit 72b6e25

Browse files
dbaynardkrisk
authored andcommitted
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 #524 and #624 for people bitten by this.
1 parent 4e30d3e commit 72b6e25

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/index.d.ts

Lines changed: 4 additions & 1 deletion
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)