Skip to content

Commit f1ba2f4

Browse files
committed
add unavailable types for table options and column def options
1 parent c600e00 commit f1ba2f4

File tree

16 files changed

+494
-47
lines changed

16 files changed

+494
-47
lines changed

packages/table-core/src/features/column-filtering/ColumnFiltering.types.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,20 @@ export interface ColumnDef_ColumnFiltering<
9595
filterFn?: FilterFnOption<TFeatures, TData>
9696
}
9797

98+
export interface ColumnDef_ColumnFiltering_Unavailable<
99+
TFeatures extends TableFeatures,
100+
TData extends RowData,
101+
> {
102+
/**
103+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
104+
*/
105+
enableColumnFilter?: boolean
106+
/**
107+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
108+
*/
109+
filterFn?: FilterFnOption<TFeatures, TData>
110+
}
111+
98112
export interface Column_ColumnFiltering<
99113
TFeatures extends TableFeatures,
100114
TData extends RowData,
@@ -205,6 +219,36 @@ interface ColumnFiltersOptionsBase<
205219
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>
206220
}
207221

222+
export interface TableOptions_ColumnFiltering_Unavailable<
223+
TFeatures extends TableFeatures,
224+
TData extends RowData,
225+
> {
226+
/**
227+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
228+
*/
229+
enableColumnFilters?: boolean
230+
/**
231+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
232+
*/
233+
enableFilters?: boolean
234+
/**
235+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
236+
*/
237+
filterFromLeafRows?: boolean
238+
/**
239+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
240+
*/
241+
manualFiltering?: boolean
242+
/**
243+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
244+
*/
245+
maxLeafRowFilterDepth?: number
246+
/**
247+
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
248+
*/
249+
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>
250+
}
251+
208252
type ResolvedFilterFns<
209253
TFeatures extends TableFeatures,
210254
TData extends RowData,

packages/table-core/src/features/column-grouping/ColumnGrouping.types.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,31 @@ export interface ColumnDef_ColumnGrouping<
8282
getGroupingValue?: (row: TData) => any
8383
}
8484

85+
export interface ColumnDef_ColumnGrouping_Unavailable<
86+
TFeatures extends TableFeatures,
87+
TData extends RowData,
88+
TValue extends CellData = CellData,
89+
> {
90+
/**
91+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
92+
*/
93+
aggregatedCell?: ColumnDefTemplate<
94+
ReturnType<Cell<TFeatures, TData, TValue>['getContext']>
95+
>
96+
/**
97+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
98+
*/
99+
aggregationFn?: AggregationFnOption<TFeatures, TData>
100+
/**
101+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
102+
*/
103+
enableGrouping?: boolean
104+
/**
105+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
106+
*/
107+
getGroupingValue?: (row: TData) => any
108+
}
109+
85110
export interface Column_ColumnGrouping<
86111
TFeatures extends TableFeatures,
87112
TData extends RowData,
@@ -211,6 +236,25 @@ interface GroupingOptionsBase {
211236
onGroupingChange?: OnChangeFn<GroupingState>
212237
}
213238

239+
export interface TableOptions_ColumnGrouping_Unavailable {
240+
/**
241+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
242+
*/
243+
enableGrouping?: boolean
244+
/**
245+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
246+
*/
247+
groupedColumnMode?: false | 'reorder' | 'remove'
248+
/**
249+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
250+
*/
251+
manualGrouping?: boolean
252+
/**
253+
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
254+
*/
255+
onGroupingChange?: OnChangeFn<GroupingState>
256+
}
257+
214258
type ResolvedAggregationFns<
215259
TFeatures extends TableFeatures,
216260
TData extends RowData,

packages/table-core/src/features/column-ordering/ColumnOrdering.types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ export interface TableOptions_ColumnOrdering {
2424
onColumnOrderChange?: OnChangeFn<ColumnOrderState>
2525
}
2626

