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

Need module support typescript #121

Closed
technicalopt opened this issue Jul 12, 2019 · 6 comments
Closed

Need module support typescript #121

technicalopt opened this issue Jul 12, 2019 · 6 comments

Comments

@technicalopt
Copy link

technicalopt commented Jul 12, 2019

Hi pro,

As the entry, can you make it support typescript format?

thank you!

@technicalopt technicalopt changed the title Need module support typescript Need module support typescript & onMessage not work on newest version Jul 12, 2019
@technicalopt technicalopt changed the title Need module support typescript & onMessage not work on newest version Need module support typescript Jul 12, 2019
@iou90
Copy link
Owner

iou90 commented Jul 12, 2019

Does index.d.ts not work properly?

@msspshaw
Copy link

Just to point out - in your package, you aren't assigning your index.d.ts file as the type property.
A sample from one of my projects looks like so:
"types": "lib/index.d.ts" where my .d.t.s is generated into a lib folder. In your case it would just be "types": "index.d.ts".

In addition, however, in your package.json you have this snippet.
"files": [
"index.js",
"autoHeightWebView"
]

This is a whitelist for what is included when you npm publish, which means that you aren't including the index.d.ts in your npm package.

@technicalopt
Copy link
Author

@msspshaw , Thank you!

Yes, I created a component with index.js as your suggestion.
But other way to register types, the 'index.d.ts' file not be created in node_module/react-native-autoheight-webview

image

My version is 1.1.4

@technicalopt
Copy link
Author

Also, as @msspshaw said, @iou90 please add "types": "index.d.ts", in your package.json

@iou90
Copy link
Owner

iou90 commented Jul 30, 2019

Should be fixed in version 1.1.6

@technicalopt
Copy link
Author

@iou90 , It work perfectly on RN 0.60

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

3 participants