mono / TsToCSharp

Emit C# strongly typed interface code from TypeScript definition files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TsToCSharp

Emit C# strongly typed interface code from TypeScript definition files.

This project is intended to read in TypeScript (.d.ts) defintions files and generate as closely as possible a C# strongly typed API for use from either WebAssembly code or .NET hosted in Electron.

Current Work

This is a work in progress, and we are only getting started.

Only the very basic TypeScript AST parsing is present at this time. Mostly the basic types like interface, boolean, number, arrays, properties, methods and a handful of there associated complex types like string | null, number | null, boolean | null etc.

Getting Started

  1. Installing
  2. Usage
  3. TypeScript to C# mapping
  4. Examples
  5. Unit Tests

Obtaining Definition files

Definitions files describe the shape of JavaScript to the TypeScript compiler and are used only to compile.

The Definitely Typed github repository contains a large collection of TypeScript type definitions (.d.ts).

Suggested resources on Definition Files

About

Emit C# strongly typed interface code from TypeScript definition files.

License:MIT License


Languages

Language:TypeScript 48.7%Language:C# 48.4%Language:JavaScript 2.3%Language:Smalltalk 0.5%