Skip to content

关于typescript to json idl #3

Description

@acivang

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

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions