From 427c364297872a391f8d58f9775e6ee2ae1f10e2 Mon Sep 17 00:00:00 2001 From: Pythonfo Date: Fri, 18 Jan 2019 10:43:44 +0800 Subject: [PATCH 1/2] fix: Button, DatePicker, Layout d.ts --- types/button/button.d.ts | 2 +- types/date-picker/date-picker.d.ts | 6 +++--- types/layout/layout-content.d.ts | 28 ++++++++++++++++++++++++++++ types/layout/layout-footer.d.ts | 28 ++++++++++++++++++++++++++++ types/layout/layout-header.d.ts | 28 ++++++++++++++++++++++++++++ types/layout/layout.d.ts | 6 ++++++ 6 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 types/layout/layout-content.d.ts create mode 100644 types/layout/layout-footer.d.ts create mode 100644 types/layout/layout-header.d.ts diff --git a/types/button/button.d.ts b/types/button/button.d.ts index ccc2cbab31..929190a6d2 100644 --- a/types/button/button.d.ts +++ b/types/button/button.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { ButtonGroup } from './button-group'; export declare class Button extends AntdComponent { - Group: ButtonGroup; + static Group: ButtonGroup; /** * can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default) diff --git a/types/date-picker/date-picker.d.ts b/types/date-picker/date-picker.d.ts index 87f3d41c82..27a97ad9e5 100644 --- a/types/date-picker/date-picker.d.ts +++ b/types/date-picker/date-picker.d.ts @@ -9,9 +9,9 @@ import { MonthPicker } from './month-picker'; import { WeekPicker } from './week-picker'; export declare class DatePicker extends DatepickerCommon { - RangePicker: RangePicker; - MonthPicker: MonthPicker; - WeekPickerker: WeekPicker; + static RangePicker: RangePicker; + static MonthPicker: MonthPicker; + static WeekPickerker: WeekPicker; /** * Defualt Value diff --git a/types/layout/layout-content.d.ts b/types/layout/layout-content.d.ts new file mode 100644 index 0000000000..54948f7b41 --- /dev/null +++ b/types/layout/layout-content.d.ts @@ -0,0 +1,28 @@ +// Project: https://github.com/vueComponent/ant-design-vue +// Definitions by: Pythonfo +// Copy from: akki-jat +// Definitions: https://github.com/vueComponent/ant-design-vue/types + +import { AntdComponent } from '../component'; + +export default class LayoutContent extends AntdComponent { + + /** + * container className + * @default undefined + * @type string + */ + class: string; + + /** + * to customize the styles + * @type string | object + */ + style: string | object; + + /** + * whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering + * @type boolean + */ + hasSider: boolean; +} diff --git a/types/layout/layout-footer.d.ts b/types/layout/layout-footer.d.ts new file mode 100644 index 0000000000..d8f155d055 --- /dev/null +++ b/types/layout/layout-footer.d.ts @@ -0,0 +1,28 @@ +// Project: https://github.com/vueComponent/ant-design-vue +// Definitions by: Pythonfo +// Copy from: akki-jat +// Definitions: https://github.com/vueComponent/ant-design-vue/types + +import { AntdComponent } from '../component'; + +export default class LayoutFooter extends AntdComponent { + + /** + * container className + * @default undefined + * @type string + */ + class: string; + + /** + * to customize the styles + * @type string | object + */ + style: string | object; + + /** + * whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering + * @type boolean + */ + hasSider: boolean; +} diff --git a/types/layout/layout-header.d.ts b/types/layout/layout-header.d.ts new file mode 100644 index 0000000000..c8a56cff64 --- /dev/null +++ b/types/layout/layout-header.d.ts @@ -0,0 +1,28 @@ +// Project: https://github.com/vueComponent/ant-design-vue +// Definitions by: Pythonfo +// Copy from: akki-jat +// Definitions: https://github.com/vueComponent/ant-design-vue/types + +import { AntdComponent } from '../component'; + +export default class LayoutHeader extends AntdComponent { + + /** + * container className + * @default undefined + * @type string + */ + class: string; + + /** + * to customize the styles + * @type string | object + */ + style: string | object; + + /** + * whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering + * @type boolean + */ + hasSider: boolean; +} diff --git a/types/layout/layout.d.ts b/types/layout/layout.d.ts index 19ee161529..43936f4141 100644 --- a/types/layout/layout.d.ts +++ b/types/layout/layout.d.ts @@ -4,8 +4,14 @@ import { AntdComponent } from '../component'; import { LayoutSider } from './layout-sider'; +import LayoutHeader from './layout-header'; +import LayoutContent from './layout-content'; +import LayoutFooter from './layout-footer'; export declare class Layout extends AntdComponent { + static Header: LayoutHeader; + static Content: LayoutContent; + static Footer: LayoutFooter; static Sider: LayoutSider; /** From 6d6def524cf04272c95720b25300edff3143ac1b Mon Sep 17 00:00:00 2001 From: Pythonfo Date: Fri, 18 Jan 2019 11:34:07 +0800 Subject: [PATCH 2/2] fix: sub component can be class cannot be instance --- types/anchor/anchor.d.ts | 2 +- types/button/button.d.ts | 2 +- types/card.d.ts | 2 +- types/checkbox/checkbox.d.ts | 2 +- types/collapse/collapse.d.ts | 2 +- types/date-picker/date-picker.d.ts | 6 +++--- types/dropdown/dropdown.d.ts | 2 +- types/form/form.d.ts | 2 +- types/input/input.d.ts | 6 +++--- types/layout/layout.d.ts | 8 ++++---- types/list/list.d.ts | 2 +- types/menu/menu.d.ts | 8 ++++---- types/radio/radio.d.ts | 4 ++-- types/select/select.d.ts | 4 ++-- types/steps/steps.d.ts | 2 +- types/table/table.d.ts | 4 ++-- types/tabs/tabs.d.ts | 2 +- types/tag/tag.d.ts | 2 +- types/timeline/timeline.d.ts | 2 +- types/tree-select.d.ts | 2 +- types/tree/tree.d.ts | 4 ++-- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/types/anchor/anchor.d.ts b/types/anchor/anchor.d.ts index 7aaa44f301..e199211ac9 100644 --- a/types/anchor/anchor.d.ts +++ b/types/anchor/anchor.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { AnchorLink } from './anchor-link'; export declare class Anchor extends AntdComponent { - static Link: AnchorLink; + static Link: typeof AnchorLink; /** * Fixed mode of Anchor diff --git a/types/button/button.d.ts b/types/button/button.d.ts index 929190a6d2..2cfb2ca380 100644 --- a/types/button/button.d.ts +++ b/types/button/button.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { ButtonGroup } from './button-group'; export declare class Button extends AntdComponent { - static Group: ButtonGroup; + static Group: typeof ButtonGroup; /** * can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default) diff --git a/types/card.d.ts b/types/card.d.ts index 740b22f7e2..94f11247e6 100644 --- a/types/card.d.ts +++ b/types/card.d.ts @@ -7,7 +7,7 @@ import { Meta } from './meta'; export declare class Card extends AntdComponent { static Grid: any; - static Meta: Meta; + static Meta: typeof Meta; /** * The action list, shows at the bottom of the Card. diff --git a/types/checkbox/checkbox.d.ts b/types/checkbox/checkbox.d.ts index 2e80c3ef70..7d72c1e1ac 100644 --- a/types/checkbox/checkbox.d.ts +++ b/types/checkbox/checkbox.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { CheckboxGroup } from './checkbox-group'; export declare class Checkbox extends AntdComponent { - static Group: CheckboxGroup; + static Group: typeof CheckboxGroup; /** * get focus when component mounted diff --git a/types/collapse/collapse.d.ts b/types/collapse/collapse.d.ts index 50d2b58408..adf3e29383 100644 --- a/types/collapse/collapse.d.ts +++ b/types/collapse/collapse.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { CollapsePanel } from './collapse-panel'; export declare class Collapse extends AntdComponent { - static Panel: CollapsePanel; + static Panel: typeof CollapsePanel; /** * If true, Collapse renders as Accordion diff --git a/types/date-picker/date-picker.d.ts b/types/date-picker/date-picker.d.ts index 27a97ad9e5..fb919f5e26 100644 --- a/types/date-picker/date-picker.d.ts +++ b/types/date-picker/date-picker.d.ts @@ -9,9 +9,9 @@ import { MonthPicker } from './month-picker'; import { WeekPicker } from './week-picker'; export declare class DatePicker extends DatepickerCommon { - static RangePicker: RangePicker; - static MonthPicker: MonthPicker; - static WeekPickerker: WeekPicker; + static RangePicker: typeof RangePicker; + static MonthPicker: typeof MonthPicker; + static WeekPickerker: typeof WeekPicker; /** * Defualt Value diff --git a/types/dropdown/dropdown.d.ts b/types/dropdown/dropdown.d.ts index 3747ee3398..f711876cfe 100644 --- a/types/dropdown/dropdown.d.ts +++ b/types/dropdown/dropdown.d.ts @@ -7,7 +7,7 @@ import { Menu } from '../menu/menu'; import { DropdownButton } from './dropdown-button'; export declare class Dropdown extends AntdComponent { - static Button: DropdownButton; + static Button: typeof DropdownButton; /** * the trigger mode which executes the drop-down action diff --git a/types/form/form.d.ts b/types/form/form.d.ts index a4fce30825..c4613bc4bf 100644 --- a/types/form/form.d.ts +++ b/types/form/form.d.ts @@ -312,7 +312,7 @@ export interface IformCreateOption { } export declare class Form extends AntdComponent { - static Item: FormItem; + static Item: typeof FormItem; static create: (options: IformCreateOption) => (WrapedComponent: any) => any; /** diff --git a/types/input/input.d.ts b/types/input/input.d.ts index 8a5c994bd4..cdeb124613 100644 --- a/types/input/input.d.ts +++ b/types/input/input.d.ts @@ -8,9 +8,9 @@ import { InputSearch } from './input-search'; import { TextArea } from './textarea'; export declare class Input extends AntdComponent { - static Group: InputGroup; - static Search: InputSearch; - static TextArea: TextArea; + static Group: typeof InputGroup; + static Search: typeof InputSearch; + static TextArea: typeof TextArea; /** * The label text displayed after (on the right side of) the input field. diff --git a/types/layout/layout.d.ts b/types/layout/layout.d.ts index 43936f4141..0a00644f1c 100644 --- a/types/layout/layout.d.ts +++ b/types/layout/layout.d.ts @@ -9,10 +9,10 @@ import LayoutContent from './layout-content'; import LayoutFooter from './layout-footer'; export declare class Layout extends AntdComponent { - static Header: LayoutHeader; - static Content: LayoutContent; - static Footer: LayoutFooter; - static Sider: LayoutSider; + static Header: typeof LayoutHeader; + static Content: typeof LayoutContent; + static Footer: typeof LayoutFooter; + static Sider: typeof LayoutSider; /** * container className diff --git a/types/list/list.d.ts b/types/list/list.d.ts index d01666e67f..aa1fd49f20 100644 --- a/types/list/list.d.ts +++ b/types/list/list.d.ts @@ -14,7 +14,7 @@ export declare class PaginationConfig extends Pagination { } export class List extends AntdComponent { - static Item: ListItem; + static Item: typeof ListItem; /** * Toggles rendering of the border around the list diff --git a/types/menu/menu.d.ts b/types/menu/menu.d.ts index 6abc7c2254..fc444f7aa0 100644 --- a/types/menu/menu.d.ts +++ b/types/menu/menu.d.ts @@ -9,10 +9,10 @@ import { MenuItemGroup } from './menu-item-group'; import { Divider } from '../divider'; export declare class Menu extends AntdComponent { - static Item: MenuItem; - static SubMenu: SubMenu; - static ItemGroup: MenuItemGroup; - static Divider: Divider; + static Item: typeof MenuItem; + static SubMenu: typeof SubMenu; + static ItemGroup: typeof MenuItemGroup; + static Divider: typeof Divider; /** * Allow selection of multiple items diff --git a/types/radio/radio.d.ts b/types/radio/radio.d.ts index 57d3997620..30cbd36a85 100644 --- a/types/radio/radio.d.ts +++ b/types/radio/radio.d.ts @@ -7,8 +7,8 @@ import { RadioGroup } from './radio-group'; import { RadioButton } from './radio-button'; export declare class Radio extends AntdComponent { - static Group: RadioGroup; - static Button: RadioButton; + static Group: typeof RadioGroup; + static Button: typeof RadioButton; /** * get focus when component mounted diff --git a/types/select/select.d.ts b/types/select/select.d.ts index 1058d55d18..2f93920afe 100644 --- a/types/select/select.d.ts +++ b/types/select/select.d.ts @@ -8,8 +8,8 @@ import { OptionGroup } from './option-group'; import { VNode } from 'vue'; export declare class Select extends AntdComponent { - static Option: Option; - static OptGroup: OptionGroup; + static Option: typeof Option; + static OptGroup: typeof OptionGroup; /** * Show clear button. diff --git a/types/steps/steps.d.ts b/types/steps/steps.d.ts index c8de7d9d03..5b1fb6896f 100644 --- a/types/steps/steps.d.ts +++ b/types/steps/steps.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { Step } from './step'; export declare class Steps extends AntdComponent { - static Step: Step; + static Step: typeof Step; /** * to set the current step, counting from 0. You can overwrite this state by using status of Step diff --git a/types/table/table.d.ts b/types/table/table.d.ts index 5b0afc5e33..e841663ecc 100644 --- a/types/table/table.d.ts +++ b/types/table/table.d.ts @@ -116,8 +116,8 @@ export interface TableRowSelection { } export declare class Table extends AntdComponent { - static Column: Column; - static ColumnGroup: ColumnGroup; + static Column: typeof Column; + static ColumnGroup: typeof ColumnGroup; /** * Whether to show all table borders diff --git a/types/tabs/tabs.d.ts b/types/tabs/tabs.d.ts index de03cd74c3..e5f69fc620 100644 --- a/types/tabs/tabs.d.ts +++ b/types/tabs/tabs.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { TabPane } from './tab-pane'; export declare class Tabs extends AntdComponent { - static TabPane: TabPane; + static TabPane: typeof TabPane; /** * Current TabPane's key diff --git a/types/tag/tag.d.ts b/types/tag/tag.d.ts index de46497560..768c55f027 100644 --- a/types/tag/tag.d.ts +++ b/types/tag/tag.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { CheckableTag } from './checkable-tag'; export declare class Tag extends AntdComponent { - static CheckableTag: CheckableTag; + static CheckableTag: typeof CheckableTag; /** * Callback executed when close animation is completed diff --git a/types/timeline/timeline.d.ts b/types/timeline/timeline.d.ts index 63c7d92246..d8c9828765 100644 --- a/types/timeline/timeline.d.ts +++ b/types/timeline/timeline.d.ts @@ -6,7 +6,7 @@ import { AntdComponent } from '../component'; import { TimelineItem } from './timeline-item'; export declare class Timeline extends AntdComponent { - static Item: TimelineItem; + static Item: typeof TimelineItem; /** * Set the last ghost node's existence or its content diff --git a/types/tree-select.d.ts b/types/tree-select.d.ts index f868a8de70..c274b43830 100644 --- a/types/tree-select.d.ts +++ b/types/tree-select.d.ts @@ -16,7 +16,7 @@ export interface TreeData { } export declare class TreeSelect extends AntdComponent { - static TreeNode: TreeNode; + static TreeNode: typeof TreeNode; /** * Whether allow clear diff --git a/types/tree/tree.d.ts b/types/tree/tree.d.ts index 2c40723ccc..599e9db4c3 100644 --- a/types/tree/tree.d.ts +++ b/types/tree/tree.d.ts @@ -7,8 +7,8 @@ import { TreeNode } from '../tree-node'; import { DictionaryTree } from './dictionary-tree'; export declare class Tree extends AntdComponent { - static TreeNode: TreeNode; - static DirectoryTree: DictionaryTree; + static TreeNode: typeof TreeNode; + static DirectoryTree: typeof DictionaryTree; /** * treeNode of tree