JanDeu.TypeScriptModelGenerator 2.0.6
JanDeu.TypeScriptModelGenerator
A NuGet package that dynamically loads a project's DLL from the build folder and generates TypeScript interfaces from the loaded types. Useful for synchronizing C# data models with frontend TypeScript projects.
📦 Installation
Install via NuGet Package Manager:
dotnet nuget add source https://nuget.jandeu.cz/v2/index.json
dotnet add package JanDeu.TypeScriptModelGenerator
🔧 Usage
- Ensure your project DLL is built and accessible in the build output directory.
- Use the package to load the DLL and generate TypeScript interfaces as shown below:
using JanDeu.TypeScriptModelGenerator;
internal class ProcessService(ITypeScriptGenerator generator)
{
public void GenerateTypeScriptFiles()
{
generator.LoadTypes(loader => loader
.Load("MyAssembly.Web")
.GetTypes());
generator.GenerateModels();
}
}
✅ Supported Types
- Classes with public properties
- Enums
- Nullable types
- Generic types (basic support)
⚙️ Configuration
If needed, advanced configuration options can be set using the TypeScriptGeneratorOptions class.
{
"BinPath": ".\\path\\to\\bin",
"DropPath": ".\\path\\to\\typesctript\\project\\models",
"XmlDocumentationFileName": "MyAssembly.Web.xml",
"NullableEnabled": true,
"EnumNames": {
"FileName": "enum-names",
"RelativePath": "enums"
}
}
📝 License
Licensed under the MIT License.
No packages depend on JanDeu.TypeScriptModelGenerator.
.NET 9.0
- JanDeu.TypeScriptModelGenerator.Abstractions (>= 2.0.6)
- Microsoft.Extensions.Logging (>= 8.0.0 && < 10.0.0)
- Microsoft.Extensions.Logging.Console (>= 8.0.0 && < 10.0.0)
- Microsoft.Extensions.Options (>= 8.0.0 && < 10.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 8.0.0 && < 10.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 3.1.0 | 3 | 12/03/2025 |
| 3.0.4 | 2 | 12/02/2025 |
| 3.0.3 | 2 | 12/02/2025 |
| 3.0.2 | 2 | 12/01/2025 |
| 3.0.1 | 2 | 12/01/2025 |
| 3.0.0 | 17 | 11/22/2025 |
| 2.1.3 | 9 | 07/28/2025 |
| 2.1.2 | 7 | 07/28/2025 |
| 2.1.1 | 10 | 06/23/2025 |
| 2.1.0 | 11 | 05/14/2025 |
| 2.0.6 | 8 | 05/14/2025 |
| 2.0.5 | 13 | 04/12/2025 |
| 2.0.4 | 8 | 04/12/2025 |
| 2.0.3 | 8 | 04/12/2025 |
| 2.0.2 | 8 | 04/11/2025 |
| 2.0.1 | 9 | 04/11/2025 |
| 2.0.0 | 8 | 04/09/2025 |
| 1.0.19 | 9 | 04/08/2025 |
| 1.0.18 | 10 | 03/28/2025 |
| 1.0.17 | 9 | 03/26/2025 |
| 1.0.16 | 8 | 03/26/2025 |
| 1.0.15 | 9 | 03/26/2025 |
| 1.0.14 | 8 | 03/26/2025 |
| 1.0.13 | 7 | 03/24/2025 |
| 1.0.12 | 11 | 03/19/2025 |
| 1.0.11 | 8 | 03/19/2025 |
| 1.0.10 | 7 | 03/18/2025 |
| 1.0.9 | 9 | 03/18/2025 |
| 1.0.8 | 8 | 03/18/2025 |
| 1.0.7 | 8 | 03/18/2025 |
| 1.0.6 | 9 | 03/18/2025 |
| 1.0.5 | 8 | 03/18/2025 |
| 1.0.4 | 8 | 03/18/2025 |
| 1.0.3 | 7 | 03/18/2025 |
| 1.0.1 | 8 | 03/18/2025 |
| 1.0.1-alfa1 | 7 | 03/18/2025 |
| 1.0.0 | 7 | 03/18/2025 |