UNPKG

701 BTypeScriptView Raw
1import { TextAccessor } from './Accessors';
2export declare const presets: {
3 eq: (a: any, b: any) => boolean;
4 contains: (a: string, b: string) => boolean;
5 startsWith: (a: string, b: string) => boolean;
6};
7export declare type FilterFunction<TDataItem> = (item: TDataItem, searchTerm: string, idx?: number) => boolean;
8export declare type FilterPreset = keyof typeof presets;
9export declare type Filter<TDataItem> = boolean | FilterPreset | FilterFunction<TDataItem> | null;
10export declare function useFilteredData<TDataItem>(data: readonly TDataItem[], filterer: Filter<TDataItem>, searchTerm?: string, textAccessor?: TextAccessor): readonly TDataItem[];
11//# sourceMappingURL=Filter.d.ts.map
\No newline at end of file