Skip to content

Proglang-TypeScript/ts-declaration-file-generator-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript declaration files generator service

Installation

Docker

Install Docker. https://docs.docker.com/install/

Install

Clone this repository and then run:

./install.sh

Usage

Generate a Typescript declaration file from Javascript code

./bin/run.sh [JS-FILE] [TYPESCRIPT-MODULE-NAME] [OUTPUT_DIRECTORY]

Example

You can use the example provided in this repo under example/calculator.js.

./bin/run.sh examples/example.js calculator /tmp/ts-declaration-file-generator-service

You will find the declaration file under /tmp/ts-declaration-file/calculator/index.d.ts:

cat /tmp/ts-declaration-file-generator-service/calculator/index.d.ts
export = Calculator;

declare class Calculator {
    constructor();
    sum(a: number, b: number): number;
}

declare namespace Calculator {
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages