Skip to content

Commit

Permalink
fix: type declarations don’t depend on internal typings (#129)
Browse files Browse the repository at this point in the history
We prevent typescript from generating declarations that reference the
`@paypal/sdk-constants` package. This package does not provide types,
instead we use our own type declarations in `./src/types.d.ts`. These
declarations are not available to users of the library.

Fixes #125
  • Loading branch information
Thomas Scholtes committed Jul 11, 2021
1 parent e5caf02 commit 76a3b9f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ export * from "./components/PayPalMarks";
export * from "./components/PayPalMessages";
export * from "./ScriptContext";

export { FUNDING } from "@paypal/sdk-constants/dist/module";
import * as constants from "@paypal/sdk-constants/dist/module";

// We do not re-export `FUNDING` from the `sdk-constants` module
// directly because it has no type definitions.
//
// See https://github.com/paypal/react-paypal-js/issues/125
export const FUNDING: Record<string, string> = constants.FUNDING;

0 comments on commit 76a3b9f

Please sign in to comment.