Interface TypeScriptOptions

interface TypeScriptOptions {
    constraints: Constraints<TypeScriptOptions>;
    defaultPreset?: Partial<{
        class: ClassPresetType<any>;
        enum: EnumPresetType<any>;
        interface: InterfacePresetType<any>;
        type: TypePresetType<any>;
    }>;
    dependencyManager?: TypeScriptDependencyManager | (() => TypeScriptDependencyManager);
    enumType: "enum" | "union";
    indentation?: {
        size: number;
        type: IndentationTypes;
    };
    mapType: "map" | "record" | "indexedObject";
    modelType: "class" | "interface";
    moduleSystem: TypeScriptModuleSystemType;
    presets?: Presets<Partial<{
        class: ClassPresetType<any>;
        enum: EnumPresetType<any>;
        interface: InterfacePresetType<any>;
        type: TypePresetType<any>;
    }>>;
    processorOptions?: ProcessorOptions;
    rawPropertyNames: boolean;
    renderTypes: boolean;
    typeMapping: TypeMapping<TypeScriptOptions, TypeScriptDependencyManager>;
    useJavascriptReservedKeywords: boolean;
}

Hierarchy (view full)

Properties

defaultPreset?: Partial<{
    class: ClassPresetType<any>;
    enum: EnumPresetType<any>;
    interface: InterfacePresetType<any>;
    type: TypePresetType<any>;
}>

Type declaration

  • class: ClassPresetType<any>
  • enum: EnumPresetType<any>
  • interface: InterfacePresetType<any>
  • type: TypePresetType<any>
dependencyManager?: TypeScriptDependencyManager | (() => TypeScriptDependencyManager)

This dependency manager type serves two functions.

  1. It can be used to provide a factory for generate functions
  2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

This depends on context and where it's used.

Type declaration

    • (): TypeScriptDependencyManager
    • Returns TypeScriptDependencyManager

enumType: "enum" | "union"
indentation?: {
    size: number;
    type: IndentationTypes;
}

Type declaration

mapType: "map" | "record" | "indexedObject"
modelType: "class" | "interface"
presets?: Presets<Partial<{
    class: ClassPresetType<any>;
    enum: EnumPresetType<any>;
    interface: InterfacePresetType<any>;
    type: TypePresetType<any>;
}>>
processorOptions?: ProcessorOptions
rawPropertyNames: boolean

Use raw property names instead of constrained ones, where you most likely need to access them with obj["propertyName"] instead of obj.propertyName

renderTypes: boolean
typeMapping: TypeMapping<TypeScriptOptions, TypeScriptDependencyManager>
useJavascriptReservedKeywords: boolean

Use JS reserved keywords so the TS output models can easily be transpiled to JS