From 1ab0930213e68110e22b6f89681c4651586c9420 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Mon, 25 Sep 2023 17:10:29 -0400 Subject: [PATCH] fix(types): small TS type fix on DataView setFilter --- packages/common/src/interfaces/slickDataView.interface.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/common/src/interfaces/slickDataView.interface.ts b/packages/common/src/interfaces/slickDataView.interface.ts index 86c04429e..8310fbb79 100644 --- a/packages/common/src/interfaces/slickDataView.interface.ts +++ b/packages/common/src/interfaces/slickDataView.interface.ts @@ -6,6 +6,8 @@ import type { SlickGrid } from './index'; +export type FilterFn = (item: T, args: any) => boolean; + export interface SlickDataView { // -- // Slick DataView Available Methods @@ -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; /** Get only the DataView filtered items */ getFilteredItems: () => T[]; @@ -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(filterFn: FilterFn): void; /** Set extra Filter arguments which will be used by the Filter method */ setFilterArgs(args: any): void;