SAP / ui5-typescript

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

ESM-style types in legacy-style types #392

Closed yishn closed 1 year ago

yishn commented 1 year ago

Describe the bug

When using legacy-style types @sapui5/ts-types, I can see ESM-style types in the code, e.g. in sap.ui.core.d.ts there are a bunch of declare module ....

Expected behavior

I expect to see namespaces instead of modules.

codeworrior commented 1 year ago

This is not a bug. There are APIs in UI5 that are not exposed via a global name. These APIs are declared in module syntax and can only be accessed via imports in TypeScript. In the JavaScript world of UI5, this corresponds to APIs that can only be accessed via an AMD dependency and not via a global name.

Examples: