@l-l/2dts
api.json转为typescript的类型定义文件
Last updated a year ago by whj1995 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @l-l/2dts 
SYNC missed versions from official npm registry.

2dts

api.json转为typescript的类型定义文件

api.json => typing.d.ts

用法

npm install @l-l/2dts
  1. 命令行使用
2dts <path> <output>

例如:

2dts ./api.json ./typing.d.ts
  1. 引入包使用
const todts = require('@l-l/2dts')
const fs = require('fs');

// 读取api.json
const apiJson = JSON.parse(fs.readFileSync('xx/api.json').toString());

// 转换
const dts = todts(apiJson,{
  format: true, // 格式化
  utilType: true // 生成工具类型 
});

// 写
fs.writeFileSync('xx/typing.d.ts',  dts);

Current Tags

  • 0.0.9                                ...           latest (a year ago)

8 Versions

  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (10)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |