braintree / braintree-web-drop-in

Braintree Drop-in for the web
MIT License
200 stars 126 forks source link

@types/braintree-web-drop-in/index.d.ts:259:11 - error TS2403: Subsequent variable declarations must have the same type. Variable 'braintree' must be of type #790

Closed JustFly1984 closed 2 years ago

JustFly1984 commented 2 years ago

I'm using braintree-web-drop-in-react with typescript, and it misses the types for braintree-web-drop-in package. After installing @types/braintree-web-drop-in I got new error:

node_modules/@types/braintree-web-drop-in/index.d.ts:259:11 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'braintree' must be of type 'typeof import("/Users/user/projects/project/node_modules/@types/braintree-web/index")', but here has type '{ dropin: { create(options: Options, callback: (error: object | null, dropin: Dropin | undefined) => void): void; create(options: Options): Promise<Dropin>; }; }'.

259     const braintree: {
jplukarski commented 2 years ago

Hi @JustFly1984 , thanks for writing in. We do not maintain those type definitions. The next major version of our core SDK and the Drop-in will be written in typescript so that this third-party type definition is no longer needed.

In the meantime, you can either supply your own type definitions, or ignore typing concerns for the Braintree SDK.

See issue #725