From 51655e2e7cefc0c6558f7a7df6a7c7540d8464d6 Mon Sep 17 00:00:00 2001 From: Jordan Hornblow Date: Tue, 13 Jun 2017 16:43:19 +1000 Subject: [PATCH] Allow Number type table keys. Make notification success, error, info, warn and warning non-optional (#6434) * Allow Number type table keys. Make notification success, error, info, warn and warning non-optional * Fix build error --- components/notification/index.tsx | 19 ++++++++++--------- components/table/Table.tsx | 10 +++++----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/components/notification/index.tsx b/components/notification/index.tsx index ded1d41c78..97bbef6a7e 100755 --- a/components/notification/index.tsx +++ b/components/notification/index.tsx @@ -148,18 +148,19 @@ function notice(args) { }); } -const api: { - success?(args: ArgsProps): void; - error?(args: ArgsProps): void; - info?(args: ArgsProps): void; - warn?(args: ArgsProps): void; - warning?(args: ArgsProps): void; - +export interface NotificationApi { + success(args: ArgsProps): void; + error(args: ArgsProps): void; + info(args: ArgsProps): void; + warn(args: ArgsProps): void; + warning(args: ArgsProps): void; open(args: ArgsProps): void; close(key: string): void; config(options: ConfigProps): void; destroy(): void; -} = { +} + +const api = { open(args: ArgsProps) { notice(args); }, @@ -208,4 +209,4 @@ const api: { (api as any).warn = (api as any).warning; -export default api; +export default api as NotificationApi; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index a3b435e437..a888f6896a 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -50,8 +50,8 @@ export type TableColumnConfig = ColumnProps; export interface TableRowSelection { type?: 'checkbox' | 'radio'; - selectedRowKeys?: string[]; - onChange?: (selectedRowKeys: string[], selectedRows: Object[]) => any; + selectedRowKeys?: string[] | number[]; + onChange?: (selectedRowKeys: string[] | number[], selectedRows: Object[]) => any; getCheckboxProps?: (record: T) => Object; onSelect?: (record: T, selected: boolean, selectedRows: Object[]) => any; onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => any; @@ -70,11 +70,11 @@ export interface TableProps { rowKey?: string | ((record: T, index: number) => string); rowClassName?: (record: T, index: number) => string; expandedRowRender?: any; - defaultExpandedRowKeys?: string[]; - expandedRowKeys?: string[]; + defaultExpandedRowKeys?: string[] | number[]; + expandedRowKeys?: string[] | number[]; expandIconAsCell?: boolean; expandIconColumnIndex?: number; - onExpandedRowsChange?: (expandedRowKeys: string[]) => void; + onExpandedRowsChange?: (expandedRowKeys: string[] | number[]) => void; onExpand?: (expanded: boolean, record: T) => void; onChange?: (pagination: PaginationProps | boolean, filters: string[], sorter: Object) => any; loading?: boolean | SpinProps;