Generate type definitions from a web-page. Type more whilst typing less with Typeless.

CI NPM

const Typeless = require('@dancotton/typeless');

(async () => {  
  const types = await Typeless.scrapeTypes(config);

  // Write files to disk using fs! 
  // For now, only supports a flat directory structure!
})()

// Config data structure
const config = {
  pageURL,
  objectRowSelector,
  objectRowToNameSelector,
  objectRowToPropertiesSelector,
  objectRowToInheritanceSelector,
  propertyRowToNameSelector,
  propertyRowToTypeSelector,
  puppeteerOptions: {
    args: []
  }
}

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install @dancotton/typeless

Features

  • Automated Scraping for Documentation sites
  • Seamless Generation of Typescript interfaces (properties and types)
  • Automated Inheritance based on documentation.

Documentation