#type on return, shoould i declare const of interface before returning or there's a better way?

1 messages · Page 1 of 1 (latest)

balmy crane
#

a cast isn't any less safe in this case

#

just because it is a cast doesn't mean TS will allow any cast to be made

#

but imo you should modify the return type of the function returning the promise, if you have the ability to

#

or put the type on the result of the promise