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

[ts-interface-generator] Generate event parameter for events on custom controls #399

Closed HappyHepo closed 1 year ago

HappyHepo commented 1 year ago

Describe the bug Events of custom controls do not generate parameter types and the corresponding event methods have only the generic event in the signature of the handlers.

Expected behavior The generator generates event parameter types similar to the UI5 events from 1.115.

akudev commented 1 year ago

Indeed. Thanks for reminding!

akudev commented 1 year ago

ts-interface-generator 0.7.0 was just released with this feature.

It is not that trivial, e.g. when the version of the UI5 types is lower than 1.115.0, then the class sap.ui.base.Event does not support generics - which are used in the generated interface. So a small extension of the Event class is also generated in this case where generics are added.

Please try and give feedback.

HappyHepo commented 1 year ago

Works as expected with both library and application using @types/openui5>=1.115. Thanks for the quick fix!

marianfoo commented 1 year ago

Works for me too with a control and component. Thanks Andreas!