TypeScriptModelsGenerator 1.0.1
See the version list below for details.
dotnet add package TypeScriptModelsGenerator --version 1.0.1
NuGet\Install-Package TypeScriptModelsGenerator -Version 1.0.1
<PackageReference Include="TypeScriptModelsGenerator" Version="1.0.1" />
paket add TypeScriptModelsGenerator --version 1.0.1
#r "nuget: TypeScriptModelsGenerator, 1.0.1"
// Install TypeScriptModelsGenerator as a Cake Addin
#addin nuget:?package=TypeScriptModelsGenerator&version=1.0.1
// Install TypeScriptModelsGenerator as a Cake Tool
#tool nuget:?package=TypeScriptModelsGenerator&version=1.0.1
Support for system types (also as nullable)
string
int
bool
byte[]
long
DateTime
Guid
decimal
double
Support for collections (T as generic, system type or custom type)
ICollection<T>
IEnumerable<T>
IList<T>
List<T>
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 usage
var config = new TypeScriptModelsGeneratorConfig();
config.Assembly = typeof(MyApp).Assembly;
config.Destination = new DirectoryInfo('path-to-my-typescript-models');
//match all C# models with postfix Model (what should be generated)
config.ModelsMatchRules.Add(new MatchRule("Model$"));
//also possible from nameSpace
//config.NameSpaceMatchRules.Add(new MatchRule("Models"));
//match all C# models with postfix Model and Replace Model with empty string
config.ModelsMatchAndReplaceRules.Add(new MatchAndReplaceRule("Model$", string.Empty));
//Replace part of the c# model NameSpace to avoid extra 'my-app' and 'models' folder
config.NameSpaceMatchAndReplaceRules.AddRange(
new []
{
new MatchAndReplaceRule("MyApp", string.Empty)
new MatchAndReplaceRule("Models", string.Empty)
});
//Execute and your models are generated
TypeScriptModelGenerator.Execute(config);
Note: MatchRules are used with OR MatchAndReplaceRules are used with AND
Product | Versions 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.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. |
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection (>= 2.0.0)
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 | 5,029 | 10/27/2022 |
1.2.0 | 13,754 | 1/9/2021 |
1.1.10 | 802 | 11/8/2020 |
1.1.9 | 2,706 | 4/10/2020 |
1.1.8 | 664 | 4/2/2020 |
1.1.7 | 654 | 3/5/2020 |
1.1.6 | 881 | 1/11/2020 |
1.1.5 | 711 | 10/28/2019 |
1.1.4 | 12,610 | 7/17/2019 |
1.1.3 | 559 | 6/10/2019 |
1.1.2 | 747 | 5/22/2019 |
1.1.1 | 1,392 | 1/24/2019 |
1.1.0 | 1,054 | 1/5/2019 |
1.0.12 | 680 | 12/21/2018 |
1.0.9 | 1,136 | 10/28/2018 |
1.0.8 | 858 | 9/18/2018 |
1.0.7 | 758 | 8/31/2018 |
1.0.6 | 858 | 8/14/2018 |
1.0.4 | 1,134 | 4/17/2018 |
1.0.3 | 1,109 | 3/30/2018 |
1.0.2 | 1,230 | 3/23/2018 |
1.0.1 | 995 | 3/19/2018 |
1.0.0 | 980 | 2/3/2018 |
Fixed an issue where System types where not converted when used as generic type for collections