clr2ts 0.1.4

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global clr2ts --version 0.1.4                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local clr2ts --version 0.1.4                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=clr2ts&version=0.1.4                
nuke :add-package clr2ts --version 0.1.4                

clr2ts

Build Status GitHub Nuget (with prereleases)

Transpiler that takes CLR assemblies and outputs corresponding typescript definitions.

Note: Under development

Please note that this tool is still in an early phase of development and missing many important features. There is already a version available on nuget.org that can be installed and used for very simple examples. Future changes should only affect the configuration file, so that you can update to a better version later and just change that file accordingly.

Installation

Get clr2ts by installing it as a dotnet tool from nuget.org.

dotnet tool install -g clr2ts

More information about installing dotnet tools can be found here.

Usage

Run clr2ts by calling the dotnet tool with the configuration file you would like to use.

clr2ts your.config.json

If you call clr2ts without specifying a configuration file, it will automatically look for one in the current working directory and its parent directories using the search pattern *clr2ts.json. If you use relative paths in your configuration, they are always relative to the configuration file.

Configuration

A configuration file may look like this:

{
    "input": { 
        "assemblyFiles": [
            "./Path/To/Your/Assembly.dll"
        ],
        "typeFilters": [
            { "hasAttribute": ["AttributeName"] }
        ]
    },
    "output": {
        "bundledFile": "./Path/To/Your/TypeScriptCodeBase/bundle.ts",
        "files": {
            "directory": "./Path/To/Your/TypeScriptCodeBase/directory",
            "mimicNamespacesWithSubdirectories": true
        }
    }
}

Future plans

You can find some of the ideas for future releases in the github projects of this repository as well as in the draft for a more complex configuration file located under docs in the source code. Those plans include better translation features (like support of generics and collection types or converting to camelCase naming conventions) and better handling of clr2ts (logging, custom type maps or type filters).

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.6.1 1,111 5/2/2024
0.6.0 5,877 2/19/2024
0.5.1 222 1/21/2024
0.5.0 169 1/21/2024
0.4.2 2,417 7/24/2023
0.4.1 3,531 6/20/2023
0.4.0 4,726 3/1/2022
0.3.3 526 1/19/2022
0.3.2 477 1/18/2022
0.3.1 703 2/17/2021
0.3.0 682 10/14/2020
0.2.4 424 10/9/2020
0.2.3 732 5/19/2020
0.2.2 582 5/8/2020
0.2.1 621 2/25/2020
0.2.0 563 2/24/2020
0.1.9 549 12/13/2019
0.1.8 514 12/4/2019
0.1.7 622 8/25/2019
0.1.6 674 5/19/2019
0.1.5 607 5/1/2019
0.1.4 589 4/27/2019
0.1.3 680 4/20/2019
0.1.2 629 4/19/2019
0.1.0 611 4/16/2019

Add support for more use cases (generics, collections, automatic transpilation of dependencies).
Extend configuration (filter types by attribute or base type).