Skip to content
Transforms typescript AST to JSON
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src
.editorconfig
.gitignore
.jshintrc
LICENSE
README.md
gulpfile.js
package.json
tsconfig.json
yarn.lock

README.md

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"
You can’t perform that action at this time.