#Shiroyasha-get-type

1 messages · Page 1 of 1 (latest)

glass lake
#

There's a folder called types in the Stripe Node module that shows the types of all the Stripe objects. Is that what you're looking for?

It's usually under node-modules/stripe/types/<your API version>

tranquil spoke
#

here for example, i must add any to balance

#

but i want that node recognize the stripe lib and mark the response as it should be (here for example the balance object)

#

(and yes i have the type folder in my lib)

glass lake
#

I'm not sure I understand. What do you mean "mark as it should be"?

tranquil spoke
#

sorry for not being clear

#

for example i use firebase too, when i use firebase lib i can see things like this :

#

i think it s possible with stripe lib too but i dont know how

#

i dont have to put an ugly "any" in front the return object. node know that i use firebase lib so he know that this function return a querySnapshot

glass lake
#

Ah I see. I don't think that's possible with our current library but let me double check with folks internally

tranquil spoke
#

Ok thanks for your help

velvet path
#

Hello, let me see if I can help

#

Okay I don't really understand your question and the context. We have Typescript definitions for the whole library @tranquil spoke. What exactly is confusing you/blocking you? We have https://github.com/stripe/stripe-node#usage-with-typescript covering some of it but assume prior knowledge of Typescript mostly

tranquil spoke
#

maybe because i use it in the "old" way

velvet path
#

For example if I hover over retrieve, here's what I see:

tranquil spoke
#

if i import it with es6 syntax i ll get all type i think

velvet path
#

ah yeah, I'm not really familiar with TS myself, I can just make do with basic examples

tranquil spoke
velvet path
#

which version of stripe-node are you using?

tranquil spoke
#

let me check

#

8.222.0

velvet path
#

okay so you're on the most recent, so it feels like you're not loading/including stripe-node properly. Unfortunately I'm not really familiar with TS beyond having it "just work" for me like i does for Firebase for you

tranquil spoke
#

yeah no problem it from my implementation so, i ll check my syntax

#

thanks again for helping us, have a good night/day !