SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
201 stars 28 forks source link

[ts-interface-generator] Generate fully qualified module names in interface for seamless use with tsc declarations #431

Open BenReim opened 6 months ago

BenReim commented 6 months ago

Description: The current behavior of the @ui5/ts-interface-generator package generates interface declarations with relative module names. This leads to issues when attempting to use these interfaces alongside declarations generated by tsc, as relative paths cannot be resolved in such scenarios.

Desired Behavior: It would be desired that the generated interfaces can be used and placed along with declarations generated by tsc (perhaps by using fully qualified module names)

Note: The tooling task ui5-transpile-task already transforms the generated interfaces accordingly, but it would be nice if one can use the native tsc cli for the type generation as well.

A workflow to generate declarations for a TS-based ui5 library project could be:

  1. Generate declarations for TS files
    tsc --emitDeclarationOnly --declarationMap --outFile index.d.ts
  2. Copy over the generated interfaces (*.gen.d.ts) in a post build step (tsc output generation does not consider d.ts)