diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 680a504294a7..e814faea5639 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -4,7 +4,7 @@ import Animate from 'rc-animate'; import Icon from '../icon'; import classNames from 'classnames'; -interface AlertProps { +export interface AlertProps { /** * Type of Alert styles, options:`success`, `info`, `warning`, `error` */ diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index 8a4885ebe13a..2b6d6deecb80 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -23,7 +23,7 @@ function getScroll(target, top) { return ret; } -interface BackTopProps { +export interface BackTopProps { visibilityHeight?: number; onClick?: (event) => void; target?: () => HTMLElement | Window; diff --git a/components/badge/index.tsx b/components/badge/index.tsx index 3864a6329470..0280c07f184b 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -3,7 +3,7 @@ import Animate from 'rc-animate'; import ScrollNumber from './ScrollNumber'; import classNames from 'classnames'; -interface BadgeProps { +export interface BadgeProps { /** Number to show in badge */ count: number | string; /** Max count to show */ diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index 580d9d9d0e8f..81d56f4d5e1a 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import splitObject from '../_util/splitObject'; -interface BreadcrumbItemProps { +export interface BreadcrumbItemProps { separator?: React.ReactNode; href?: string; } diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index 8bb5b9d71f77..36405a040636 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -4,9 +4,9 @@ import splitObject from '../_util/splitObject'; const prefix = 'ant-btn-group-'; -type ButtonSize = 'small' | 'large' +export type ButtonSize = 'small' | 'large' -interface ButtonGroupProps { +export interface ButtonGroupProps { size?: ButtonSize; style?: React.CSSProperties; className?: string; diff --git a/components/button/button.tsx b/components/button/button.tsx index b95679b4ecc8..4228a26904f9 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -24,11 +24,11 @@ function insertSpace(child) { return child; } -type ButtonType = 'primary' | 'ghost' | 'dashed' -type ButtonShape = 'circle' | 'circle-outline' -type ButtonSize = 'small' | 'large' +export type ButtonType = 'primary' | 'ghost' | 'dashed' +export type ButtonShape = 'circle' | 'circle-outline' +export type ButtonSize = 'small' | 'large' -interface ButtonProps { +export interface ButtonProps { type?: ButtonType; htmlType?: string; icon?: string; diff --git a/components/calendar/index.tsx b/components/calendar/index.tsx index e7864ca9f65d..7d50e289d4c3 100644 --- a/components/calendar/index.tsx +++ b/components/calendar/index.tsx @@ -16,7 +16,7 @@ function zerofixed(v) { return `${v}`; } -interface CalendarContext { +export interface CalendarContext { antLocale?: { Calendar?: any }; diff --git a/components/card/index.tsx b/components/card/index.tsx index 094495151c0a..75612d3c1510 100644 --- a/components/card/index.tsx +++ b/components/card/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import classNames from 'classnames'; import splitObject from '../_util/splitObject'; -interface CardProps { +export interface CardProps { title?: React.ReactNode; extra?: React.ReactNode; bordered?: boolean; diff --git a/components/date-picker/index.tsx b/components/date-picker/index.tsx index 145dd2af3487..fab7f5456757 100644 --- a/components/date-picker/index.tsx +++ b/components/date-picker/index.tsx @@ -9,7 +9,7 @@ import RangePicker from './RangePicker'; import Calendar from './Calendar'; import { TimePickerProps } from '../time-picker'; -interface PickerProps { +export interface PickerProps { format?: string; disabled?: boolean; style?: React.CSSProperties; @@ -19,7 +19,7 @@ interface PickerProps { getCalendarContainer?: (trigger) => React.ReactNode; } -interface SinglePickerProps { +export interface SinglePickerProps { value?: moment.Moment; defaultValue?: moment.Moment; defaultPickerValue?: moment.Moment; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index a196360f0bda..461f6dbed505 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -70,7 +70,7 @@ export interface FormComponentProps { form: WrappedFormUtils; } -class FormComponent extends React.Component { +export class FormComponent extends React.Component { } export interface ComponentDecorator { diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 317def73ec76..459fe0e4df59 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -27,7 +27,7 @@ function clearNextFrameAction(nextFrameId) { } } -interface AutoSizeType { +export interface AutoSizeType { minRows?: number; maxRows?: number; }; diff --git a/components/layout/col.tsx b/components/layout/col.tsx index bad0db3a6f7c..b939cb5e696b 100644 --- a/components/layout/col.tsx +++ b/components/layout/col.tsx @@ -7,7 +7,7 @@ import splitObject from '../_util/splitObject'; const stringOrNumber = PropTypes.oneOfType([PropTypes.string, PropTypes.number]); const objectOrNumber = PropTypes.oneOfType([PropTypes.object, PropTypes.number]); -interface ColSize { +export interface ColSize { span?: number; order?: number; offset?: number; diff --git a/components/menu/index.tsx b/components/menu/index.tsx index 645786319a25..e329f5f3a3b2 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -5,7 +5,7 @@ import animation from '../_util/openAnimation'; function noop() { } -interface SelectParam { +export interface SelectParam { key: string; keyPath: Array; item: any; @@ -13,7 +13,7 @@ interface SelectParam { selectedKeys: Array; } -interface ClickParam { +export interface ClickParam { key: string; keyPath: Array; item: any; diff --git a/components/message/index.tsx b/components/message/index.tsx index 727977a4345a..3d831ebc75ce 100644 --- a/components/message/index.tsx +++ b/components/message/index.tsx @@ -57,7 +57,7 @@ type ConfigContent = React.ReactNode; type ConfigDuration = number; type ConfigOnClose = () => void; -interface ConfigOptions { +export interface ConfigOptions { top?: number; duration?: number; prefixCls?: string; diff --git a/components/select/index.tsx b/components/select/index.tsx index 8eb00c61a1c0..738fb4bdeb80 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -3,7 +3,7 @@ import { PropTypes } from 'react'; import RcSelect, { Option, OptGroup } from 'rc-select'; import classNames from 'classnames'; -type SelectValue = string | string[] | Array<{ key: string, label: React.ReactNode }>; +export type SelectValue = string | string[] | Array<{ key: string, label: React.ReactNode }>; export interface SelectProps { prefixCls?: string; diff --git a/components/slider/index.tsx b/components/slider/index.tsx index b1b0e01d130c..b44227b22b7d 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -2,14 +2,14 @@ import * as React from 'react'; import { PropTypes } from 'react'; import RcSlider from 'rc-slider'; -interface SliderMarks { +export interface SliderMarks { [key: number]: React.ReactNode | { style: React.CSSProperties, label: React.ReactNode, }; } -type SliderValue = number | [number, number]; +export type SliderValue = number | [number, number]; export interface SliderProps { range?: boolean; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index aeca192fae35..9f36dbfcf1d6 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -33,7 +33,7 @@ const defaultPagination = { onShowSizeChange: noop, }; -interface TableRowSelection { +export interface TableRowSelection { type?: 'checkbox' | 'radio'; selectedRowKeys?: string[]; onChange?: (selectedRowKeys: string[], selectedRows: Object[]) => any; @@ -42,7 +42,7 @@ interface TableRowSelection { onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => any; } -interface TableColumnConfig { +export interface TableColumnConfig { title?: React.ReactNode; key?: string; dataIndex?: string; @@ -87,7 +87,7 @@ export interface TableProps { childrenColumnName?: 'string'; } -interface TableContext { +export interface TableContext { antLocale?: { Table?: any, }; diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index 1a612c217003..59bc2880e69b 100644 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -4,8 +4,8 @@ import { cloneElement } from 'react'; import classNames from 'classnames'; import Icon from '../icon'; -type TabsType = 'line' | 'card' | 'editable-card' -type TabsPosition = 'top' | 'right' | 'bottom' | 'left'; +export type TabsType = 'line' | 'card' | 'editable-card' +export type TabsPosition = 'top' | 'right' | 'bottom' | 'left'; export interface TabsProps { activeKey?: string; diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 3e282d7c835d..9601cf1de76a 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -4,7 +4,7 @@ import RcTooltip from 'rc-tooltip'; import getPlacements from '../popover/placements'; import classNames from 'classnames'; -type PopoverPlacement = +export type PopoverPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom' diff --git a/components/tree-select/interface.tsx b/components/tree-select/interface.tsx index 2004183a9242..ca17c1b30274 100644 --- a/components/tree-select/interface.tsx +++ b/components/tree-select/interface.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -interface TreeData { +export interface TreeData { key: string; value: string; label: React.ReactNode; diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index 902a077e1a2d..dcd5be8eb0d1 100644 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -type UploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed' +export type UploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed' export interface HttpRequestHeader { [key: string]: string; @@ -18,7 +18,7 @@ export interface File { originFileObj?: File; } -interface UploadChangeParam { +export interface UploadChangeParam { file: File; fileList: Array; event?: { percent: number }; diff --git a/custom-typings.d.ts b/typings/custom-typings.d.ts similarity index 100% rename from custom-typings.d.ts rename to typings/custom-typings.d.ts