import { AlgoFn } from "./algo"; import { Rune } from "./runes"; import { FzfResultItem, BaseOptions, SyncOptions, AsyncOptions, Tiebreaker, Token, Selector } from "./types"; export type ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never; type SortAttrs = { sort?: true; tiebreakers?: Tiebreaker[]; } | { sort: false; }; type BaseOptsToUse = Omit>, "sort" | "tiebreakers"> & SortAttrs; type BaseOptionsTuple = U extends string ? [options?: BaseOptsToUse] : [options: BaseOptsToUse & { selector: Selector; }]; export declare abstract class BaseFinder> { runesList: Rune[][]; items: L; readonly opts: BaseOptions>; algoFn: AlgoFn; constructor(list: L, ...optionsTuple: BaseOptionsTuple>); } export type SyncOptsToUse = BaseOptsToUse & Partial, "match">>; export type SyncOptionsTuple = U extends string ? [options?: SyncOptsToUse] : [options: SyncOptsToUse & { selector: Selector; }]; export declare class SyncFinder> extends BaseFinder { readonly opts: SyncOptions>; constructor(list: L, ...optionsTuple: SyncOptionsTuple>); find(query: string): FzfResultItem>[]; } export type AsyncOptsToUse = BaseOptsToUse & Partial, "match">>; export type AsyncOptionsTuple = U extends string ? [options?: AsyncOptsToUse] : [options: AsyncOptsToUse & { selector: Selector; }]; export declare class AsyncFinder> extends BaseFinder { readonly opts: AsyncOptions>; token: Token; constructor(list: L, ...optionsTuple: AsyncOptionsTuple>); find(query: string): Promise>[]>; } export {};