TsGenerator class
Generates TypeScript definitions form the code model.
Namespace: TypeLite
Properties
| Name | Description | |
|---|---|---|
| Formaters | Gets collection of formatters for individual TsTypes | |
| IndentationString | Gets or sets string for the single indentation level. |
Methods
| Name | Description | |
|---|---|---|
| AddReference | Add a typescript reference | |
| Generate | Generates TypeScript definitions for properties and enums in the model. | |
| Generate | Generates TypeScript definitions for classes and/or enums in the model. | |
| RegisterIdentifierFormatter | Registers a formatter for class member identifiers. | |
| RegisterMemberTypeFormatter | Registers a formatter for class member types. | |
| RegisterModuleNameFormatter | Registers a formatter for module names. | |
| RegisterTypeConvertor<TFor> | Registers the converter for the specific Type | |
| RegisterTypeFormatter | Registers the custom formatter for the TsClass type. | |
| RegisterTypeFormatter<TFor> | Registers the formatter for the specific TsType | |
| RegisterTypeVisibilityFormatter | Registers a formatter for class member types. |
TsGenerator.Formaters property
Gets collection of formatters for individual TsTypes
Syntax
TsGenerator.IndentationString property
Gets or sets string for the single indentation level.
Syntax
TsGenerator.AddReference method
Add a typescript reference
Syntax
Parameters
-
stringreference - Name of d.ts file used as typescript reference
TsGenerator.Generate method
Generates TypeScript definitions for properties and enums in the model.
Syntax
Parameters
-
TsModelmodel - The code model with classes to generate definitions for.
Returns
-
string - TypeScript definitions for classes in the model.
TsGenerator.Generate method
Generates TypeScript definitions for classes and/or enums in the model.
Syntax
Parameters
-
TsModelmodel - The code model with classes to generate definitions for.
-
TsGeneratorOutputgeneratorOutput - The type of definitions to generate
Returns
-
string - TypeScript definitions for classes and/or enums in the model..
TsGenerator.RegisterIdentifierFormatter method
Registers a formatter for class member identifiers.
Syntax
Parameters
-
TsMemberIdentifierFormatterformatter - The formatter to register.
TsGenerator.RegisterMemberTypeFormatter method
Registers a formatter for class member types.
Syntax
Parameters
-
TsMemberTypeFormatterformatter - The formatter to register.
TsGenerator.RegisterModuleNameFormatter method
Registers a formatter for module names.
Syntax
Parameters
-
TsModuleNameFormatterformatter - The formatter to register.
TsGenerator.RegisterTypeConvertor<TFor> method
Registers the converter for the specific Type
Syntax
Parameters
-
TypeConvertorconvertor - The converter to register
Remarks
If a converter for the type is already registered, it is overwritten with the new value.TsGenerator.RegisterTypeFormatter method
Registers the custom formatter for the TsClass type.
Syntax
Parameters
-
TsTypeFormatterformatter - The formatter to register.
TsGenerator.RegisterTypeFormatter<TFor> method
Registers the formatter for the specific TsType
Syntax
Parameters
-
TsTypeFormatterformatter - The formatter to register
Remarks
If a formatter for the type is already registered, it is overwritten with the new value.TsGenerator.RegisterTypeVisibilityFormatter method
Registers a formatter for class member types.
Syntax
Parameters
-
TsTypeVisibilityFormatterformatter - The formatter to register.