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

[@sapui5/types@1.115] Type signatures broken for sap.ui.define #403

Closed BenReim closed 1 year ago

BenReim commented 1 year ago

Starting with version 1.115, the type signatures for sap.ui.define seem to be broken and type errors are raised:

No overload matches this call.

Steps to reproduce:

  1. Clone https://github.com/SAP-samples/ui5-cap-event-app.git
  2. Checkout js-with-typescript-support
  3. npm i -D @sapui5/types@1.115.1
  4. Open Registration.controller.js and observe ts errors
akudev commented 1 year ago

Confirmed. Triggered by this commit and probably caused by a bug in the JSDoc parser or type generator which changes the rest parameter syntax to one single parameter.

Before the change, the type definition said Function, now it says (p1: any) => any but it should say (...p1: any) => any.

Thanks!

akudev commented 1 year ago

Should be fixed for 1.116. Looking into a 115 downport.

akudev commented 1 year ago

That last commit was the downport, so 1.115.2 also gets the fix.

BenReim commented 1 year ago

@akudev With the @sapui5/types@1.117.0 the same issue seems to be back again

petermuessig commented 1 year ago

@codeworrior something to discuss - somehow this fix doesn't seem to be in "still"... 🤔

petermuessig commented 1 year ago

Somehow the change hasn't been merged into the master branch and thus was missing in 1.117.0. The fix will come with 1.118 and there is a planned patch for 1.117 in October. The @types/openui5 from Definitely Typed have been fixed manually.