//#region src/match-sorter.d.ts /** * Forked from match-sorter by Kent C. Dodds */ interface KeyAttributes { threshold?: Ranking; maxRanking: Ranking; minRanking: Ranking; } interface RankingInfo { rankedValue: string; rank: Ranking; keyIndex: number; keyThreshold: Ranking | undefined; } interface ValueGetterKey { (item: ItemType): string | Array; } interface IndexedItem { item: ItemType; index: number; } interface RankedItem extends RankingInfo, IndexedItem {} interface BaseSorter { (a: RankedItem, b: RankedItem): number; } interface Sorter { (matchItems: Array>): Array>; } interface KeyAttributesOptions { key?: string | ValueGetterKey; threshold?: Ranking; maxRanking?: Ranking; minRanking?: Ranking; } type KeyOption = KeyAttributesOptions | ValueGetterKey | string; interface MatchSorterOptions { keys?: ReadonlyArray>; threshold?: Ranking; baseSort?: BaseSorter; keepDiacritics?: boolean; sorter?: Sorter; } declare const rankings: { readonly CASE_SENSITIVE_EQUAL: 7; readonly EQUAL: 6; readonly STARTS_WITH: 5; readonly WORD_STARTS_WITH: 4; readonly CONTAINS: 3; readonly ACRONYM: 2; readonly MATCHES: 1; readonly NO_MATCH: 0; }; type Ranking = (typeof rankings)[keyof typeof rankings]; declare const defaultBaseSortFn: BaseSorter; /** * Takes an array of items and a value and returns a new array with the items that match the given value * @param items - the items to sort * @param value - the value to use for ranking * @param options - Some options to configure the sorter * @returns - the new sorted array */ declare function matchSorter(items: ReadonlyArray, value: string, options?: MatchSorterOptions): Array; declare namespace matchSorter { var rankings: { readonly CASE_SENSITIVE_EQUAL: 7; readonly EQUAL: 6; readonly STARTS_WITH: 5; readonly WORD_STARTS_WITH: 4; readonly CONTAINS: 3; readonly ACRONYM: 2; readonly MATCHES: 1; readonly NO_MATCH: 0; }; } //#endregion export { type KeyAttributes, type KeyAttributesOptions, type KeyOption, type MatchSorterOptions, type RankingInfo, type ValueGetterKey, defaultBaseSortFn, matchSorter, rankings }; //# sourceMappingURL=match-sorter.d.mts.map