T
TanStack2y ago
xenial-black

filter function type

In the FilterFn documentation there is this writing:
export type FilterFn<TData extends AnyData> = {
(
row: Row<TData>,
columnId: string,
filterValue: any,
addMeta: (meta: any) => void
): boolean
resolveFilterValue?: TransformFilterValueFn<TData>
autoRemove?: ColumnFilterAutoRemoveTestFn<TData>
addMeta?: (meta?: any) => void
}
export type FilterFn<TData extends AnyData> = {
(
row: Row<TData>,
columnId: string,
filterValue: any,
addMeta: (meta: any) => void
): boolean
resolveFilterValue?: TransformFilterValueFn<TData>
autoRemove?: ColumnFilterAutoRemoveTestFn<TData>
addMeta?: (meta?: any) => void
}
Is that correct typescript? if so, I never seen this kind of declaration before.. Should'n you declare function type with something like
type FilterFn = (row: Row<TData>, ....) => boolean
type FilterFn = (row: Row<TData>, ....) => boolean
? https://tanstack.com/table/v8/docs/api/features/filters
Filters | TanStack Table Docs
Can-Filter The ability for a column to be column filtered is determined by the following:
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?