If my project includes @types/braintree-web and I
import braintree from 'braintree-web'
const client = braintree.client
then client is properly typed as braintree.Client.
However, I want to use lean imports like:
import braintreeClient from 'braintree-web/client/index.js'
and I want braintreeClient to also be typed as braintree.Client. Instead, I get TypeScript warnings:
Could not find a declaration file for 'braintree-web/client/index.js'
Was thinking I would add this to my global.d.ts...
/// <reference types="braintree-web" />
declare module 'braintree-web/client/index.js' {
}
Is there a way where I can reuse the typings that were already defined for 'braintree' rather than recreate them for each lean import?
Or this may work as well