SAP/ui5-typescript

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

Closed this issue · 6 comments

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

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

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

akudev commented

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

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

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

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.