-
Notifications
You must be signed in to change notification settings - Fork 30
Description
TypeScript Interface Generation for UI5 Runtime Types
We (as in the UI5 framework runtime team, incl. @codeworrior) would like to request support for generating TypeScript interfaces that contain all runtime UI5 class and interface names to improve code completion.
Motivation
Currently, there's an existing IUI5DefineDependencyNames
mechanism used for APIs like sap.ui.require|define
. We'd like to extend this concept to provide comprehensive TypeScript support for other parts of UI5 application and control develop.
Proposed Features
We see two different variants for better code completion based on a full automatically generated list of all available symbols (is that the correct word...?):
1. UI5 Metadata Typing
- All places where interface or class names can be used
- i.e. the
interfaces
array and the aggregation types
- i.e. the
- Additionally we think support for data type names would be great, particularly for enums used in control properties
2. Enhanced BaseObject Methods
On top of the UI5 metadata, the runtime offers APIs for type inference:
BaseObject#isA()
- Provide type completion for class names and interfacesBaseObject.isObjectA()
- Provide type completion for class names and interfaces
Additional info
For the UI5 framework itself, we're (again the framework team ;)) are exploring how we can define the above mentioned APIs and places declaratively. Though we have no further information on that yet, we have discussed to provide a form of marking via either
.dtsgenrc
files in the resp. libraries, or- JSDoc annotations
Expected Behavior
Developers should be able to get full code completion support when working with UI5 class names, interface names, metadata properties and so on. We envision something similar to the existing support for dependency names in sap.ui.require|define
calls (refer to IUI5DefineDependencyNames
mentioned above).