I am currently leveraging Reinforced.Typings for TypeScript model generation from my C# models. My intention is to export the models in a specific format without encapsulation within a module:
export interface IFoobar {
someProperty: string;
someOtherProperty: number;
}
export enum SomeEnum {
someEnumValue = 0,
someOtherEnumValue = 1
}
Through the following configuration approach, I have been able to achieve almost desired output:
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());
}
The generated result lacks the export
keyword as shown below:
interface IFoobar {
someProperty: string;
someOtherProperty: number;
}
enum SomeEnum {
someEnumValue = 0,
someOtherEnumValue = 1
}
Is there a way to accomplish my objective without resorting to attributes and continuing to utilize the fluent API?