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

Incorrect TypeScript types for TwiML #538

Closed
dkundel opened this issue Feb 28, 2020 · 3 comments · Fixed by #544 or #545
Closed

Incorrect TypeScript types for TwiML #538

dkundel opened this issue Feb 28, 2020 · 3 comments · Fixed by #544 or #545
Labels
code-generation issue deals with generated code status: help wanted requesting help from the community type: bug bug in the library

Comments

@dkundel
Copy link
Contributor

dkundel commented Feb 28, 2020

Issue Summary

Some of the TwiML methods are missing type signatures with optional attributes. For example twiml.play() supports passing in just a string an argument for the URL but the TypeScript types require to pass in attributes. For others this is working correctly because they have multiple function signatures (for example twiml.say)

Steps to Reproduce

  1. Open VSCode and create a Node.js project with the Twilio helper library installed
  2. Add the code below into a new JavaScript file.
  3. You should see an error highlighting the URL.

Code Snippet

// @ts-check
const twilio = require('twilio');
const twiml = new twilio.twiml.VoiceResponse();
twiml.play('https://demo.twilio.com/docs/classic.mp3');

Exception/Log

Type '"https://demo.twilio.com/docs/classic.mp3"' has no properties in common with type 'PlayAttributes'.ts(2559)

Technical details:

  • twilio-node version: 3.39.5
  • node version: 10.17.0
@childish-sambino childish-sambino added code-generation issue deals with generated code status: help wanted requesting help from the community type: bug bug in the library labels Mar 2, 2020
@childish-sambino
Copy link
Contributor

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@DCtheTall
Copy link
Contributor

@childish-sambino I'd like to contribute a PR, but before I do any work I was wondering if you require contributors to sign a CLA?

@childish-sambino
Copy link
Contributor

childish-sambino commented Mar 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation issue deals with generated code status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
3 participants