小编Dus*_*rst的帖子

从typescript生成JSON模式

我正在尝试创建一个打字稿文档生成器,但要这样做,我需要将一个打字稿文件解析为更容易阅读的东西

EX:

"Command": {
    "description": "A command object for the command handler",
    "constructor": [
      {
        "name": "name",
        "type": "string",
        "optional": false,
        "default": null,
        "description": "Name of the command"
      },
      {
        "name": "callback",
        "type": "(event: CommandContext) => void",
        "optional": false,
        "default": null,
        "description": "Callback for the command"
      }
    ],
    "properties": [
      {
        "name": "name",
        "description": "Name of the command",
        "type": "string"
      },
      {
        "name": "fullname",
        "description": "Fullname of the command",
        "type": "string"
      }
    ],
    "methods": [
      {
        "name": "canRun",
        "description": "Checks …
Run Code Online (Sandbox Code Playgroud)

javascript documentation-generation typescript

6
推荐指数
2
解决办法
2250
查看次数