From da9a130356d1674775a4246b0e377e08e7bbf880 Mon Sep 17 00:00:00 2001 From: Dylan Kilgore Date: Fri, 9 Sep 2022 16:49:07 -0700 Subject: [PATCH] chore: table: adds a bit more type annotations --- src/components/Table/Table.types.tsx | 35 +++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/components/Table/Table.types.tsx b/src/components/Table/Table.types.tsx index 492c927e7..926155644 100644 --- a/src/components/Table/Table.types.tsx +++ b/src/components/Table/Table.types.tsx @@ -176,6 +176,9 @@ export interface ColumnType export interface ColumnGroupType extends Omit, 'dataIndex'> { + /** + * The ColumnGroup children. + */ children: ColumnsType; } @@ -186,15 +189,15 @@ export type ColumnsType = ( 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; } @@ -324,18 +327,34 @@ export interface TablePaginationConfig extends Omit { export const EMPTY_LIST: any[] = []; export interface ChangeEventInfo { + /** + * The chnage event params of filters. + */ + filters: Record; + /** + * The filter state. + */ + filterStates: FilterState[]; + /** + * The change event params of pagination. + */ pagination: { currentPage?: number; pageSize?: number; total: number; }; - filters: Record; + /** + * The reset pagination function. + */ + resetPagination: Function; + /** + * The change event params of sorter. + */ sorter: SorterResult | SorterResult[]; - - filterStates: FilterState[]; + /** + * The sorter state. + */ sorterStates: SortState[]; - - resetPagination: Function; } export interface TableProps