-
Notifications
You must be signed in to change notification settings - Fork 882
Export Decimal as a type in the Stripe namespace #2634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
15aeeda
4cea170
1bc6a77
5f512a4
d0c70bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2453,6 +2453,8 @@ export declare namespace Stripe { | |
| Emptyable, | ||
| }; | ||
|
|
||
| export type Decimal = import('./shared.js').Decimal; | ||
|
|
||
| export {StripeContext as StripeContextType}; | ||
| export {StripeRawError}; | ||
| export import ErrorType = _Error; | ||
|
|
@@ -2461,4 +2463,5 @@ export declare namespace Stripe { | |
|
|
||
| Stripe.initialize(new NodePlatformFunctions()); | ||
|
|
||
| export {Decimal} from './shared.js'; | ||
|
Comment on lines
2456
to
+2466
|
||
| export default Stripe; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is meant to enable
Stripe.Decimalin type positions for CJS consumers, but there doesn’t appear to be a TypeScript compile-time test that exercises the CJSrequire('stripe')typing path (e.g.,const Stripe = require('stripe'); const d: Stripe.Decimal = Stripe.Decimal.from('1.0');). Adding a type test would prevent regressions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no existing CJS TypeScript test project — only a plain JS one. Adding a CJS TS test project is tracked separately. The ESM type tests cover Stripe.Decimal as a type annotation.