TypeLITE allows you to control which classes appear in the generated interfaces, customize their name and module or exclude selected properties. It is also possible to use custom formatters that generates code according to your coding conventions.

Classes and properties

[TsClass] attribute

[TsClass] attributes decorates .NET classes and has the following properties:

  • Name: Specifies name of the interface (default value is the class name)
  • Module: Specifies module of the interface (default value is the class namespace)

[TsProperty] attribute

[TsProperty] attributes decorates properties and has the following property:

  • Name: Specifies name of the property (default value is the property name)

[TsIgnore] attribute

[TsIgnore] attributes decorates properties. Property decorated with this attribute won't be included in the generated interfaces.

Custom formatters

TsTypeFormatter

The TsTypeFormatter specifies how are interface names generated from class names. The default implementaion simply uses class name as the interface name, but this behaviour can be overriden with a custom formatter.

Example of a formatter that generates interface names that starts with 'I'

Generated file

TsMemberIdentifierFormatter

The TsMemberIdentifierFormatter specifies how are names of properties in the interface generated from names of properties in the class. The default implementaion simply uses names of properties from class, but this behaviour can be overriden with a custom formatter.

Example of a formatter that generates properties which start with a lowercase letter

Generated file