Skip to content

TypeScript CodeDOM

fonlow edited this page Mar 11, 2019 · 3 revisions

CodeDOM in .NET Framework has come with 3 providers:

  1. CSharpCodeProvider
  2. VBCodeProvider
  3. JScriptCodeProvider

There's not yet TypeScriptCodeProvider in .NET Framework from Microsoft. While JSCriptCodeProvider is good enough for generating javascript codes which you don't need to know the implementation details, TypeScript CodeDOM could provide other benefits:

  1. Strongly typed interfaces and function prototypes for validation during design time and compile time.
  2. Re-use some portion of CodeDOM codes if multiple target OO languages are needed.

TypeScript CodeDOM logo

Supported CodeDOM classes

CodeArgumentReferenceExpression
CodeArrayCreateExpression
CodeArrayIndexerExpression
CodeAssignStatement
CodeBaseReferenceExpression
CodeBinaryOperatorExpression
CodeBinaryOperatorType
CodeCommentStatement
CodeConditionStatement
CodeExpression
CodeExpressionStatement
CodeFieldReferenceExpression
CodeIndexerExpression
CodeIterationStatement
CodeMemberField
CodeMemberProperty
CodeMethodInvokeExpression
CodeMethodReferenceExpression
CodeMethodReturnStatement
CodeNamespace
CodeObjectCreateExpression
CodeParameterDeclarationExpression
CodePrimitiveExpression
CodePropertyReferenceExpression
CodeSnippetExpression
CodeStatement
CodeThisReferenceExpression
CodeThrowExceptionStatement
CodeTryCatchFinallyStatement
CodeTypeDeclaration
CodeTypeOfExpression
CodeTypeReference
CodeTypeReferenceExpression
CodeVariableDeclarationStatement
CodeVariableReferenceExpression

Fonlow.TypeScriptCodeDom.TypeScriptCodeProvider supports major TypeScript language features, good enough for generate data models and strongly typed client API codes. Only a small portion of CodeObject derived classes are not supported.

Hints:

TypeScript CodeDOM is a by-product of the development of WebApiClientGen, thus POCO2TS and WebApiClientGen are the first 2 applications of TypeScript CodeDOM. In the future, there may be a spin-off for developing TypeScript CodeDOM following the evolution of TypeScript.

You can’t perform that action at this time.