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

missing types for Subscription.on('connected') #3319

Closed
Velenir opened this issue Jan 20, 2020 · 1 comment · Fixed by #3326
Closed

missing types for Subscription.on('connected') #3319

Velenir opened this issue Jan 20, 2020 · 1 comment · Fixed by #3326
Labels
1.x 1.0 related issues Types Incorrect or missing types

Comments

@Velenir
Copy link
Contributor

Velenir commented Jan 20, 2020

Expected behavior

web3.eth.subscribe(<any event type>).on('connected', console.log)

would be properly typed.

Actual behavior

Typescript error No overload matches this call

Steps to reproduce the behavior

1 .Input web3.eth.subscribe('newBlockHeaders').on('connected', console.log)
2. compile with Typescript
3. see error

Versions

Node -- v12.14.1
web3 -- v1.2.4

I think, it should be enough to add on(type: 'connected', handler: (subscriptionId: string) => void): Subscription<T>; to Subscription type declaration.

@nivida
Copy link
Contributor

nivida commented Jan 20, 2020

@Velenir Thanks for opening this issue! We will improve the related types asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Types Incorrect or missing types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants