0.0.0 • Published 4 years ago

programming-linguist v0.0.0

Weekly downloads
2
License
Apache-2.0
Repository
-
Last release
4 years ago

programming-linguist

Main Maintainability Test Coverage

A library to facilitate generation of TypeScript code from TypeScript/Javascript applications.

Quick Start

Installation

Add the library to your dependencies using your package manager of choice:

  • npm install programming-linguist
  • yarn add programming-linguist

Usage

Start by creating a new Project, then add SourceFiles to it with statements in those, and finally synthesize the Project:

import * as linguist from 'programming-linguist';

// Creating a root TypeScript Project
const project = new linguist.Project();

// Creating a new SourceFile in the project
const sourceFile = new linguist.SourceFile(project, 'index');

// Adding a new Interface declaration
new linguist.Interface(sourceFile, 'FooInterface', {
  documentation: 'This is an example interface',
  exported: true,
  name: 'FooInterface',
});

// Synthesizing the project into `/target/directory`:
project.synthesize('/target/directory');