Table of Contents

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

_docAppender
_generatedClasses
_generatedEnums
_indexerMethodParameterTypeFormatter
_indexerMethodReturnTypeFormatter
_methodFormatter
_methodParameterTypeFormatter
_methodReturnTypeFormatter
_moduleNameFormatter
_propertyFormatter
_propertyTypeFormatter
_references
_typeConvertors
_typeFormatters
_typeVisibilityFormatter

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.

AppendEnumDefinition(TsEnum, ScriptBuilder, TsMemberGenerationOptions, AppendModuleMode)
AppendIndexerInterfaceDefinition(TsClass, ScriptBuilder, TsMemberGenerationOptions, AppendModuleMode)
AppendMethod(ScriptBuilder, IDocAppender, TsMethod, string)
AppendModule(TsModule, ScriptBuilder, TsMemberGenerationOptions, AppendModuleMode)
AppendReference(string, ScriptBuilder)

Generates reference to other d.ts file and appends it to the output.

AppendVariable(TsVariable, ScriptBuilder, TsMemberGenerationOptions)
DefaultIndexerMethodParameterTypeFormatter(TsIndexerMethod, TsMethodParameter, string)
DefaultIndexerMethodReturnTypeFormatter(TsIndexerMethod, string)
DefaultMemberTypeFormatter(TsProperty, string)
DefaultMethodFormatter(TsMethod)
DefaultMethodParameterTypeFormatter(TsMethod, TsMethodParameter, string)
DefaultMethodReturnTypeFormatter(TsMethod, string)
DefaultModuleNameFormatter(TsModule)
DefaultPropertyFormatter(TsProperty)
DefaultTypeVisibilityFormatter(TsClass, string)
Generate(TsModel)
Generate(TsModel, TsMemberGenerationOptions)
GetCollectionModuleName(TsCollection, string)

Recursively finds the module name for the underlaying ItemsType of a TsCollection.

GetDocAppender(bool)
GetFullyQualifiedTypeName(TsType)

Gets fully qualified name of the type

GetIndexerMethodParameterType(TsIndexerMethod, TsMethodParameter)
GetIndexerMethodReturnType(TsIndexerMethod)
GetMethodName(TsMethod)
GetMethodParameterType(TsMethod, TsMethodParameter)
GetMethodReturnType(TsMethod)
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

IsSpecialType(Type)
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(TsMethodIdentifierFormatter)
SetIdentifierFormatter(TsPropertyIdentifierFormatter)

Sets the formatter for class member identifiers.

SetIndexerMethodParameterTypeFormatter(TsIndexerMethodParameterTypeFormatter)
SetIndexerMethodReturnTypeFormatter(TsIndexerMethodReturnTypeFormatter)
SetMethodParameterTypeFormatter(TsMethodParameterTypeFormatter)
SetMethodReturnTypeFormatter(TsMethodReturnTypeFormatter)
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.

Events

ResolveGeneratedAssemblyTypedefFileName