Skip to content

Antd typescript support #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 1, 2019
Merged

Antd typescript support #359

merged 10 commits into from
Jan 1, 2019

Conversation

akki-jat
Copy link
Contributor

for more info look #250

@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #359 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
+ Coverage      87%   87.02%   +0.02%     
==========================================
  Files         143      143              
  Lines        4556     4556              
  Branches     1329     1329              
==========================================
+ Hits         3964     3965       +1     
+ Misses        558      557       -1     
  Partials       34       34
Impacted Files Coverage Δ
components/calendar/Header.jsx 90.16% <0%> (+1.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ff56d0...490ffa0. Read the comment docs.

Adding declare keywords left in last commit
Added support to add Ant Design globally (Vue.use(Antd))
Fix wrong import file
* Data of the treeNodes, manual construction work is no longer needed
* if this property has been set(ensure the Uniqueness of each value)
* @default []
* @type aobject[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aobject => object[]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangxueliang quick to find mistake 😜

changed aobject[] to object[]

/**
* Data source for autocomplete
* @type slot | { value: String, text: String }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • @type slot | Array<{ value: String, text: String }> ?

* to set default picker date
* @type Moment
*/
defaultPickerValue: Moment;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultPickerValue: [Moment, Moment];
Sorry, the document has an error

* to set date
* @type Moment
*/
value: Moment;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value: [Moment, Moment]

* @default 'bottomLeft'
* @type string
*/
plcement: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plcement => placement

top?: string;
}

export declare class Message {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add message.loading

* @default false
* @type boolean
*/
showSizeChanger: Boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean boolean ?

* Type of radio button
* @type string
*/
type: String;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure to support capitalization.

* Set props on per header row
* @type Function
*/
customHeaderRow: (column: any, index: number) => any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many users have questions about customXXX, maybe we can give more detailed types instead of any.

Copy link
Contributor Author

@akki-jat akki-jat Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tangjinzhou Yes we can, but it is very hard to find type for customXXX. So, can we discuss about this?

And all other changes are done.

Copy link
Member

@tangjinzhou tangjinzhou Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this return type applicable on all customXXX (customRow customHeaderRow customCell customHeaderCel)?l

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check now

* @default []
* @type TransferItem
*/
dataSource: TransferItem;
Copy link
Member

@tangjinzhou tangjinzhou Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TransferItem[]

* @default internal calculated position of treeNode or undefined
* @type string
*/
key: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support number

import { TreeNode } from './tree-node';

export interface TreeData {
key: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support number

selectable?: boolean;
}

export declare class TreeSelect extends AntdComponent {
Copy link
Member

@tangjinzhou tangjinzhou Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new prop treeExpandedKeys in v1.2.3


import { AntdComponent } from "../component";

export declare class DictionaryTree extends AntdComponent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoule extends Tree props

* @default []
* @type string[] | { checked: string[]; halfChecked: string[] }
*/
checkedKeys: string[] | { checked: string[]; halfChecked: string[] };
Copy link
Member

@tangjinzhou tangjinzhou Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tree and TreeSelect : xxxKeys should support number[]
new feature at 1.2.3

types/affix.d.ts Outdated
@@ -0,0 +1,28 @@
// Type definitions for Ant Design Vue 1.2.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to add version information.

Copy link
Member

@tangjinzhou tangjinzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your PR, we are not particularly familiar with ts. We have made some small suggestions. If there are any suggestions, please feel free to give us feedback.

Removed Library version from comments & corrected few incorrect types
Tree : xxxKeys should support number[]
@@ -24,7 +23,13 @@ export declare class DropdownButton extends AntdComponent {
* @default 'bottomLeft'
* @type string
*/
plcement: string;
plcement:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plcement => placement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is here something wrong?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry my bad

* Set props on per header row
* @type Function
*/
customHeaderRow: (column: any, index: number) => any;
Copy link
Member

@tangjinzhou tangjinzhou Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table: updated return type for customXXX
Fix spelling mistake (plcement => placement)
@tangjinzhou tangjinzhou merged commit 0e499ee into vueComponent:master Jan 1, 2019
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants