Skip to content

Commit

Permalink
chore: table: adds a bit more type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
dkilgore-eightfold committed Sep 9, 2022
1 parent c606c27 commit da9a130
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions src/components/Table/Table.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ export interface ColumnType<RecordType>

export interface ColumnGroupType<RecordType>
extends Omit<ColumnType<RecordType>, 'dataIndex'> {
/**
* The ColumnGroup children.
*/
children: ColumnsType<RecordType>;
}

Expand All @@ -186,15 +189,15 @@ export type ColumnsType<RecordType = unknown> = (

export interface SelectionItem {
/**
* Unique key of this selection.
* Unique key of the selection item.
*/
key: string;
/**
* Callback executed when this selection is clicked.
* Callback executed when the selection item is clicked.
*/
onSelect?: SelectionItemSelectFn;
/**
* Display text of this selection.
* Display text of the selection item.
*/
text: React.ReactNode;
}
Expand Down Expand Up @@ -324,18 +327,34 @@ export interface TablePaginationConfig extends Omit<PaginationProps, 'total'> {
export const EMPTY_LIST: any[] = [];

export interface ChangeEventInfo<RecordType> {
/**
* The chnage event params of filters.
*/
filters: Record<string, FilterValue | null>;
/**
* The filter state.
*/
filterStates: FilterState<RecordType>[];
/**
* The change event params of pagination.
*/
pagination: {
currentPage?: number;
pageSize?: number;
total: number;
};
filters: Record<string, FilterValue | null>;
/**
* The reset pagination function.
*/
resetPagination: Function;
/**
* The change event params of sorter.
*/
sorter: SorterResult<RecordType> | SorterResult<RecordType>[];

filterStates: FilterState<RecordType>[];
/**
* The sorter state.
*/
sorterStates: SortState<RecordType>[];

resetPagination: Function;
}

export interface TableProps<RecordType>
Expand Down

0 comments on commit da9a130

Please sign in to comment.