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

Incomplete type definitions based on documentation? #3

Open
achou11 opened this issue Dec 15, 2021 · 0 comments
Open

Incomplete type definitions based on documentation? #3

achou11 opened this issue Dec 15, 2021 · 0 comments

Comments

@achou11
Copy link

achou11 commented Dec 15, 2021

According to the documentation here:

In the React Native layer:

The nodejs.channel object inherits from React Native's EventEmitter class, with emit removed and post and send added.

In the Node layer:

The rn_bridge.channel object inherits from Node's EventEmitter class, with emit removed and post and send added.

I'm assuming these statements are still true. If they are, then the type defs in index.d.ts are a little incomplete based on my understanding of how this plugin works. A notable example is addListener on the React Native layer, which – in React Native 0.66.3 – should return a React Native EventSubscription. At the moment, it's typed as:

addListener: (event: string, callback: ChannelCallback, context?: any) => void;

but the return type should instead be the subscription.

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

1 participant