diff --git a/src/index.d.ts b/src/index.d.ts index a3abe588d..c35dbed79 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -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': [{ @@ -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 } @@ -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 = @@ -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 = {