Skip to content
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

many antd 2.0.1 *.d.ts files couldn't pass the compiling of tsc #3358

Closed
AlbertZheng opened this issue Oct 10, 2016 · 5 comments
Closed

many antd 2.0.1 *.d.ts files couldn't pass the compiling of tsc #3358

AlbertZheng opened this issue Oct 10, 2016 · 5 comments

Comments

@AlbertZheng
Copy link
Contributor

AlbertZheng commented Oct 10, 2016

发生问题的环境是:

  • antd 版本: 2.0.1
  • 操作系统及其版本: CentOS 6
  • 浏览器及其版本: Chrome 版本 52.0.2743.116 m
  • 编译器:TypeScript 1.8.10和2.0.3

您做了什么?

将项目从antd 1.11.1升级到antd 2.0.1

您期待的结果是:

能通过tsc编译。

实际上的结果是:

不少antd components的d.ts文件不能通过tsc编译。编译错误说明如下:

When migrated from antd 1.11.x to 2.0.1, there are many errors reported by tsc 1.8.10 and 2.0.3 as the following. Please have a check:
A workaround for TS7006 is to manually add any or any[] type declaration for those parameter in the reported d.ts files. But this error "TS2307: Cannot find module 'rc-select'" perhaps will need to write a index.d.ts for rc-select component.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/upload/interface.d.ts
(30,23): error TS7006: Parameter 'File' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/select/index.d.ts
(2,34): error TS2307: Cannot find module 'rc-select'.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/select/index.d.ts
(38,17): error TS7006: Parameter 'value' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/icon/index.d.ts
(5,16): error TS7006: Parameter 'e' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/form/Form.d.ts
(48,30): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/date-picker/index.d.ts
(11,29): error TS7006: Parameter 'trigger' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/breadcrumb/Breadcrumb.d.ts
(7,19): error TS7006: Parameter 'route' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/breadcrumb/Breadcrumb.d.ts
(7,26): error TS7006: Parameter 'params' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/breadcrumb/Breadcrumb.d.ts
(7,34): error TS7006: Parameter 'routes' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/breadcrumb/Breadcrumb.d.ts
(7,42): error TS7006: Parameter 'paths' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/back-top/index.d.ts
(4,16): error TS7006: Parameter 'event' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/alert/index.d.ts
(16,16): error TS7006: Parameter 'event' implicitly has an 'any' type.

ERROR in /home/vagrant/apps/r0/node_modules/antd/lib/auto-complete/index.d.ts
(24,17): error TS7006: Parameter 'value' implicitly has an 'any' type.

BTW, the four apis are missing in the d.ts file of notification component of antd 2.0.1 when migrated from antd 1.11.x to 2.0.1:

notification.success(config)
notification.error(config)
notification.info(config)
notification.warn(config)

可重现的在线演示

无.

@AlbertZheng
Copy link
Contributor Author

PS: the "disabled" property is also missed in SwitchProps in switch/index.d.ts.

@afc163
Copy link
Member

afc163 commented Oct 10, 2016

Could u help us improve these issues, cause we are short of hands right now. 🤓

@AlbertZheng
Copy link
Contributor Author

@afc163 No problem. I am writing a new app demo using typescript 2.0 and antd 2.0, when it is done I will return my patch files to the community for review.

@afc163
Copy link
Member

afc163 commented Oct 10, 2016

Thx! @AlbertZheng

ref #3170

AlbertZheng added a commit to AlbertZheng/ant-design that referenced this issue Oct 14, 2016
afc163 pushed a commit that referenced this issue Oct 18, 2016
* Fixes for supporting TypeScript 2.0.3

* Fixes for supporting TypeScript 2.0.3. Issue is #3358
AlbertZheng added a commit to AlbertZheng/ant-design that referenced this issue Oct 19, 2016
@lock
Copy link

lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants