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

关于typescript to json idl #3

Open
acivang opened this issue Dec 6, 2016 · 2 comments
Open

关于typescript to json idl #3

acivang opened this issue Dec 6, 2016 · 2 comments

Comments

@acivang
Copy link
Member

acivang commented Dec 6, 2016

个人不太建议实现typescript to json idl,理由是typescript的数据类型太简化,不能准确的转换到强类型语言,而且类型规范也不能强制化,像如下代码:

getProfileForMe(categories: Array<Category>, promotionId: string): Promise<any>;

除非规定不允许使用any,否则上述代码再转换时不知返回类型。
再者,number的转换也不好明确目标类型。

@pootow
Copy link
Member

pootow commented Dec 7, 2016 via email

@acivang
Copy link
Member Author

acivang commented Dec 15, 2016

typescript还不支持int、float。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants