dts-element
A DOM library for generation TypeScript declaration (.d.ts) files
Changelog - Examples - Documentation
Features
- reusable
FunctionDeclaration
: it can be method or function based on where it is.VariableDeclaration
: it can be property or variable based on where it is.
- parsable
- parsing TypeScript syntax into
dts-element
usingdts.parse()
, useful for restructuring types
- parsing TypeScript syntax into
Installation
using npm
npm install --save dts-element
using yarn
yarn add dts-element
Usage
Code
; ; // equivalent to dts.parse('function getThing(x: number): void;').members[0]; ; ; console.logdts.emit dts.create_top_level_element,;
Output
declare
Development
# test yarn run test # build yarn run build # lint yarn run lint # generate docs yarn run docs
Related
- dts-dom: another dts DOM library from TS team member