Closed jgeurts closed 1 year ago
We've also just found this on a new project when attempting to use twilio@4.7.1
- seems like the twilio client type definition isn't exported, or is exported incorrectly, compared to twilio@3.84.1
.
Seems like it either:
needs to be fixed at the typing itself or needs a new example on how to define typescript types properly for the new way of instantiating the twilio client if that has drastically changed.
We also found this to be an issue on upgrading one of our projects. I've submitted #914 which should fix this.
Hi @jgeurts! Thank you for bringing this to our attention and thank you @aaronhuggins-carewell for opening a PR to solve this bug! Our team will review #914 and we will update this issue with the expected release date for the next version of the twilio-node library that will include a fix.
@JenniferMah Thanks! I'll run Prettier in the AM and push. Should otherwise be ready for review.
@JenniferMah Corrected style formatting. Everything appears to pass locally running npm run ci
. I had only run jscs
and test
before.
Thanks again, @aaronhuggins-carewell for opening a PR (#914) to solve this issue. I've gone ahead and merged your changes. These changes will be included in our next version release of the library, expected on February 22nd.
when doing
import { Twilio } from "twilio/lib"
const twilio_client = new Twilio( <SID>, <AUTH> )
the type of twilio_client is any in version 4 where as in version 3 it used to be of the correct type. Please do let me know if I am doing something wrong here
Issue Summary
With v3.84, we were able to pull in the type of the Twilio client and reference it in our application:
However, now with v4.7, the same code not longer works, with the following message:
However,
typeof Twilio
does not work and is not what we're looking for. We are looking to reference an instance of the Twilio class. Any advice on how to do this with v4?