import { Observable } from 'rxjs';

export type AutocompleteSearchFn<TItem> = (
  term: string,
  limit: number
) => Observable<readonly TItem[]>;

export type AutocompleteDisplayFn<TItem> = (item: TItem) => string;

export type AutocompleteValueFn<TItem, TValue> = (item: TItem) => TValue;

export type AutocompleteTrackFn<TItem> = (item: TItem) => string | number;

export type AutocompleteResolveValueFn<TItem, TValue> = (
  value: TValue
) => Observable<TItem | null>;
