cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Using SAP hana-client promises module with TypeScript

07-23-2025 7:19 PM
RafaelLawisch Explorer
1007 views 3 comments Go to solution
Subscribe

Hi all,

I've been using @Pa_Vi/hana-client Promises module for many years. A new project is being written on TypeScript, and importing "@sap/hana-client/extension/Promise.js" leads to message "Could not find a declaration file for module '@sap/hana-client/extension/Promise.js'. '(...)/node_modules/@sap/hana-client/extension/Promise.js' implicitly has an 'any' type.
If the '@sap/hana-client' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '@sap/hana-client/extension/Promise.js';". This makes type inferrence impossible on the downstream, so we need to manually type each variable/function declaration to not be of type any.
As @Pa_Vi/hana-client has a .d.ts file, I would expect the Promises module to be typed, but then it would probably be imported from the root of the module (as usual with any other lib), instead of being imported directly from the specific .js file.


With that context, I have 2 questions:
1) How/where can I raise an issue to the appropriate SAP team to have this correctly typed (and, even better, importable from the root)?
2) Is there a way we can "type the Promises module ourselves" (via type coercion from the types made available by @Pa_Vi/hana-client or something in that sense), so that types can be inferred as expected?

 

Thank you in advance,

Lawisch

Accepted Solutions (1)

Accepted Solutions (1)

IanMcCurdy
Associate
Associate

Hi Lawisch,

I'm on the team responsible for the hana-client Node.js driver and adding the type declarations for Promise.js is currently on our backlog. Unfortunately I can't commit to a specific date when this will be available, but I'll look into raising the priority on our end.

Thanks,

Ian

RafaelLawisch
Explorer
0 Likes
Thanks a lot, Ian!

Answers (0)