Class TsGenerator
- Namespace
- Alternet.TsTypedefsGenerator.Core
- Assembly
- Alternet.Common.TypeScript.v9.dll
Generates TypeScript definitions form the code model.
public class TsGenerator
- Inheritance
-
TsGenerator
Constructors
- TsGenerator()
Initializes a new instance of the TsGenerator class with the default formatters.
Fields
Properties
- Formaters
Gets collection of formatters for individual TsTypes
- IndentationString
Gets or sets string for the single indentation level.
- TypeConvertors
Tets colletion of type convertors
Methods
- AddReference(string)
Add a typescript reference
- AppendClassDefinition(TsClass, ScriptBuilder, TsMemberGenerationOptions, AppendModuleMode)
Generates class definition and appends it to the output.
- AppendReference(string, ScriptBuilder)
Generates reference to other d.ts file and appends it to the output.
- GetCollectionModuleName(TsCollection, string)
Recursively finds the module name for the underlaying ItemsType of a TsCollection.
- GetFullyQualifiedTypeName(TsType)
Gets fully qualified name of the type
- GetModuleName(TsModule)
Formats a module name
- GetPropertyConstantValue(TsProperty)
Gets property constant value in TypeScript format
- GetPropertyName(TsProperty)
Gets property name in the TypeScript
- GetPropertyType(TsProperty)
Gets property type in the TypeScript
- GetTypeName(TsType, bool)
Gets name of the type in the TypeScript
- GetTypeVisibility(TsClass, string)
Gets whether a type should be marked with "Export" keyword in TypeScript
- RegisterTypeConvertor<TFor>(TypeConvertor)
Registers the converter for the specific Type
- RegisterTypeFormatter(TsTypeFormatter)
Registers the custom formatter for the TsClass type.
- RegisterTypeFormatter<TFor>(TsTypeFormatter)
Registers the formatter for the specific TsType
- SetDocAppender(IDocAppender)
Sets the document appender.
- SetIdentifierFormatter(TsPropertyIdentifierFormatter)
Sets the formatter for class member identifiers.
- SetModuleNameFormatter(TsModuleNameFormatter)
Sets the formatter for module names.
- SetPropertyTypeFormatter(TsPropertyTypeFormatter)
Sets the formatter for class member types.
- SetTypeVisibilityFormatter(TsTypeVisibilityFormatter)
Sets the formatter for class member types.