An open API service indexing awesome lists of open source software.

https://github.com/zhangyu1818/generate-d-ts

generate d.ts by typescript api.
https://github.com/zhangyu1818/generate-d-ts

Last synced: 3 months ago
JSON representation

generate d.ts by typescript api.

Awesome Lists containing this project

README

        

# generate-d-ts

Generate d.ts by TypeScript api.

## Installation

```sh
npm i generate-d-ts
```

## Usage

```js
const { createDeclarations, writeDeclarations } = require('generate-d-ts') // or import

/**
* @param filesPath string[]
* @param outDir string
*/
const declarations = createDeclarations(['src/index.ts', 'src/component.ts'], 'lib')

// write files
writeDeclarations(declarations)
```