-
Notifications
You must be signed in to change notification settings - Fork 5
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
Typescript Types #14
Comments
You are a god. Will try out and report back. |
I'd love to see this merged! |
@statico You need to make a It should just work then when you import. Don't need to do casting. If it doesn't work, you will have to fiddle with your |
Thanks for helping. It's definitely finding the types, yet that error still occurs. I'm not sure why the types declare both a namespace and export a function with the same name. We're on TypeScript 4.4.2 BTW. |
I'll take a look when I get home. Maybe we can set up some time to pair.
On Wed, Oct 27, 2021 at 7:46 PM Ian Langworth ☠ ***@***.***> wrote:
Thanks for helping. It's definitely finding the types, yet that error
still occurs. I'm not sure why the types declare both a namespace and
export a function with the same name. We're on TypeScript 4.4.2 BTW.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABM2FGRYKZATAOD34NHBZUDUJCFMFANCNFSM4OABGMAA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Izak
|
Thanks. I can't even get this module to work, and I'm guessing it's TypeScript.
Gets me:
|
Ahh. You got to import * as Numbers.
On Wed, Oct 27, 2021 at 8:16 PM Ian Langworth ☠ ***@***.***> wrote:
Thanks. I can't even get this module to work, and I'm guessing it's
TypeScript.
import Numbers from ***@***.***/numbers"
const numbers = new Numbers.Client(accountId, username, password)
const listAvailableDids = async (pattern?: string | null) => {
try {
const response = await numbers.AvailableNumbers.listAsync({
tollFreeVanity: pattern ? pattern.replace(/\W/g, "") : "",
quantity: "5",
})
...
Gets me:
TypeError: Cannot read property 'listAsync' of undefined
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABM2FGR3R3UBXJGVA3SYJ63UJCI5VANCNFSM4OABGMAA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Izak
|
import * as BandwidthNumbers from '@bandwidth/numbers'
import * as functions from 'firebase-functions'
import { Config } from 'types/functionsTypes'
BandwidthNumbers.Client.globalOptions.accountId = (
functions.config() as Config
).bandwidth['account-id']
BandwidthNumbers.Client.globalOptions.userName = (
functions.config() as Config
).bandwidth['user-name']
BandwidthNumbers.Client.globalOptions.password = (
functions.config() as Config
).bandwidth.password
export const BandwidthNumbersClient = BandwidthNumbers |
Actually, that seems to work! I can inspect the thrown Error object and see some XML with a detailed error. I'll take it from here. Thanks for your help! Looking forward to a native TypeScript package :) |
My types are for v1.5 of the package as well. They are probably a little out of date. |
Thank you @izakfilmalter! It would be great to see this get adopted especially as other Bandwidth SDKs like |
Thanks @izakfilmalter. Would love to see this merged too! |
Here is my initial attempt at some really bad ts types for the lib. Still missing a lot of things, and crossing my eyes between the docs and the lib probably caused some errors.
The following still don't have types:
Update 7/1/2021
Subscription
The text was updated successfully, but these errors were encountered: