Fonlow.TypeScriptCodeDomCore
3.1.1
See the version list below for details.
dotnet add package Fonlow.TypeScriptCodeDomCore --version 3.1.1
NuGet\Install-Package Fonlow.TypeScriptCodeDomCore -Version 3.1.1
<PackageReference Include="Fonlow.TypeScriptCodeDomCore" Version="3.1.1" />
<PackageVersion Include="Fonlow.TypeScriptCodeDomCore" Version="3.1.1" />
<PackageReference Include="Fonlow.TypeScriptCodeDomCore" />
paket add Fonlow.TypeScriptCodeDomCore --version 3.1.1
#r "nuget: Fonlow.TypeScriptCodeDomCore, 3.1.1"
#:package Fonlow.TypeScriptCodeDomCore@3.1.1
#addin nuget:?package=Fonlow.TypeScriptCodeDomCore&version=3.1.1
#tool nuget:?package=Fonlow.TypeScriptCodeDomCore&version=3.1.1
CodeDOM in .NET (Framework) has come with 3 providers:
While JSCriptCodeProvider is good enough for generating JavaScript codes for Internet Explorer however IE had been discoutinued. TypeScriptCodeProvider provides extra benefits over a "JavaScript Provider":
- Strongly typed interfaces and function prototypes for validation during design time and compile time.
- Re-use some portion of CodeDOM codes if a code generator toolset like WebApiClientGen and OpenApiClientGen targets multiple OO languages.
- Naturally and inheriently adapt the evolution of the JavaScript standard as long as TypeScript will.
- Live well with TypeScript frameworks like Angular 2+ and Auralia. And with Angular Reactive Forms, runtime validation could become possible, similar to the use cases of using validation attributes to decorate a member property of a .NET class.
What Supported and Not
CodeDOM covers almost every essential C# language features, however, not every features of such coverage is applicable to TypeScript.
GeneratorSupport Enum
bool ICodeGenerator.Supports(GeneratorSupport supports)
{
return (supports & supported) != 0;
}
const GeneratorSupport supported = GeneratorSupport.ArraysOfArrays
| GeneratorSupport.MultidimensionalArrays
| GeneratorSupport.TryCatchStatements
| GeneratorSupport.DeclareValueTypes
| GeneratorSupport.DeclareEnums
| GeneratorSupport.StaticConstructors
| GeneratorSupport.DeclareInterfaces
| GeneratorSupport.DeclareDelegates
| GeneratorSupport.NestedTypes
| GeneratorSupport.MultipleInterfaceMembers
| GeneratorSupport.ComplexExpressions
| GeneratorSupport.GenericTypeReference
| GeneratorSupport.GenericTypeDeclaration
;
Supported CodeDOM Classes
Most supported classes are covered by unit testing, while some are covered by integration testing in some code generator projects, marked as "Indirectly" in the table below.
| Class | Unit Tests |
|---|---|
| CodeArgumentReferenceExpression | TestCodeArgumentReferenceExpression |
| CodeArrayCreateExpression | TestCodeArrayCreateExpression* |
| CodeArrayIndexerExpression | TestCodeArrayIndexerExpression* |
| CodeAssignStatement | TestCodeAssignStatement |
| CodeAttributeDeclaration / CodeAttributeDeclarationCollection | Test*Decorators |
| CodeAttributeArgument / CodeAttributeArgumentCollection | Indirectly |
| CodeBaseReferenceExpression | TestCodeBaseReferenceExpression |
| CodeBinaryOperatorExpression | TestCodeIterationStatement |
| CodeBinaryOperatorType | TestCodeIterationStatement |
| CodeCastExpression | TestCodeCastExpression |
| CodeCatchClause / CodeCatchClauseCollection | TestCodeTryCatchFinallyStatement, TestCodeTryCatchFinallyStatement |
| CodeCommentStatement / CodeCommentStatementCollection | TestCodeCommentStatement* |
| CodeCompileUnit | Indirectly |
| CodeConditionStatement | TestCodeConditionStatement* |
| CodeConstructor | Indirectly |
| CodeDirective / CodeDirectiveCollection | Indirectly with CodeRegionDirective |
| CodeTypeDelegate | TestCodeTypeDelegate |
| CodeExpressionStatement | TestCodeIterationStatement |
| CodeExpression | TestCodeExpression |
| CodeExpressionCollection | Indirectly |
| CodeFieldReferenceExpression | TestCodeFieldReferenceExpression |
| CodeIndexerExpression | TestCodeIterationStatement |
| CodeIterationStatement | TestCodeIterationStatement |
| CodeMemberField | TestCodeTypeDeclarationWithMembers |
| CodeMemberMethod | TestCodeTypeDeclarationWithMethodAndParameterDecorators |
| CodeMemberProperty | TestCodeTypeDeclarationWithPropertyMembers |
| CodeMethodInvokeExpression | TestCodeIterationStatement, TestCodeTryCatchFinallyStatement, TestCodeTryCatchStatement |
| CodeMethodReferenceExpression | TestCodeMethodReferenceExpression, TestCodeMethodReferenceExpressionGeneric, TestCodeIterationStatement |
| CodeMethodReturnStatement | TestCodeMethodReturnStatement |
| CodeNamespace / CodeNamespaceCollection | Indirectly |
| CodeObject | Indirectly in many derived classes |
| CodeObjectCreateExpression | TestCodeObjectCreateExpression* |
| CodeParameterDeclarationExpression / CodeParameterDeclarationExpressionCollection | TestTuple4Callback, TestTupleCallbackSnipet, TestTupleCallbackSnipet, TestCodeParameterDeclarationExpression |
| CodePrimitiveExpression | TestCodeArrayCreateExpressionWithInit, and many |
| CodePropertyReferenceExpression | TestCodePropertyReferenceExpression |
| CodeRegionDirective | TestPersonWithRegions, Test2TypesWithRegions |
| CodeSnippetExpression | TestCodeArrayIndexerExpression, and many |
| CodeSnippetStatement | TestCodeConditionStatement, and many |
| CodeSnippetTypeMember | Indirectly |
| CodeStatement / CodeStatementCollection | TestCodeConditionStatementElse, and many |
| CodeThisReferenceExpression | TestCodePropertyReferenceExpression, and many |
| CodeThrowExceptionStatement | TestCodeThrowExceptionStatement |
| CodeTryCatchFinallyStatement | TestCodeTryCatchFinallyStatement, TestCodeTryFinallyStatement, TestCodeTryCatchStatement |
| CodeTypeDeclaration | TestCodeTypeDeclaration* |
| CodeTypeDeclarationCollection | Indirectly with namespace.Types |
| CodeTypeMember / CodeTypeMemberCollection | Indirectly |
| CodeTypeOfExpression | TestCodeTypeOfExpression |
| CodeTypeParameter / CodeTypeParameterCollection | Indirectly |
| CodeTypeReference / CodeTypeReferenceCollection | TestCodeArrayCreateExpressionWithoutInit, and many |
| CodeTypeReferenceExpression | TestCodeTypeReferenceExpression, TestCodeIterationStatement |
| CodeVariableDeclarationStatement | TestCodeVariableDeclarationStatement* |
| CodeVariableReferenceExpression | TestCodeVariableReferenceExpression, and many |
Hints:
- There are integration tests in PocoToTS, WebApiClientGen and OpenApiClientGen, covering some classes like XxxCollection.
Examples Utilizing TypeScriptProvider
Generated Code Examples
- Client API codes with typed forms and validators generated from Web API
- OpenAPI to Angular 5+ and integration tests for pet.yaml
- OpenAPI to Angular Reactive Typed Forms
- OpenAPI to Aurelia and integration tests for pet.yaml
- OpenAPI to AXIOS and integration tests for pet.yaml
- OpenAPI to Fetch API and integration tests for pet.yaml
- OpenAPI to jQuery and integration tests for pet.yaml
CodeDOM Features Applicable to TypeScript but not Supported in TypeScriptProvider
CodeDOM Features Not Applicable to TypeScript
- CodeAttachEventStatement
- CodeChecksumPragma
- CodeDefaultValueExpression
- CodeDelegateCreateExpression
- CodeDelegateInvokeExpression
- CodeDirectionExpression
- CodeEntryPointMethod
- CodeEventReferenceExpression
- CodeLinePragma
- CodeMemberEvent
- CodeNamespaceImport
- CodeNamespaceImportCollection
- CodePropertySetValueReferenceExpression
- CodeRemoveEventStatement
- CodeSnippetCompileUnit
- CodeTypeConstructor . Alternative.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. 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. |
-
net7.0
- System.CodeDom (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Fonlow.TypeScriptCodeDomCore:
| Package | Downloads |
|---|---|
|
Fonlow.Poco2TsCore
Generate data model interfaces in TypsScript from POCO classes. This has been used in POCO2TS.exe and Strongly Typed Client API for Web API. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Fonlow.TypeScriptCodeDomCore:
| Repository | Stars |
|---|---|
|
zijianhuang/webapiclientgen
Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.0 | 91 | 1/5/2026 |
| 3.5.0 | 337 | 11/22/2025 |
| 3.4.0 | 878 | 11/21/2024 |
| 3.3.0 | 2,399 | 6/23/2024 |
| 3.2.2 | 597 | 6/12/2024 |
| 3.2.1 | 2,199 | 2/27/2024 |
| 3.2.0 | 492 | 2/21/2024 |
| 3.1.1 | 545 | 2/10/2024 |
| 3.1.0 | 343 | 2/9/2024 |
| 3.0.0 | 461 | 2/1/2024 |
| 2.9.2 | 724 | 12/17/2023 |
| 2.9.1 | 411 | 12/16/2023 |
| 2.9.0 | 656 | 12/15/2023 |
| 2.8.1 | 503 | 11/7/2023 |
| 2.8.0 | 582 | 11/7/2023 |
| 2.7.0 | 1,164 | 11/16/2022 |
| 2.6.1 | 6,508 | 6/14/2022 |
| 2.6.0 | 3,496 | 2/5/2022 |
| 2.5.0 | 3,449 | 2/12/2021 |
| 2.3.2 | 3,205 | 6/28/2020 |
| 2.3.1 | 4,377 | 4/16/2020 |
| 2.3.0 | 7,680 | 2/16/2020 |
| 2.2.1 | 730 | 2/16/2020 |
| 2.2.0 | 4,186 | 11/26/2019 |
| 2.1.0 | 2,996 | 11/11/2019 |
| 2.0.1 | 11,933 | 12/6/2018 |
| 2.0.0 | 1,889 | 9/1/2018 |
| 1.9.1 | 2,551 | 8/27/2018 |
| 1.9.0 | 1,983 | 8/9/2018 |
| 1.8.1 | 3,549 | 5/7/2018 |
More CodeDOM classes supported to maximize the intersection of CodeDOM and TypeScript language features.