I'm using Reinforced.Typings to generate TypeScript models from my C# models. I want the models exported as the following, not wrapped in a module:
export interface IFoobar {
someProperty: string;
someOtherProperty: number;
}
export enum SomeEnum {
someEnumValue = 0,
someOtherEnumValue = 1
}
I am able to get it almost the way I want it by using the following configuration method:
public static void Configure(ConfigurationBuilder builder)
{
builder.Global(config => config.CamelCaseForProperties()
.AutoOptionalProperties());
builder.ExportAsInterfaces(new [] { typeof(Foobar) },
config => config.WithPublicProperties()
.AutoI()
.DontIncludeToNamespace());
builder.ExportAsEnums(new [] { typeof(SomeEnum) },
config => config.DontIncludeToNamespace());
}
This will create the following output, but the export
keyword missing.
interface IFoobar {
someProperty: string;
someOtherProperty: number;
}
enum SomeEnum {
someEnumValue = 0,
someOtherEnumValue = 1
}
It is possible to achieve what I want? If possible I want to avoid attributes, and keep using the fluent API.
Try UseModules() in global config:
builder.Global(config => config.CamelCaseForProperties()
.AutoOptionalProperties()
.UseModules());