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 import typescript declaration for this module #172

Open
stardustdev opened this issue Jan 4, 2021 · 5 comments
Open

How to import typescript declaration for this module #172

stardustdev opened this issue Jan 4, 2021 · 5 comments
Assignees

Comments

@stardustdev
Copy link

No description provided.

@stardustdev
Copy link
Author

I'd like to use this module in react native typescript project.
But I can't find declaration file for this module.
How can I use this in typescript?

@mparadina
Copy link
Contributor

Hi @stardustdev

Apologies for the delay in our response.

After you've initialized our script for React-Native, you can try to add the following:
npm install -D typescript @types/jest @types/react @types/react-native @types/react-test-renderer

You can also change the files from .js to .ts, and the project should run properly.

Let me know if this helped.

Regards,
Milan

@stardustdev
Copy link
Author

This cli is for adding typescript to js RN project
npm install -D typescript @types/jest @types/react @types/react-native @types/react-test-renderer

But my question is how to use BlinkID/blinkid-react-native in .tsx?

@juraskrlec
Copy link
Member

Hi @stardustdev

We do not have typings for our react-native plugin. You have two options for now:

  1. You could write the typing information for blinkid-react-native by yourself and save it into blinkid-react-native.d.ts file.
  2. Disable the warning inside your tsconfig.json by setting "noImplicitAny": false - Reference : https://www.typescriptlang.org/docs/handbook/compiler-options.html

Do you have any sample app so we could have a look, and what did you try to use our plugin with typescript project?

@AbijahKaj
Copy link

Hey @stardustdev !
I had the same issue, and made this gist https://gist.github.com/AbijahKaj/42d848cb9a9cdb6fb0804baf82da7f3d it has all the types (I hope so).

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

No branches or pull requests

4 participants