ui5-typescript icon indicating copy to clipboard operation
ui5-typescript copied to clipboard

ts-types-esm: Core.getLibraryResourceBundle missing overrides

Open nlunets opened this issue 3 years ago • 3 comments

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<ResourceBundle>

nlunets avatar Mar 08 '22 12:03 nlunets

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;
...

nlunets avatar Mar 08 '22 12:03 nlunets

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.

codeworrior avatar Mar 08 '22 13:03 codeworrior

Having already the proper override would be good :)

nlunets avatar Mar 08 '22 13:03 nlunets