SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
202 stars 28 forks source link

Missing definitions | Unavailable types #388

Closed AnilBairi closed 1 year ago

AnilBairi commented 1 year ago

Hi Colleagues,

We are re-writing our inner source project from plain UI5 to UI5 with Typescript. Currently, we have identified few UI5 type definitions are unavailable or not too specific.

Could you please have a look into below examples and suggest/comment?

AppLifeCycle.getCurrentApplication(): object | undefined

currentApplication method returns object or undefined which is quite generic and this makes it difficult to access further properties/properties of currentApplication like 'applicationType', 'getInfo' etc.

UserInfo.getUser()

getUser() method is unavailable under UserInfo but we could access getUser method and use it in runtime. but we have a missing type problem here. Any idea why getUser method is missing here and any alternative sugession for this?. please note that we are fetching the UserInfo information using shellContainer something like ... this.getShellContainer().getServiceAsync('UserInfo')

AppConfiguration.getMetadata()

there is no method called getMetadata in AppConfiguration{}. we are interested in reading the title from metadata something like this:

const metadata = AppConfiguration.getMetadata(); 
const tile = metadata.title

Thanks, Anil

AnilBairi commented 1 year ago

Closing this now

akudev commented 1 year ago

(Closed because the same issue is in the API docu, which means that the problem is not in the tools in this repo, but in the original Fiori Launchpad sources, which are part of SAPUI5. Reported there.)