Skip to content

Commit 30f1026

Browse files
nikeeekrisk
authored andcommitted
Add some docs to options
1 parent 545eafe commit 30f1026

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/index.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,37 @@ declare namespace Fuse {
239239
export type FuseOptionKey = FuseOptionKeyObject | string | string[]
240240

241241
export interface IFuseOptions<T> {
242+
/** Indicates whether comparisons should be case sensitive. */
242243
isCaseSensitive?: boolean
244+
/** Determines how close the match must be to the fuzzy location (specified by `location`). An exact letter match which is `distance` characters away from the fuzzy location would score as a complete mismatch. A `distance` of `0` requires the match be at the exact `location` specified. A distance of `1000` would require a perfect match to be within `800` characters of the `location` to be found using a `threshold` of `0.8`. */
243245
distance?: number
246+
/** When true, the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string. */
244247
findAllMatches?: boolean
248+
/** The function to use to retrieve an object's value at the provided path. The default will also search nested paths. */
245249
getFn?: FuseGetFunction<T>
250+
/** When `true`, search will ignore `location` and `distance`, so it won't matter where in the string the pattern appears. */
246251
ignoreLocation?: boolean
252+
/** When `true`, the calculation for the relevance score (used for sorting) will ignore the `field-length norm`. */
247253
ignoreFieldNorm?: boolean
254+
/** Determines how much the `field-length norm` affects scoring. A value of `0` is equivalent to ignoring the field-length norm. A value of `0.5` will greatly reduce the effect of field-length norm, while a value of `2.0` will greatly increase it. */
255+
fieldNormWeight: number
256+
/** Whether the matches should be included in the result set. When `true`, each record in the result set will include the indices of the matched characters. These can consequently be used for highlighting purposes. */
248257
includeMatches?: boolean
258+
/** Whether the score should be included in the result set. A score of `0`indicates a perfect match, while a score of `1` indicates a complete mismatch. */
249259
includeScore?: boolean
260+
/** List of keys that will be searched. This supports nested paths, weighted search, searching in arrays of `strings` and `objects`. */
250261
keys?: Array<FuseOptionKey>
262+
/** Determines approximately where in the text is the pattern expected to be found. */
251263
location?: number
264+
/** Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to `2`). */
252265
minMatchCharLength?: number
266+
/** Whether to sort the result list, by score. */
253267
shouldSort?: boolean
268+
/** The function to use to sort all the results. The default will sort by ascending relevance score, ascending index. */
254269
sortFn?: FuseSortFunction
270+
/** At what point does the match algorithm give up. A threshold of `0.0` requires a perfect match (of both letters and location), a threshold of `1.0` would match anything. */
255271
threshold?: number
272+
/** When `true`, it enables the use of unix-like search commands. See [example](/examples.html#extended-search). */
256273
useExtendedSearch?: boolean
257274
}
258275

0 commit comments

Comments
 (0)