ts-gyb / Exports / ParseConfiguration
Parser configuration
• Optional
defaultCustomTags: Record
<string
, unknown
>
Custom tags for code generation in mustache and its default value.
• Optional
dropInterfaceIPrefix: boolean
Drop the I
prefix for TypeScript interfaces.
This only works for types used as method parameters or return value.
• Optional
predefinedTypes: string
[]
Names for pre-defined types.
For example, CodeGen_Int
for mapping for number
to integers.
• Optional
skipInvalidMethods: boolean
Skip the code generation for invalid methods. If false
, the code generation will fail when encounter an unsupported type.
• targets: Record<string, {"source", "exportedInterfaceBases", "tsconfigPath"}>
Describe the target interfaces to be parsed, the key is the name of the target, and the value is an object including the below properties:
• source: string[]
Scoped source file paths. The array of the source file paths for one target. Glob patterns are allowed. If it is a relative path, it will be resolved based on the configuration file path.
For example, ["src/api/IEditor.ts", "src/bridge/*.ts"]
• Optional
exportedInterfaceBases: string
[]
Interface names for detecting exported modules. If defined, only interfaces that extends the specified interfaces will be parsed.
If not defined, interfaces with JSDoc tag @shouldExport true
would be parsed.
For example, set it to ["ExportedInterface"]
, all such interfaces would be exported:
interface SomeInterface extends ExportedInterface {}
• Optional
tsconfigPath: string
Path to the tsconfig.json file. If not defined, the default tsconfig.json file will be used.