-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Antd typescript support #359
Conversation
Added typing files for better support in Typescript
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Adding declare keywords left in last commit
Added support to add Ant Design globally (Vue.use(Antd))
Fix wrong import file
types/tree-select.d.ts
Outdated
* 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[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aobject => object[]
There was a problem hiding this comment.
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[]
types/auto-complete.d.ts
Outdated
|
||
/** | ||
* Data source for autocomplete | ||
* @type slot | { value: String, text: String } |
There was a problem hiding this comment.
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 }> ?
types/date-picker/range-picker.ts
Outdated
* to set default picker date | ||
* @type Moment | ||
*/ | ||
defaultPickerValue: Moment; |
There was a problem hiding this comment.
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
types/date-picker/range-picker.ts
Outdated
* to set date | ||
* @type Moment | ||
*/ | ||
value: Moment; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: [Moment, Moment]
types/dropdown/dropdown-button.d.ts
Outdated
* @default 'bottomLeft' | ||
* @type string | ||
*/ | ||
plcement: string; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add message.loading
types/pagination.d.ts
Outdated
* @default false | ||
* @type boolean | ||
*/ | ||
showSizeChanger: Boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean boolean ?
types/radio/radio-button.d.ts
Outdated
* Type of radio button | ||
* @type string | ||
*/ | ||
type: String; |
There was a problem hiding this comment.
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.
types/table/table.d.ts
Outdated
* Set props on per header row | ||
* @type Function | ||
*/ | ||
customHeaderRow: (column: any, index: number) => any; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/vuejs/babel-plugin-transform-vue-jsx#difference-from-react-jsx
{
props, attrs, on, class, style, nativeOn,
}
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check now
types/transfer.d.ts
Outdated
* @default [] | ||
* @type TransferItem | ||
*/ | ||
dataSource: TransferItem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TransferItem[]
types/tree-node.d.ts
Outdated
* @default internal calculated position of treeNode or undefined | ||
* @type string | ||
*/ | ||
key: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support number
types/tree-select.d.ts
Outdated
import { TreeNode } from './tree-node'; | ||
|
||
export interface TreeData { | ||
key: string; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
types/tree/dictionary-tree.d.ts
Outdated
|
||
import { AntdComponent } from "../component"; | ||
|
||
export declare class DictionaryTree extends AntdComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoule extends Tree
props
types/tree/tree.d.ts
Outdated
* @default [] | ||
* @type string[] | { checked: string[]; halfChecked: string[] } | ||
*/ | ||
checkedKeys: string[] | { checked: string[]; halfChecked: string[] }; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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[]
types/dropdown/dropdown-button.d.ts
Outdated
@@ -24,7 +23,13 @@ export declare class DropdownButton extends AntdComponent { | |||
* @default 'bottomLeft' | |||
* @type string | |||
*/ | |||
plcement: string; | |||
plcement: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plcement => placement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is here something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry my bad
types/table/table.d.ts
Outdated
* Set props on per header row | ||
* @type Function | ||
*/ | ||
customHeaderRow: (column: any, index: number) => any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/vuejs/babel-plugin-transform-vue-jsx#difference-from-react-jsx
{
props, attrs, on, class, style, nativeOn,
}
table: updated return type for customXXX
Fix spelling mistake (plcement => placement)
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. |
for more info look #250