Skip to content

Commit

Permalink
add unavailable types for table options and column def options
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Sep 21, 2024
1 parent c600e00 commit f1ba2f4
Show file tree
Hide file tree
Showing 16 changed files with 494 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ export interface ColumnDef_ColumnFiltering<
filterFn?: FilterFnOption<TFeatures, TData>
}

export interface ColumnDef_ColumnFiltering_Unavailable<
TFeatures extends TableFeatures,
TData extends RowData,
> {
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
enableColumnFilter?: boolean
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
filterFn?: FilterFnOption<TFeatures, TData>
}

export interface Column_ColumnFiltering<
TFeatures extends TableFeatures,
TData extends RowData,
Expand Down Expand Up @@ -205,6 +219,36 @@ interface ColumnFiltersOptionsBase<
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>
}

export interface TableOptions_ColumnFiltering_Unavailable<
TFeatures extends TableFeatures,
TData extends RowData,
> {
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
enableColumnFilters?: boolean
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
enableFilters?: boolean
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
filterFromLeafRows?: boolean
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
manualFiltering?: boolean
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
maxLeafRowFilterDepth?: number
/**
* @deprecated Import the `ColumnFiltering` feature to use the column filtering APIs.
*/
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>
}

type ResolvedFilterFns<
TFeatures extends TableFeatures,
TData extends RowData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,31 @@ export interface ColumnDef_ColumnGrouping<
getGroupingValue?: (row: TData) => any
}

export interface ColumnDef_ColumnGrouping_Unavailable<
TFeatures extends TableFeatures,
TData extends RowData,
TValue extends CellData = CellData,
> {
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
aggregatedCell?: ColumnDefTemplate<
ReturnType<Cell<TFeatures, TData, TValue>['getContext']>
>
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
aggregationFn?: AggregationFnOption<TFeatures, TData>
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
enableGrouping?: boolean
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
getGroupingValue?: (row: TData) => any
}

export interface Column_ColumnGrouping<
TFeatures extends TableFeatures,
TData extends RowData,
Expand Down Expand Up @@ -211,6 +236,25 @@ interface GroupingOptionsBase {
onGroupingChange?: OnChangeFn<GroupingState>
}

export interface TableOptions_ColumnGrouping_Unavailable {
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
enableGrouping?: boolean
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
groupedColumnMode?: false | 'reorder' | 'remove'
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
manualGrouping?: boolean
/**
* @deprecated Import the `ColumnGrouping` feature to use the column grouping APIs.
*/
onGroupingChange?: OnChangeFn<GroupingState>
}

type ResolvedAggregationFns<
TFeatures extends TableFeatures,
TData extends RowData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export interface TableOptions_ColumnOrdering {
onColumnOrderChange?: OnChangeFn<ColumnOrderState>
}

export interface TableOptions_ColumnOrdering_Unavailable {
/**
* @deprecated Import the `ColumnOrdering` feature to use the column ordering APIs.
*/
onColumnOrderChange?: OnChangeFn<ColumnOrderState>
}

export interface Column_ColumnOrdering {
/**
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { column_getVisibleLeafColumns } from '../column-visibility/ColumnVisibil
import {
table_getInitialState,
table_getState,
table_getState,
} from '../../core/table/Tables.utils'
import type { TableOptions_ColumnGrouping } from '../column-grouping/ColumnGrouping.types'
import type { CellData, RowData, Updater } from '../../types/type-utils'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ export interface TableOptions_ColumnPinning {
onColumnPinningChange?: OnChangeFn<ColumnPinningState>
}

export interface TableOptions_ColumnPinning_Unavailable {
/**
* @deprecated Import the `ColumnPinning` feature to use the column pinning APIs.
*/
enableColumnPinning?: boolean
/**
* @deprecated Import the `ColumnPinning` feature to use the column pinning APIs.
*/
onColumnPinningChange?: OnChangeFn<ColumnPinningState>
}

export interface ColumnPinningDefaultOptions {
onColumnPinningChange: OnChangeFn<ColumnPinningState>
}
Expand All @@ -51,6 +62,13 @@ export interface ColumnDef_ColumnPinning {
enablePinning?: boolean
}

export interface ColumnDef_ColumnPinning_Unavailable {
/**
* @deprecated Import the `ColumnPinning` feature to use the column pinning APIs.
*/
enablePinning?: boolean
}

export interface Column_ColumnPinning {
/**
* Returns whether or not the column can be pinned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ export interface TableOptions_ColumnResizing {
oncolumnResizingChange?: OnChangeFn<columnResizingState>
}

export interface TableOptions_ColumnResizing_Unavailable {
/**
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
*/
columnResizeMode?: ColumnResizeMode
/**
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
*/
enableColumnResizing?: boolean
/**
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
*/
columnResizeDirection?: ColumnResizeDirection
/**
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
*/
oncolumnResizingChange?: OnChangeFn<columnResizingState>
}