27+
export interface TableOptions_ColumnOrdering_Unavailable {
28+
/**
29+
* @deprecated Import the `ColumnOrdering` feature to use the column ordering APIs.
30+
*/
31+
onColumnOrderChange?: OnChangeFn<ColumnOrderState>
32+
}
33+
2734
export interface Column_ColumnOrdering {
2835
/**
2936
* Returns the index of the column in the order of the visible columns. Optionally pass a `position` parameter to get the index of the column in a sub-section of the table

packages/table-core/src/features/column-ordering/ColumnOrdering.utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { column_getVisibleLeafColumns } from '../column-visibility/ColumnVisibil
22
import {
33
table_getInitialState,
44
table_getState,
5-
table_getState,
65
} from '../../core/table/Tables.utils'
76
import type { TableOptions_ColumnGrouping } from '../column-grouping/ColumnGrouping.types'
87
import type { CellData, RowData, Updater } from '../../types/type-utils'

packages/table-core/src/features/column-pinning/ColumnPinning.types.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ export interface TableOptions_ColumnPinning {
3838
onColumnPinningChange?: OnChangeFn<ColumnPinningState>
3939
}
4040

41+
export interface TableOptions_ColumnPinning_Unavailable {
42+
/**
43+
* @deprecated Import the `ColumnPinning` feature to use the column pinning APIs.
44+
*/
45+
enableColumnPinning?: boolean
46+
/**
47+
* @deprecated Import the `ColumnPinning` feature to use the column pinning APIs.
48+
*/
49+
onColumnPinningChange?: OnChangeFn<ColumnPinningState>
50+
}
51+
4152
export interface ColumnPinningDefaultOptions {
4253
onColumnPinningChange: OnChangeFn<ColumnPinningState>
4354
}
@@ -51,6 +62,13 @@ export interface ColumnDef_ColumnPinning {
5162
enablePinning?: boolean
5263
}
5364

65+
export interface ColumnDef_ColumnPinning_Unavailable {
66+
/**
67+
* @deprecated Import the `ColumnPinning` feature to use the column pinning APIs.
68+
*/
69+
enablePinning?: boolean
70+
}
71+
5472
export interface Column_ColumnPinning {
5573
/**
5674
* Returns whether or not the column can be pinned.

packages/table-core/src/features/column-resizing/ColumnResizing.types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,25 @@ export interface TableOptions_ColumnResizing {
5151
oncolumnResizingChange?: OnChangeFn<columnResizingState>
5252
}
5353

54+
export interface TableOptions_ColumnResizing_Unavailable {
55+
/**
56+
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
57+
*/
58+
columnResizeMode?: ColumnResizeMode
59+
/**
60+
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
61+
*/
62+
enableColumnResizing?: boolean
63+
/**
64+
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
65+
*/
66+
columnResizeDirection?: ColumnResizeDirection
67+
/**
68+
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
69+
*/
70+
oncolumnResizingChange?: OnChangeFn<columnResizingState>
71+
}
72+
5473
export type ColumnResizingDefaultOptions = Pick<
5574
TableOptions_ColumnResizing,
5675
'columnResizeMode' | 'oncolumnResizingChange' | 'columnResizeDirection'
@@ -80,6 +99,13 @@ export interface ColumnDef_ColumnResizing {
8099
enableResizing?: boolean
81100
}
82101

102+
export interface ColumnDef_ColumnResizing_Unavailable {
103+
/**
104+
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
105+
*/
106+
enableResizing?: boolean
107+
}
108+
83109
export interface Column_ColumnResizing {
84110
/**
85111
* Returns `true` if the column can be resized.

packages/table-core/src/features/column-sizing/ColumnSizing.types.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ export interface TableOptions_ColumnSizing {
2323
onColumnSizingChange?: OnChangeFn<ColumnSizingState>
2424
}
2525

26+
export interface TableOptions_ColumnSizing_Unavailable {
27+
/**
28+
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
29+
*/
30+
onColumnSizingChange?: OnChangeFn<ColumnSizingState>
31+
}
32+
2633
export type ColumnSizingDefaultOptions = Pick<
2734
TableOptions_ColumnSizing,
2835
'onColumnSizingChange'
@@ -88,6 +95,21 @@ export interface ColumnDef_ColumnSizing {
8895
size?: number
8996
}
9097

