如何让 Reinforced.Typings 生成 "export interface" 或 "export enum" 作为输出,而不将其包装在模块中?

How do I get Reinforced.Typings to generate "export interface" or "export enum" as output, without wrapping it in a module?

我正在使用 Reinforced.Typings 从我的 C# 模型生成 TypeScript 模型。我希望模型导出如下,而不是包装在模块中:

export interface IFoobar {
    someProperty: string;
    someOtherProperty: number;
}

export enum SomeEnum {
   someEnumValue = 0,
   someOtherEnumValue = 1
}

通过使用以下配置方法,我几乎可以按照我想要的方式获得它:

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());
}

这将创建以下输出,但缺少 export 关键字。

interface IFoobar {
    someProperty: string;
    someOtherProperty: number;
}

enum SomeEnum {
   someEnumValue = 0,
   someOtherEnumValue = 1
}

有没有可能实现我想要的?如果可能的话,我想避免属性,并继续使用流利的 API.

在全局配置中尝试 UseModules():

builder.Global(config => config.CamelCaseForProperties()
                               .AutoOptionalProperties()
                               .UseModules());