lachrist / posix-socket

POSIX Socket API
MIT License
1 stars 1 forks source link

Error while importing posix-socket in typescript module #3

Open adityaGadde opened 2 years ago

adityaGadde commented 2 years ago

I've installed using npm i posix-socket

I'm facing an issue to install the @types

npm i --save-dev @types/posix-socket

still facing issue that types is not found something like below

Error: src/app/socketio.service.ts:7:24 - error TS7016: Could not find a declaration file for module 'posix-socket'. '/home/.../node_modules/posix-socket/lib/main.js' implicitly has an 'any' type. Trynpm i --save-dev @types/posix-socketif it exists or add a new declaration (.d.ts) file containingdeclare module 'posix-socket';`

7 import * as posix from 'posix-socket'; `

adityaGadde commented 2 years ago

Help me in solving this

lachrist commented 2 years ago

Hello, the error message is pretty telling. This module does not have typescripts type declarations. You can either manually define the types of the exported functions, or thread them as any. Adding typescript types might be worthwhile to do but I don't have the time at the moment. Feel free to submit a pullrequest though.