Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a type declaration file #1850

Closed
jamiehewitt15 opened this issue Sep 18, 2024 · 2 comments · Fixed by #1862
Closed

Add a type declaration file #1850

jamiehewitt15 opened this issue Sep 18, 2024 · 2 comments · Fixed by #1862
Labels

Comments

@jamiehewitt15
Copy link
Member

If you try and use ocean.js from another typescript project in strict mode, you will get this error:

Could not find a declaration file for module '@oceanprotocol/lib'. '/home/jamie/Desktop/ocean/vscode-extension/node_modules/@oceanprotocol/lib/dist/lib.js' implicitly has an 'any' type.

Try `npm i --save-dev @types/oceanprotocol__lib` if it exists or add a new declaration (.d.ts) file containing `declare module '@oceanprotocol/lib';`ts(7016)

We don't have a type declaration file so there there is no easy way round this for developers.

@jamiehewitt15 jamiehewitt15 added the Type: Enhancement New feature or request label Sep 18, 2024
@alexcos20
Copy link
Member

current version:

image

old version:

image

But not sure that src/types/... is the correct path

@jamiehewitt15
Copy link
Member Author

jamiehewitt15 commented Oct 16, 2024

yeah, I think it might be an error in the location and also how it's referenced in package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants