forked from neolution-ch/react-data-table
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact-table.d.ts
More file actions
85 lines (70 loc) · 1.96 KB
/
react-table.d.ts
File metadata and controls
85 lines (70 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* eslint-disable @typescript-eslint/no-unused-vars */
import { RowData, Table } from "@tanstack/react-table";
import { CSSProperties, JSX } from "react";
interface DropdownColumnFilterOption {
label: string;
value: string | number;
disabled?: boolean;
}
interface DropdownColumnFilter {
options: DropdownColumnFilterOption[];
}
declare module "@tanstack/table-core" {
interface ColumnMeta<TData extends RowData, TValue> {
/**
* Define a dropdown filter
*/
dropdownFilter?: DropdownColumnFilter;
/**
* Add a style to every cell in this column
*/
cellStyle?: CSSProperties;
/**
* Add class name to the every cell in this column
*/
cellClassName?: string;
/**
* Add a style to the header cell of this column
*/
headerStyle?: CSSProperties;
/**
* Add class name to the every header in this column
*/
headerClassName?: string;
/**
* Add a style to the footer cell of this column
*/
footerStyle?: CSSProperties;
/**
* Add class name to the every footer in this column
*/
footerClassName?: string;
/**
* Define a custom filter
* @param filterValue The current value of the filter
* @param setFilterValue The callback to update the filter state
* @param table The table object
* @returns The custom filter component
*/
customFilter?: <T>(filterValue: T, setFilterValue: (filterValue: T) => void, table: Table<TData>) => JSX.Element;
/**
* Prevents the column from being drawn
*/
isHidden?: boolean;
/**
* Set to true to hide the header filters
*/
hideHeaderFilters?: boolean;
/**
* Sets the header filter style
*/
headerFilterStyle?: CSSProperties;
/**
* Custom filter name to use instead of the default used accessor name
*/
customFilterName?: string;
}
interface RowSelectionOptions<TData extends RowData> {
fullRowSelectable?: boolean;
}
}