TypeScriptModelsGenerator 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package TypeScriptModelsGenerator --version 1.0.4
                    
NuGet\Install-Package TypeScriptModelsGenerator -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TypeScriptModelsGenerator" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TypeScriptModelsGenerator" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="TypeScriptModelsGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TypeScriptModelsGenerator --version 1.0.4
                    
#r "nuget: TypeScriptModelsGenerator, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TypeScriptModelsGenerator@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TypeScriptModelsGenerator&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=TypeScriptModelsGenerator&version=1.0.4
                    
Install as a Cake Tool

Support for system types (also as nullable)

string
int
uint
bool
byte[]
long
ulong
float
short
ushort
byte
sbyte
char
DateTime
Guid
decimal
double

Support for collections (T as generic, system type or custom type)

ICollection<T>
IEnumerable<T>
IList<T>
List<T>
Array

Support for custom types

(abstract) class
interface
enum

Support examples for inheritance and generics (C#) Example 1:

public interface IAnimalModel { }
public class DogModel : IAnimalModel { }

Example 2:

    public class EntityModel { }
    public class PersonModel : EntityModel { }

Example 3:

    public interface IBehaviour { }
    public interface IAnimal<T> where T : IBehaviour { }

Example 4:

public interface IBehaviour { }
public class UnknownBehaviour<T> where T : IBehaviour { }

Example 5:

	public class EntityModel { }
	public class TrackedModel { }
	public abstract class FileModel<T> : EntityModel where T : TrackedModel { }

Example 6:

	 public class Type1 { }
	 public class Type2 { }
	 public class Type3<T1, T2, (n..*)> where T1 : Type1 where T2 : Type2 { }

Example 7:

	 public interface IType1 { }
	 public interface IType2 { }
	 public class Type3<T> where T : IType1, IType2 { }

Example usage

TypeScriptModelsGeneration
	.Setup(sourceAssembly, destinationDirectory)
		
	//Scope input of all C# models with postfix Model
	.MatchModels("Model$")

	//or scope input of all C# models with an expression
	.MatchModels(x => x.NameSpace.Contains("Models"))
		
	//Scope input of all C# models with postfix Model and Replace 'Model' in name with empty string
	.ReplaceModels("Model$", string.Empty)
	
	//Combine MatchModels and ReplaceModels if you use the same pattern
	.MatchAndReplaceModels("Model$", string.Empty)
        
	//Scope input of all C# models in a namespace that contains 'Models'
	.MatchNameSpace("Models")
		
	//Replace part of the c# model NameSpace to avoid extra 'my-app' and 'models' folder
	.ReplaceNameSpace("MyApp", string.Empty)
	.ReplaceNameSpace("Models", string.Empty)
	
	//Combine MatchNameSpace and ReplaceNameSpace if you use the same pattern
	.MatchAndReplaceNameSpace("Models", string.Empty)

	//by default initialization for objects and arrays is done; omit with.
	//.OmitInitialization() 
		
	// Generate files
	.Execute();
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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TypeScriptModelsGenerator:

Package Downloads
TypeScriptModelsGenerator.HttpServices

Convert types to TypeScript http services.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 9,784 10/27/2022
1.2.0 17,069 1/9/2021
1.1.10 951 11/8/2020
1.1.9 3,121 4/10/2020
1.1.8 796 4/2/2020
1.1.7 770 3/5/2020
1.1.6 1,005 1/11/2020
1.1.5 852 10/28/2019
1.1.4 12,754 7/17/2019
1.1.3 672 6/10/2019
1.1.2 867 5/22/2019
1.1.1 1,590 1/24/2019
1.1.0 1,178 1/5/2019
1.0.12 810 12/21/2018
1.0.9 1,271 10/28/2018
1.0.8 1,000 9/18/2018
1.0.7 907 8/31/2018
1.0.6 1,008 8/14/2018
1.0.4 1,450 4/17/2018
1.0.3 1,433 3/30/2018
1.0.2 1,559 3/23/2018
1.0.1 1,325 3/19/2018
1.0.0 1,313 2/3/2018

* Improved generics
* Match models with expressions
* Fixed issue for writing files on non-windows platforms