Skip to content

Commit

Permalink
fix(types): small TS type fix on DataView setFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Sep 25, 2023
1 parent 8203a3d commit 1ab0930
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/common/src/interfaces/slickDataView.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import type {
SlickGrid
} from './index';

export type FilterFn<T> = (item: T, args: any) => boolean;

export interface SlickDataView {
// --
// Slick DataView Available Methods
Expand Down Expand Up @@ -69,7 +71,7 @@ export interface SlickDataView {
fastSort(field: string | Function, ascending: boolean): void;

/** Get current Filter used by the DataView */
getFilter(): any;
getFilter(): FilterFn<any>;

/** Get only the DataView filtered items */
getFilteredItems: <T = any>() => T[];
Expand Down Expand Up @@ -169,7 +171,7 @@ export interface SlickDataView {
setGrouping(groupingInfo: Grouping | Grouping[]): void;

/** Set a Filter that will be used by the DataView */
setFilter(filterFn: ((item1: any, item2: any) => boolean)): void;
setFilter<T = any>(filterFn: FilterFn<T>): void;

/** Set extra Filter arguments which will be used by the Filter method */
setFilterArgs(args: any): void;
Expand Down

0 comments on commit 1ab0930

Please sign in to comment.