Copied over from UI5/typescript#629, originally created by @edemuck:
What is the issue and how can we reproduce it?
In the generated typings for sap.m.Menu, the event parameter item of Menu$ItemSelectedEventParameters is typed as IMenuItem.
However, for the itemSelected event, the selected item should be a concrete sap.m.MenuItem.
Current typing
In sap.m.d.ts, the type is defined as:
export interface Menu$ItemSelectedEventParameters {
item?: IMenuItem;
}
Expected typing
The item property should be typed as:
or equivalently sap.m.MenuItem, if that is the preferred style in the generated declarations.
Why this matters
IMenuItem is too generic for consumers of the itemSelected event and makes the event payload less precise than the runtime contract. This can lead to unnecessary type checks or missing access to MenuItem-specific APIs in application code.
Suggested fix
Update the generated typings for Menu$ItemSelectedEventParameters so that item uses MenuItem instead of IMenuItem.
Which OpenUI5 version is your project targeting?
master
Is the issue device- or browser-specific?
No.
Confirmation
Copied over from UI5/typescript#629, originally created by @edemuck:
What is the issue and how can we reproduce it?
In the generated typings for
sap.m.Menu, the event parameteritemofMenu$ItemSelectedEventParametersis typed asIMenuItem.However, for the
itemSelectedevent, the selected item should be a concretesap.m.MenuItem.Current typing
In
sap.m.d.ts, the type is defined as:Expected typing
The item property should be typed as:
or equivalently sap.m.MenuItem, if that is the preferred style in the generated declarations.
Why this matters
IMenuItem is too generic for consumers of the itemSelected event and makes the event payload less precise than the runtime contract. This can lead to unnecessary type checks or missing access to MenuItem-specific APIs in application code.
Suggested fix
Update the generated typings for Menu$ItemSelectedEventParameters so that item uses MenuItem instead of IMenuItem.
Which OpenUI5 version is your project targeting?
master
Is the issue device- or browser-specific?
No.
Confirmation