SAP / ui5-typescript

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

ts-types-esm: Core.getLibraryResourceBundle missing overrides #343

Open nlunets opened 2 years ago

nlunets commented 2 years ago

In Core.getLibraryResourceBundle you now define

getLibraryResourceBundle = function(sLibraryName, sLocale, bAsync)

While looking at the code you actually should have three overrides

getLibraryResourceBundle = function(sLibraryName, sLocale, bAsync)
getLibraryResourceBundle = function(sLibraryName, bAsync)
getLibraryResourceBundle = function(bAsync) 

The return Promise is also of type any when it should be Promise

nlunets commented 2 years ago

by the way it can be even cooler if you were to do all variant properly

getLibraryResourceBundle(sLibraryName: string, bAsync: true): Promise<ResourceBundle>;
getLibraryResourceBundle(sLibraryName: string, bAsync: false): ResourceBundle;  

getLibraryResourceBundle(sLibraryName: string): ResourceBundle;
...
codeworrior commented 2 years ago

We're currently working on the missing overrides for signatures like the one of getLibraryResourceBundle. But we won't manage to do the"cooler" thing yet, documentation doesn't provide enough information to extract the 'real' variants.

nlunets commented 2 years ago

Having already the proper override would be good :)