Skip to content

Commit

Permalink
docs: convert comments to typedocs
Browse files Browse the repository at this point in the history
this shows more tooltips when using the library
  • Loading branch information
Viktor Ricchiuto authored and krisk committed Aug 23, 2022
1 parent 5c0ab46 commit 04295e5
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ declare namespace Fuse {
// 'n': 0.5773502691896258
// }
type RecordEntryObject = {
v: string // The text value
n: number // The field-length norm
/** The text value */
v: string
/** The field-length norm */
n: number
}

// 'author.tags.name': [{
Expand All @@ -205,7 +207,8 @@ declare namespace Fuse {
// }
// }
type FuseIndexObjectRecord = {
i: number // The index of the record in the source list
/** The index of the record in the source list */
i: number
$: RecordEntry
}

Expand All @@ -218,9 +221,12 @@ declare namespace Fuse {
// ]
// }
type FuseIndexStringRecord = {
i: number // The index of the record in the source list
v: string // The text value
n: number // The field-length norm
/** The index of the record in the source list */
i: number
/** The text value */
v: string
/** The field-length norm */
n: number
}

type FuseIndexRecords =
Expand Down Expand Up @@ -274,9 +280,18 @@ declare namespace Fuse {
useExtendedSearch?: boolean
}

// Denotes the start/end indices of a match
// start end
// ↓ ↓
/**
* Denotes the start/end indices of a match
*
* @example
*
* ```ts
* const startIndex = 0;
* const endIndex = 5;
*
* const range: RangeTuple = [startIndex, endIndex];
* ```
*/
type RangeTuple = [number, number]

export type FuseResultMatch = {
Expand Down

0 comments on commit 04295e5

Please sign in to comment.