export type ColumnResizingDefaultOptions = Pick<
TableOptions_ColumnResizing,
'columnResizeMode' | 'oncolumnResizingChange' | 'columnResizeDirection'
Expand Down Expand Up @@ -80,6 +99,13 @@ export interface ColumnDef_ColumnResizing {
enableResizing?: boolean
}

export interface ColumnDef_ColumnResizing_Unavailable {
/**
* @deprecated Import the `ColumnResizing` feature to use the column resizing APIs.
*/
enableResizing?: boolean
}

export interface Column_ColumnResizing {
/**
* Returns `true` if the column can be resized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export interface TableOptions_ColumnSizing {
onColumnSizingChange?: OnChangeFn<ColumnSizingState>
}

export interface TableOptions_ColumnSizing_Unavailable {
/**
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
*/
onColumnSizingChange?: OnChangeFn<ColumnSizingState>
}

export type ColumnSizingDefaultOptions = Pick<
TableOptions_ColumnSizing,
'onColumnSizingChange'
Expand Down Expand Up @@ -88,6 +95,21 @@ export interface ColumnDef_ColumnSizing {
size?: number
}

export interface ColumnDef_ColumnSizing_Unavailable {
/**
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
*/
maxSize?: number
/**
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
*/
minSize?: number
/**
* @deprecated Import the `ColumnSizing` feature to use the column sizing APIs.
*/
size?: number
}

export interface Column_ColumnSizing {
/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ export interface TableOptions_ColumnVisibility {
onColumnVisibilityChange?: OnChangeFn<ColumnVisibilityState>
}

export interface TableOptions_ColumnVisibility_Unavailable {
/**
* @deprecated Import the `ColumnVisibility` feature to use the column visibility APIs.
*/
enableHiding?: boolean
/**
* @deprecated Import the `ColumnVisibility` feature to use the column visibility APIs.
*/
onColumnVisibilityChange?: OnChangeFn<ColumnVisibilityState>
}

export type VisibilityDefaultOptions = Pick<
TableOptions_ColumnVisibility,
'onColumnVisibilityChange'
Expand Down Expand Up @@ -91,6 +102,18 @@ export interface Table_ColumnVisibility<
}

export interface ColumnDef_ColumnVisibility {
/**
* Enables/disables column hiding for this column. Defaults to `true`.
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#enablehiding)
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility)
*/
enableHiding?: boolean
}

export interface ColumnDef_ColumnVisibility_Unavailable {
/**
* @deprecated Import the `ColumnVisibility` feature to use the column visibility APIs.
*/
enableHiding?: boolean
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export interface ColumnDef_GlobalFiltering {
enableGlobalFilter?: boolean
}

export interface ColumnDef_GlobalFiltering_Unavailable {
/**
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
*/
enableGlobalFilter?: boolean
}

export interface Column_GlobalFiltering {
/**
* Returns whether or not the column can be **globally** filtered. Set to `false` to disable a column from being scanned during global filtering.
Expand Down Expand Up @@ -81,6 +88,34 @@ export interface TableOptions_GlobalFiltering<
onGlobalFilterChange?: OnChangeFn<any>
}

export interface TableOptions_GlobalFiltering_Unavailable<
TFeatures extends TableFeatures,
TData extends RowData,
> {
/**
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
*/
enableGlobalFilter?: boolean
/**
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
*/
getColumnCanGlobalFilter?: <
TFeatures extends TableFeatures,
TData extends RowData,
TValue extends CellData = CellData,
>(
column: Column<TFeatures, TData, TValue>,
) => boolean
/**
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
*/
globalFilterFn?: FilterFnOption<TFeatures, TData>
/**
* @deprecated Import the `GlobalFiltering` feature to use the global filtering APIs.
*/
onGlobalFilterChange?: OnChangeFn<any>
}

export interface Table_GlobalFiltering<
TFeatures extends TableFeatures,
TData extends RowData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,40 @@ export interface TableOptions_RowExpanding<
paginateExpandedRows?: boolean
}

export interface TableOptions_RowExpanding_Unavailable<
TFeatures extends TableFeatures,
TData extends RowData,
> {
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
autoResetExpanded?: boolean
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
enableExpanding?: boolean
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
getIsRowExpanded?: (row: Row<TFeatures, TData>) => boolean
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
getRowCanExpand?: (row: Row<TFeatures, TData>) => boolean
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
manualExpanding?: boolean
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
onExpandedChange?: OnChangeFn<ExpandedState>
/**
* @deprecated Import the `RowExpanding` feature to use the row expanding APIs.
*/
paginateExpandedRows?: boolean
}

export interface Table_RowExpanding<
TFeatures extends TableFeatures,
TData extends RowData,
Expand Down
Loading

0 comments on commit f1ba2f4

Please sign in to comment.