Using the project is a simple step of executing the project from the command line with a list of files specified.
First you will need a TypeScript (.d.ts) definition file to be used as input.
$ npm start [options] path/to/file/definition.d.ts
By default the generated file will reside in the same path as the definition file and will have a .cs
extension.
All the available command line options can be found in the Generate Options document.
npm start ../tests/interface.d.ts
Output:
> tstocsharp@1.0.0 start /projects/TypeScript/TsToCSharp
> node ./dist/TStoCSharp.js "../tests/interface.d.ts"
Starting Generation for file(s): ../tests/interface.d.ts
Resolving File: ../tests/interface.d.ts => /projects/TypeScript/tests/interface.d.ts
The output will reside in the same directory as /projects/TypeScript/tests/interface.cs
.
If the CLI interface was setup by following the instructions Command Line Interface from the Installing doc then you can simple do the following:
$ TsToCSharp [options] file1.d.ts file2.d.ts
From the Terminal or Command Prompt enter the following:
$ TsToCSharp
And you will be presented with a help screen