The RequestOpts interface was incorrectly using the Headers type from the DOM lib. This produces an error for TypeScript users if they have skipLibCheck set to false and are not including the DOM TypeScript lib:
node_modules/twilio/lib/base/BaseTwilio.d.ts:22:19 - error TS2304: Cannot find name 'Headers'.
22 headers?: Headers;
~~~~~~~
Found 1 error in node_modules/twilio/lib/base/BaseTwilio.d.ts:22
This PR also updates the lib in tsconfig.json to match the target. This makes it so that the DOM TypeScript lib is not included, since by default the DOM lib is included unless specified otherwise. I verified that this change would have caught this issue.
Checklist
[x] I acknowledge that all my contributions will be made under the project's license
[x] I have made a material change to the repo (functionality, testing, spelling, grammar)
Fixes
The
RequestOpts
interface was incorrectly using theHeaders
type from the DOM lib. This produces an error for TypeScript users if they haveskipLibCheck
set tofalse
and are not including the DOM TypeScript lib:This PR also updates the
lib
intsconfig.json
to match the target. This makes it so that the DOM TypeScript lib is not included, since by default the DOM lib is included unless specified otherwise. I verified that this change would have caught this issue.Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.