Skip to content

Commit 196b637

Browse files
tt0mmytommyKevinVandy
authored
fix: changes types to interface so they can be extended (#1178)
Co-authored-by: tommy <admin@ip-192-168-0-153.us-west-2.compute.internal> Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
1 parent bc32898 commit 196b637

File tree

1 file changed

+30
-28
lines changed
  • packages/material-react-table/src

1 file changed

+30
-28
lines changed

packages/material-react-table/src/types.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,20 @@ export interface MRT_TableState<TData extends MRT_RowData> extends TableState {
406406
showToolbarDropZone: boolean;
407407
}
408408

409-
export type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<
410-
ColumnDef<TData, TValue>,
411-
| 'accessorKey'
412-
| 'aggregatedCell'
413-
| 'aggregationFn'
414-
| 'cell'
415-
| 'columns'
416-
| 'filterFn'
417-
| 'footer'
418-
| 'header'
419-
| 'id'
420-
| 'sortingFn'
421-
> & {
409+
export interface MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown>
410+
extends Omit<
411+
ColumnDef<TData, TValue>,
412+
| 'accessorKey'
413+
| 'aggregatedCell'
414+
| 'aggregationFn'
415+
| 'cell'
416+
| 'columns'
417+
| 'filterFn'
418+
| 'footer'
419+
| 'header'
420+
| 'id'
421+
| 'sortingFn'
422+
> {
422423
AggregatedCell?: (props: {
423424
cell: MRT_Cell<TData, TValue>;
424425
column: MRT_Column<TData, TValue>;
@@ -682,7 +683,7 @@ export type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<
682683
}) => ReactNode[];
683684
sortingFn?: MRT_SortingFn<TData>;
684685
visibleInShowHideMenu?: boolean;
685-
};
686+
}
686687

687688
export type MRT_DisplayColumnDef<
688689
TData extends MRT_RowData,
@@ -802,19 +803,20 @@ export type MRT_DisplayColumnIds =
802803
* See the full props list on the official docs site:
803804
* @link https://www.material-react-table.com/docs/api/props
804805
*/
805-
export type MRT_TableOptions<TData extends MRT_RowData> = Omit<
806-
Partial<TableOptions<TData>>,
807-
| 'columns'
808-
| 'data'
809-
| 'defaultColumn'
810-
| 'enableRowSelection'
811-
| 'expandRowsFn'
812-
| 'getRowId'
813-
| 'globalFilterFn'
814-
| 'initialState'
815-
| 'onStateChange'
816-
| 'state'
817-
> & {
806+
export interface MRT_TableOptions<TData extends MRT_RowData>
807+
extends Omit<
808+
Partial<TableOptions<TData>>,
809+
| 'columns'
810+
| 'data'
811+
| 'defaultColumn'
812+
| 'enableRowSelection'
813+
| 'expandRowsFn'
814+
| 'getRowId'
815+
| 'globalFilterFn'
816+
| 'initialState'
817+
| 'onStateChange'
818+
| 'state'
819+
> {
818820
columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
819821
columnFilterModeOptions?: Array<
820822
LiteralUnion<string & MRT_FilterOption>
@@ -1293,4 +1295,4 @@ export type MRT_TableOptions<TData extends MRT_RowData> = Omit<
12931295
* Manage state externally any way you want, then pass it back into MRT.
12941296
*/
12951297
state?: Partial<MRT_TableState<TData>>;
1296-
};
1298+
}

0 commit comments

Comments
 (0)