Skip to content

Commit

Permalink
omit tree column renderers and children
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki committed Dec 19, 2023
1 parent 33e3c74 commit 60472ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/GridTreeColumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import {
export * from './generated/GridTreeColumn.js';

export type GridTreeColumnProps<TItem> = Partial<
Omit<_GridTreeColumnProps<TItem>, 'footerRenderer' | 'headerRenderer' | keyof OmittedGridColumnHTMLAttributes<TItem>>
Omit<
_GridTreeColumnProps<TItem>,
'children' | 'footerRenderer' | 'headerRenderer' | 'renderer' | keyof OmittedGridColumnHTMLAttributes<TItem>
>
>;

export const GridTreeColumn = _GridTreeColumn as <TItem>(
Expand Down
6 changes: 6 additions & 0 deletions test/typings/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ assertType<DOMAttributes<GridColumnGroupElement>['children'] | undefined>(gridCo
assertOmitted<GridColumnProps, GridColumnGroupElement>('renderer');

const gridTreeColumnProps = React.createElement(GridTreeColumn, {}).props;
type GridTreeColumnProps = typeof gridTreeColumnProps;

assertType<string | null | undefined>(gridTreeColumnProps.path);

assertOmitted<GridColumnProps, GridTreeColumnProps>('renderer');
assertOmitted<GridColumnProps, GridTreeColumnProps>('headerRenderer');
assertOmitted<GridColumnProps, GridTreeColumnProps>('footerRenderer');
assertOmitted<GridColumnProps, GridTreeColumnProps>('children');

const gridSortColumnProps = React.createElement(GridSortColumn, {}).props;
const gridFilterColumnProps = React.createElement(GridFilterColumn, {}).props;
const gridSelectionColumnProps = React.createElement(GridSelectionColumn, {}).props;
Expand Down

0 comments on commit 60472ca

Please sign in to comment.