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

Missing type for `sap.m.PluginBase` #367

Closed dfenerski closed 2 years ago

dfenerski commented 2 years ago

Although this class is not yet public, we have built custom plugin which uses the PluginBase.setConfigs() method. There are no type definitions for it in the npm package. What is recommended in this case? Should a call be made using global signature i.e sap.m.PluginBase.setConfigs(), somehow trick the import converter, or something else?

akudev commented 2 years ago

@dfenerski Non-public classes/methods are intentionally not in the type definitions: this way one can avoid writing code that can easily break on updates (because private methods/classes can change at any time). If you still want to use this class, you could e.g. define a type for it on your side (i.e. create a *.d.ts file defining the class' interface).