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

How to write ts declaration file #6

Closed
GuiYuanLu opened this issue Jan 13, 2022 · 3 comments
Closed

How to write ts declaration file #6

GuiYuanLu opened this issue Jan 13, 2022 · 3 comments

Comments

@GuiYuanLu
Copy link

I want to use 'url-js' in my React+TypeScript project, but I get an error that the declaration file for module 'url-js' cannot be found. "/Users/admin/Desktop/react_demo_project/ee-openapi-h5/node_modules/url-js/dist/url.js" implicitly has type "any".
Try using npm i --save-dev @types/url-js (if it exists), or add a new declaration (.d.ts) file containing declare module 'url-js'; ts(7016) .

So how to write the declaration file of ts?

@duzun
Copy link
Owner

duzun commented Jan 13, 2022

I have to create the definitions file and add it to the repo.

@duzun
Copy link
Owner

duzun commented Jan 14, 2022

I have added .d.ts files for v2.0.0.

Please, let me know if it works for you.

Thanks.

@duzun
Copy link
Owner

duzun commented Jan 15, 2022

Here is my attempts at .d.ts 294dbb64

@duzun duzun closed this as completed Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants