Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

TsDox

TsDox is a utility to transform Typescript AST to JSON. It extracts the following data

  • classes
  • interfaces
  • methods
  • functions
  • properties
  • enums
  • comments (grouped by JsDoc tags, but untransformed text)
  • decorator

There is no command line interface. The library is meant to be used with tools lke gulp or webpack to render project documentation pages. Since every project has differen requirements, this library will not aim to offer a "ready to use" solution for rendering the doc files.

An example how to use it with

const path = require("path")
const tsdox = require("tsdox")

gulp
  .src("**/*.ts")
  .pipe(tsdox.transform())
  // or if you want to concat all the files into a single json, use
  // .pipe(tsdox.transform({ concat: "api.json" }))
  .pipe(gulp.dest("dist"))

If you use typescript to write a documentation renderer, you can use the typings like this

import {
  TsDoxFile,
  TsDoxClass,
  TsDoxInterface,
  TsDoxFunction,
  TsDoxMethod,
  TsDoxConstructor,
  TsDoxProperty,
  TsDoxParameter,
  TsDoxModifiers,
} from "tsdox/lib/runtime"

About

Transforms typescript AST to JSON

Resources

License

Packages

No packages published