SearchHit beta
Interface of @v12-engine/client/kit
ts
export interface SearchHit<T>An item a search found: how well, and where
Members
item
ts
item: T;The item found
matches
ts
matches: SearchMatch[];Where the words were found, by key: the letters that matched
rank
ts
rank: number;How well, the lower the better: 0 a key is the words typed, 1 one starts with them, 2 each word starts a word of a key, 3 the words are somewhere in its keys, 4 and up a word was found nearly (a typo: the nearer, the lower). Between the whole numbers, a lighter key's match (SearchKey.weight): Math.floor, up to 4, is the kind of match