From 04295e51ef9305824852241affce5e2dc00299f8 Mon Sep 17 00:00:00 2001 From: Viktor Ricchiuto Date: Tue, 21 Jun 2022 01:03:34 +0200 Subject: [PATCH] docs: convert comments to typedocs this shows more tooltips when using the library --- src/index.d.ts | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) 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 = {