Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fluent module name change

Tags:

typelite

The name can be changed like shown in the tutorial:

TypeScript.Definitions()
    .ForLoadedAssemblies()
    .WithFormatter((type, f) => "I" + ((TypeLite.TsModels.TsClass)type).Name)

How can the module name be changed using fluent formatter?

like image 734
Mantzas Avatar asked Dec 26 '22 12:12

Mantzas


1 Answers

As of TypeLite version 1.4.0 the following works fine to change module name:

<# var ts = TypeScript.Definitions()
    .WithModuleNameFormatter((module) => "my.module.name");#>

Or you can also play with what's already set as module name to have more control like this:

<# var ts = TypeScript.Definitions()
    .WithModuleNameFormatter((module) => "I" + ((TypeLite.TsModels.TsModule)module).Name);#>
like image 61
mentat Avatar answered Jun 22 '23 02:06

mentat