Nyaran / testlink-xmlrpc

NodeJS module to connect to TestLink using XML-RPC API
https://www.npmjs.com/package/testlink-xmlrpc
GNU General Public License v3.0
7 stars 4 forks source link

Cannot find module './types' or its corresponding type declarations. #207

Closed jmichiel closed 1 year ago

jmichiel commented 1 year ago

I'm trying to use 2.x in an electron app, but I get this error: Cannot find module './types' or its corresponding type declarations. on the first line of testlink.d.ts: import * as ApiTypes from './types';

It seems the types folder is not copied when installing it with npm?

Nyaran commented 1 year ago

Hi,

try adding following line to your tsconfig.json file:

"skipLibCheck": true
jmichiel commented 1 year ago

That helped getting the project to properly build. However, I still didn't get any type hints from any of the ApiTypes interfaces. I worked around it by declaring them in a local typings.d.ts file, though

Nyaran commented 1 year ago

Yes, there is still a bug, I will try to solve it ASAP.

Nyaran commented 1 year ago

Update to testlink-xmlrpc@2.0.4, typings should be fixed now.

jmichiel commented 1 year ago

I can confirm this is fixed now! Thx!

There is still a bit of a mess with IDs being strings in replies, but having to be numbers in requests, but perhaps that stems from the Testlink XML-RPC spec itself.

I would have liked the ApiTypes to be exported as well, but you can get around that by using things like type TestLinkProject = Awaited<ReturnType<TestLink['getProjects']>>[number];