[dts-generator] Feature Request: TypeScript Interface Generation for UI5 Runtime Types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 213
- Forks
- 35
- Avg merge
- 37m
- Merged PRs (30d)
- 1
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
interfacesarray 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
.dtsgenrcfiles 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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing IUI5DefineDependencyNames mechanism and the dts-generator entry points. Compare the proposed metadata typing and BaseObject.isA()/isObjectA() cases, including possible .dtsgenrc or JSDoc inputs. Done would require an agreed generation design and comprehensive completion support for the listed UI5 symbols.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100