98+
export interface ColumnDef_ColumnSizing_Unavailable {
99+
/**
100+
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
101+
*/
102+
maxSize?: number
103+
/**
104+
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
105+
*/
106+
minSize?: number
107+
/**
108+
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
109+
*/
110+
size?: number
111+
}
112+
91113
export interface Column_ColumnSizing {
92114
/**
93115
* Returns the offset measurement along the row-axis (usually the x-axis for standard tables) for the header. This is effectively a sum of the offset measurements of all succeeding (right) headers in relation to the current column.

packages/table-core/src/features/column-visibility/ColumnVisibility.types.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ export interface TableOptions_ColumnVisibility {
3131
onColumnVisibilityChange?: OnChangeFn<ColumnVisibilityState>
3232
}
3333

34+
export interface TableOptions_ColumnVisibility_Unavailable {
35+
/**
36+
* @deprecated Import the `ColumnVisibility` feature to use the column visibility APIs.
37+
*/
38+
enableHiding?: boolean
39+
/**
40+
* @deprecated Import the `ColumnVisibility` feature to use the column visibility APIs.
41+
*/
42+
onColumnVisibilityChange?: OnChangeFn<ColumnVisibilityState>
43+
}
44+
3445
export type VisibilityDefaultOptions = Pick<
3546
TableOptions_ColumnVisibility,
3647
'onColumnVisibilityChange'
@@ -91,6 +102,18 @@ export interface Table_ColumnVisibility<
91102
}
92103

93104
export interface ColumnDef_ColumnVisibility {
105+
/**
106+
* Enables/disables column hiding for this column. Defaults to `true`.
107+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#enablehiding)
108+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility)
109+
*/
110+
enableHiding?: boolean
111+
}
112+
113+
export interface ColumnDef_ColumnVisibility_Unavailable {
114+
/**
115+
* @deprecated Import the `ColumnVisibility` feature to use the column visibility APIs.
116+
*/
94117
enableHiding?: boolean
95118
}
96119

packages/table-core/src/features/global-filtering/GlobalFiltering.types.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ export interface ColumnDef_GlobalFiltering {
3131
enableGlobalFilter?: boolean
3232
}
3333

34+
export interface ColumnDef_GlobalFiltering_Unavailable {
35+
/**
36+
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
37+
*/
38+
enableGlobalFilter?: boolean
39+
}
40+
3441
export interface Column_GlobalFiltering {
3542
/**
3643
* Returns whether or not the column can be **globally** filtered. Set to `false` to disable a column from being scanned during global filtering.
@@ -81,6 +88,34 @@ export interface TableOptions_GlobalFiltering<
8188
onGlobalFilterChange?: OnChangeFn<any>
8289
}
8390

91+
export interface TableOptions_GlobalFiltering_Unavailable<
92+
TFeatures extends TableFeatures,
93+
TData extends RowData,
94+
> {
95+
/**
96+
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
97+
*/
98+
enableGlobalFilter?: boolean
99+
/**
100+
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
101+
*/
102+
getColumnCanGlobalFilter?: <
103+
TFeatures extends TableFeatures,
104+
TData extends RowData,
105+
TValue extends CellData = CellData,
106+
>(
107+
column: Column<TFeatures, TData, TValue>,
108+
) => boolean
109+
/**
110+
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
111+
*/
112+
globalFilterFn?: FilterFnOption<TFeatures, TData>
113+
/**
114+
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
115+
*/
116+
onGlobalFilterChange?: OnChangeFn<any>
117+
}
118+
84119
export interface Table_GlobalFiltering<
85120
TFeatures extends TableFeatures,
86121
TData extends RowData,

packages/table-core/src/features/row-expanding/RowExpanding.types.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,40 @@ export interface TableOptions_RowExpanding<
9898
paginateExpandedRows?: boolean
9999
}
100100

101+
export interface TableOptions_RowExpanding_Unavailable<
102+
TFeatures extends TableFeatures,
103+
TData extends RowData,
104+
> {
105+
/**
106+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
107+
*/
108+
autoResetExpanded?: boolean
109+
/**
110+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
111+
*/
112+
enableExpanding?: boolean
113+
/**
114+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
115+
*/
116+
getIsRowExpanded?: (row: Row<TFeatures, TData>) => boolean
117+
/**
118+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
119+
*/
120+
getRowCanExpand?: (row: Row<TFeatures, TData>) => boolean
121+
/**
122+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
123+
*/
124+
manualExpanding?: boolean
125+
/**
126+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
127+
*/
128+
onExpandedChange?: OnChangeFn<ExpandedState>
129+
/**
130+
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
131+
*/
132+
paginateExpandedRows?: boolean
133+
}
134+
101135
export interface Table_RowExpanding<
102136
TFeatures extends TableFeatures,
103137
TData extends RowData,

0 commit comments

Comments
 (0)