Skip to content

[dts-generator] Feature Request: TypeScript Interface Generation for UI5 Runtime Types #524

@Thodd

Description

@Thodd

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
  • 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 interfaces
  • BaseObject.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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestts-interface-generatorRelated to the ts-interface-generator sub-package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions