UNPKG

@ledgerhq/live-common

Version:
22 lines 730 B
import Fuse from "fuse.js"; export declare function useSearch<Item, T extends TextInput | undefined = undefined>({ list, options, defaultInput, filter, }: { list: Item[]; defaultInput?: string; options: Fuse.IFuseOptions<Item>; filter?: (item: Item, input: string) => void; }): SearchRaw<Item, T>; export interface SearchRaw<Item, T extends TextInput | undefined = undefined> { inputRef: React.RefObject<T | null>; input: string; result: Item[]; isActive: boolean; isSearching: boolean; onChange: (value: string) => void; onFocus: () => void; onCancel: () => void; } export interface TextInput { focus: () => void; blur: () => void; } //# sourceMappingURL=useSearch.d.ts.map