@stripe/extensibility-sdk 0.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/LICENSE.md +19 -0
  2. package/dist/config-values/generate.cjs +262 -0
  3. package/dist/config-values/generate.d.ts +38 -0
  4. package/dist/config-values/generate.d.ts.map +1 -0
  5. package/dist/config-values/generate.js +232 -0
  6. package/dist/config-values/parse.d.ts +87 -0
  7. package/dist/config-values/parse.d.ts.map +1 -0
  8. package/dist/extensibility-sdk-alpha.d.ts +542 -0
  9. package/dist/extensibility-sdk-beta.d.ts +542 -0
  10. package/dist/extensibility-sdk-config-values-alpha.d.ts +27 -0
  11. package/dist/extensibility-sdk-config-values-beta.d.ts +27 -0
  12. package/dist/extensibility-sdk-config-values-internal.d.ts +118 -0
  13. package/dist/extensibility-sdk-config-values-public.d.ts +27 -0
  14. package/dist/extensibility-sdk-extensions-alpha.d.ts +1592 -0
  15. package/dist/extensibility-sdk-extensions-beta.d.ts +1592 -0
  16. package/dist/extensibility-sdk-extensions-internal.d.ts +1655 -0
  17. package/dist/extensibility-sdk-extensions-public.d.ts +1592 -0
  18. package/dist/extensibility-sdk-internal-alpha.d.ts +9 -0
  19. package/dist/extensibility-sdk-internal-beta.d.ts +9 -0
  20. package/dist/extensibility-sdk-internal-internal.d.ts +23 -0
  21. package/dist/extensibility-sdk-internal-public.d.ts +9 -0
  22. package/dist/extensibility-sdk-internal.d.ts +915 -0
  23. package/dist/extensibility-sdk-jsonschema-alpha.d.ts +3 -0
  24. package/dist/extensibility-sdk-jsonschema-beta.d.ts +3 -0
  25. package/dist/extensibility-sdk-jsonschema-internal.d.ts +15 -0
  26. package/dist/extensibility-sdk-jsonschema-public.d.ts +3 -0
  27. package/dist/extensibility-sdk-public.d.ts +542 -0
  28. package/dist/extensibility-sdk-stdlib-alpha.d.ts +531 -0
  29. package/dist/extensibility-sdk-stdlib-beta.d.ts +531 -0
  30. package/dist/extensibility-sdk-stdlib-internal.d.ts +904 -0
  31. package/dist/extensibility-sdk-stdlib-public.d.ts +531 -0
  32. package/dist/extensions/billing/bill/discount_calculation.d.ts +226 -0
  33. package/dist/extensions/billing/bill/discount_calculation.d.ts.map +1 -0
  34. package/dist/extensions/billing/bill/index.d.ts +2 -0
  35. package/dist/extensions/billing/bill/index.d.ts.map +1 -0
  36. package/dist/extensions/billing/customer_balance_application.d.ts +82 -0
  37. package/dist/extensions/billing/customer_balance_application.d.ts.map +1 -0
  38. package/dist/extensions/billing/index.d.ts +8 -0
  39. package/dist/extensions/billing/index.d.ts.map +1 -0
  40. package/dist/extensions/billing/invoice_collection_setting.d.ts +117 -0
  41. package/dist/extensions/billing/invoice_collection_setting.d.ts.map +1 -0
  42. package/dist/extensions/billing/prorations.d.ts +222 -0
  43. package/dist/extensions/billing/prorations.d.ts.map +1 -0
  44. package/dist/extensions/billing/recurring_billing_item_handling.d.ts +326 -0
  45. package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -0
  46. package/dist/extensions/billing/types.d.ts +33 -0
  47. package/dist/extensions/billing/types.d.ts.map +1 -0
  48. package/dist/extensions/context.d.ts +9 -0
  49. package/dist/extensions/context.d.ts.map +1 -0
  50. package/dist/extensions/core/index.d.ts +3 -0
  51. package/dist/extensions/core/index.d.ts.map +1 -0
  52. package/dist/extensions/core/workflows/custom_action.d.ts +142 -0
  53. package/dist/extensions/core/workflows/custom_action.d.ts.map +1 -0
  54. package/dist/extensions/core/workflows/index.d.ts +2 -0
  55. package/dist/extensions/core/workflows/index.d.ts.map +1 -0
  56. package/dist/extensions/extend/index.d.ts +3 -0
  57. package/dist/extensions/extend/index.d.ts.map +1 -0
  58. package/dist/extensions/extend/workflows/custom_action.d.ts +142 -0
  59. package/dist/extensions/extend/workflows/custom_action.d.ts.map +1 -0
  60. package/dist/extensions/extend/workflows/index.d.ts +2 -0
  61. package/dist/extensions/extend/workflows/index.d.ts.map +1 -0
  62. package/dist/extensions/index.cjs +2356 -0
  63. package/dist/extensions/index.d.ts +9 -0
  64. package/dist/extensions/index.d.ts.map +1 -0
  65. package/dist/extensions/index.js +2435 -0
  66. package/dist/extensions/registry.d.ts +19 -0
  67. package/dist/extensions/registry.d.ts.map +1 -0
  68. package/dist/extensions/types.d.ts +10 -0
  69. package/dist/extensions/types.d.ts.map +1 -0
  70. package/dist/index.cjs +1519 -0
  71. package/dist/index.d.ts +12 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +1460 -0
  74. package/dist/internal.cjs +156 -0
  75. package/dist/internal.d.ts +3 -0
  76. package/dist/internal.d.ts.map +1 -0
  77. package/dist/internal.js +128 -0
  78. package/dist/jsonschema.cjs +18 -0
  79. package/dist/jsonschema.d.ts +2 -0
  80. package/dist/jsonschema.d.ts.map +1 -0
  81. package/dist/jsonschema.js +0 -0
  82. package/dist/stdlib/brand.d.ts +27 -0
  83. package/dist/stdlib/brand.d.ts.map +1 -0
  84. package/dist/stdlib/decimal.d.ts +324 -0
  85. package/dist/stdlib/decimal.d.ts.map +1 -0
  86. package/dist/stdlib/extension-method.d.ts +27 -0
  87. package/dist/stdlib/extension-method.d.ts.map +1 -0
  88. package/dist/stdlib/generated.d.ts +15 -0
  89. package/dist/stdlib/generated.d.ts.map +1 -0
  90. package/dist/stdlib/index.cjs +1519 -0
  91. package/dist/stdlib/index.d.ts +18 -0
  92. package/dist/stdlib/index.d.ts.map +1 -0
  93. package/dist/stdlib/index.js +1460 -0
  94. package/dist/stdlib/refs.d.ts +62 -0
  95. package/dist/stdlib/refs.d.ts.map +1 -0
  96. package/dist/stdlib/scalars.d.ts +141 -0
  97. package/dist/stdlib/scalars.d.ts.map +1 -0
  98. package/dist/stdlib/transform-strategies.d.ts +74 -0
  99. package/dist/stdlib/transform-strategies.d.ts.map +1 -0
  100. package/dist/stdlib/transforms.d.ts +97 -0
  101. package/dist/stdlib/transforms.d.ts.map +1 -0
  102. package/dist/stdlib/type-utils.d.ts +9 -0
  103. package/dist/stdlib/type-utils.d.ts.map +1 -0
  104. package/dist/stdlib/types.d.ts +281 -0
  105. package/dist/stdlib/types.d.ts.map +1 -0
  106. package/dist/stdlib/utils.d.ts +7 -0
  107. package/dist/stdlib/utils.d.ts.map +1 -0
  108. package/dist/tsconfig.build.tsbuildinfo +1 -0
  109. package/package.json +111 -0
  110. package/tslibs/5.9.3/lib.es2022.egress.d.ts +4328 -0
  111. package/tslibs/5.9.3/lib.es2022.restricted.d.ts +4067 -0
  112. package/tslibs/lib.egress.globals.d.ts +112 -0
  113. package/tslibs/lib.restricted.globals.d.ts +1 -0
@@ -0,0 +1,542 @@
1
+ /**
2
+ * `@stripe/extensibility-sdk`
3
+ *
4
+ * Lean runtime for Stripe script extensions.
5
+ *
6
+ * - Standard library utilities (Decimal, Integer, Ref, etc.)
7
+ * - Extension interfaces via `./extensions` subpath
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ import { __integerBrand } from '@formspec/core';
13
+
14
+ /**
15
+ * Opaque brand symbol used as a property key in SDK branded types.
16
+ *
17
+ * @remarks
18
+ * You do not need to use this directly — it is already embedded in
19
+ * branded values returned by factory functions like {@link (Integer:type)}.create().
20
+ * The `unique symbol` key makes the brand non-enumerable and impossible
21
+ * to forge without access to this symbol.
22
+ *
23
+ * @public
24
+ */
25
+ export declare const __brand: unique symbol;
26
+
27
+ /* Excluded from this release type: __decimalBrand */
28
+
29
+ /* Excluded from this release type: __positiveIntegerBrand */
30
+
31
+ /**
32
+ * Opaque type-tag symbol used by SDK scalar types to carry Stripe type metadata.
33
+ *
34
+ * @remarks
35
+ * You do not need to use this directly — it is already embedded in
36
+ * branded values returned by factory functions like {@link (Integer:type)}.create().
37
+ *
38
+ * @public
39
+ */
40
+ export declare const __stripeType: unique symbol;
41
+
42
+ /* Excluded from this release type: _apply */
43
+
44
+ /* Excluded from this release type: _applyConfig */
45
+
46
+ /* Excluded from this release type: _applyIncoming */
47
+
48
+ /* Excluded from this release type: _applyOutgoing */
49
+
50
+ /* Excluded from this release type: _ApplyStrategy */
51
+
52
+ /** The type of the opaque brand symbol used as a property key in SDK branded types. @public */
53
+ export declare type BrandSymbol = typeof __brand;
54
+
55
+ /* Excluded from this release type: _configAppContextFromContext */
56
+
57
+ /* Excluded from this release type: _ConfigApplicationContext */
58
+
59
+ /* Excluded from this release type: _ConfigEnum */
60
+
61
+ /** @public */
62
+ export declare type Currency = 'aed' | 'afn' | 'all' | 'amd' | 'ang' | 'aoa' | 'apt' | 'arb' | 'ars' | 'aud' | 'avax' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bhd' | 'bif' | 'bmd' | 'bnb' | 'bnd' | 'bob' | 'bov' | 'brl' | 'bsd' | 'btc' | 'btn' | 'buidl' | 'bwp' | 'byn' | 'byr' | 'bzd' | 'cad' | 'cdf' | 'celo' | 'che' | 'chf' | 'chw' | 'clf' | 'clp' | 'cny' | 'cop' | 'cou' | 'crc' | 'cuc' | 'cup' | 'cve' | 'czk' | 'dai' | 'djf' | 'dkk' | 'dop' | 'dzd' | 'eek' | 'egp' | 'ern' | 'etb' | 'eth' | 'eur' | 'eurc' | 'fjd' | 'fkp' | 'frxusd' | 'gbp' | 'gel' | 'ghc' | 'ghs' | 'gip' | 'gmd' | 'gnf' | 'gtq' | 'gyd' | 'hkd' | 'hnl' | 'hrk' | 'htg' | 'huf' | 'hype' | 'idr' | 'ils' | 'inr' | 'iqd' | 'irr' | 'isk' | 'jmd' | 'jod' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'kpw' | 'krw' | 'kwd' | 'kyd' | 'kzt' | 'lak' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'ltl' | 'lvl' | 'lyd' | 'lzd' | 'm' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mru' | 'mur' | 'mvr' | 'mwk' | 'mxn' | 'mxv' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nio' | 'nok' | 'npr' | 'nzd' | 'omr' | 'pab' | 'pen' | 'pgk' | 'php' | 'pkr' | 'pln' | 'pol' | 'pyg' | 'pyusd' | 'qar' | 'rd' | 're' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sdg' | 'sek' | 'sgd' | 'shp' | 'sle' | 'sll' | 'sol' | 'sos' | 'srd' | 'ssp' | 'std' | 'stn' | 'sui' | 'svc' | 'syp' | 'szl' | 'thb' | 'tjs' | 'tmt' | 'tnd' | 'top' | 'trx' | 'try' | 'ttd' | 'twd' | 'tzs' | 'uah' | 'ugx' | 'usd' | 'usdb' | 'usdc' | 'usdg' | 'usdp' | 'usdt' | 'usn' | 'ustb' | 'uyi' | 'uyu' | 'uzs' | 'vef' | 'ves' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'xcg' | 'xeur' | 'xlm' | 'xof' | 'xpf' | 'xpl' | 'xusd' | 'yer' | 'zar' | 'zmk' | 'zmw' | 'zwd' | 'zwg' | 'zwl';
63
+
64
+ /**
65
+ * Arbitrary-precision decimal type for billing calculations.
66
+ *
67
+ * @remarks
68
+ * `Decimal` values are created by the {@link (Decimal:variable) | Decimal companion object}
69
+ * and store values as `coefficient × 10^exponent` using `BigInt`. They avoid
70
+ * every common binary floating-point pitfall — `Decimal.from('0.1').add(Decimal.from('0.2'))`
71
+ * is exactly `0.3`.
72
+ *
73
+ * Instances are immutable (frozen) and all arithmetic returns a new
74
+ * `Decimal`. The public type carries two brand symbols so the type system
75
+ * prevents accidental assignment from plain `number`, `string`, or
76
+ * `bigint`.
77
+ *
78
+ * Create values via the companion object:
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk/stdlib';
83
+ *
84
+ * const price = Decimal.from('19.99');
85
+ * const tax = price.mul(Decimal.from('0.0825'));
86
+ * const total = price.add(tax);
87
+ *
88
+ * console.log(total.toFixed(2, 'half-up')); // "21.64"
89
+ * console.log(JSON.stringify({ total })); // '{"total":"21.639175"}'
90
+ * console.log(total.toFixed(2, 'half-even')); // "21.64"
91
+ * ```
92
+ *
93
+ * @public
94
+ */
95
+ export declare interface Decimal {
96
+ /* Excluded from this release type: [__brand] */
97
+ /* Excluded from this release type: [__decimalBrand] */
98
+ /* Excluded from this release type: [__stripeType] */
99
+ /**
100
+ * Return the sum of this value and `other`.
101
+ * @public
102
+ */
103
+ add(other: Decimal): Decimal;
104
+ /**
105
+ * Return the difference of this value and `other`.
106
+ * @public
107
+ */
108
+ sub(other: Decimal): Decimal;
109
+ /**
110
+ * Return the product of this value and `other`.
111
+ * @public
112
+ */
113
+ mul(other: Decimal): Decimal;
114
+ /**
115
+ * Return the quotient of this value divided by `other`.
116
+ * @public
117
+ */
118
+ div(other: Decimal, precision: number, direction: RoundDirection): Decimal;
119
+ /**
120
+ * Three-way comparison: returns `-1`, `0`, or `1`.
121
+ * @public
122
+ */
123
+ cmp(other: Decimal): -1 | 0 | 1;
124
+ /**
125
+ * Return `true` if this value is numerically equal to `other`.
126
+ * @public
127
+ */
128
+ eq(other: Decimal): boolean;
129
+ /**
130
+ * Return `true` if this value is strictly less than `other`.
131
+ * @public
132
+ */
133
+ lt(other: Decimal): boolean;
134
+ /**
135
+ * Return `true` if this value is less than or equal to `other`.
136
+ * @public
137
+ */
138
+ lte(other: Decimal): boolean;
139
+ /**
140
+ * Return `true` if this value is strictly greater than `other`.
141
+ * @public
142
+ */
143
+ gt(other: Decimal): boolean;
144
+ /**
145
+ * Return `true` if this value is greater than or equal to `other`.
146
+ * @public
147
+ */
148
+ gte(other: Decimal): boolean;
149
+ /**
150
+ * Return `true` if this value is exactly zero.
151
+ * @public
152
+ */
153
+ isZero(): boolean;
154
+ /**
155
+ * Return `true` if this value is strictly less than zero.
156
+ * @public
157
+ */
158
+ isNegative(): boolean;
159
+ /**
160
+ * Return `true` if this value is strictly greater than zero.
161
+ * @public
162
+ */
163
+ isPositive(): boolean;
164
+ /**
165
+ * Return the additive inverse of this value.
166
+ * @public
167
+ */
168
+ neg(): Decimal;
169
+ /**
170
+ * Return the absolute value.
171
+ * @public
172
+ */
173
+ abs(): Decimal;
174
+ /**
175
+ * Round this value to the specified precision.
176
+ * @public
177
+ */
178
+ round(direction: RoundDirection, options: DecimalRoundingOptions | keyof typeof DecimalRoundingPresets): Decimal;
179
+ /**
180
+ * Return the canonical string representation.
181
+ * @public
182
+ */
183
+ toString(): string;
184
+ /**
185
+ * Return the JSON-serializable string representation.
186
+ * @public
187
+ */
188
+ toJSON(): string;
189
+ /**
190
+ * Convert to a JavaScript `number` (lossy).
191
+ * @public
192
+ */
193
+ toNumber(): number;
194
+ /**
195
+ * Format as a fixed-point string with exactly `decimalPlaces` digits.
196
+ * @public
197
+ */
198
+ toFixed(decimalPlaces: number, direction: RoundDirection): string;
199
+ /**
200
+ * Rejects implicit coercion; explicit `String(d)` and template literals still work.
201
+ * @public
202
+ */
203
+ [Symbol.toPrimitive](hint: 'default' | 'number' | 'string'): string;
204
+ /**
205
+ * Returns the string representation; invoked by the JavaScript engine as a fallback coercion path.
206
+ * @public
207
+ */
208
+ valueOf(): string;
209
+ }
210
+
211
+ /**
212
+ * Companion object for creating `Decimal` instances.
213
+ *
214
+ * @public
215
+ */
216
+ export declare const Decimal: {
217
+ from(value: bigint | number | string): Decimal;
218
+ zero: Decimal;
219
+ };
220
+
221
+ /**
222
+ * Precision specification for `Decimal.round()`.
223
+ *
224
+ * @remarks
225
+ * Two modes are supported:
226
+ * - `"decimal-places"` — round to a fixed number of digits after the decimal point.
227
+ * - `"significant-figures"` — round to a fixed number of significant digits.
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * // Round to 2 decimal places
232
+ * amount.round('half-even', { mode: 'decimal-places', value: 2 });
233
+ *
234
+ * // Round to 4 significant figures
235
+ * amount.round('half-up', { mode: 'significant-figures', value: 4 });
236
+ * ```
237
+ *
238
+ * @public
239
+ */
240
+ export declare interface DecimalRoundingOptions {
241
+ /** Whether to count digits from the decimal point (`"decimal-places"`) or from the most significant digit (`"significant-figures"`). */
242
+ mode: 'decimal-places' | 'significant-figures';
243
+ /**
244
+ * The number of digits to retain. Interpreted as decimal places when
245
+ * `mode` is `"decimal-places"`, or as significant figures when `mode`
246
+ * is `"significant-figures"`.
247
+ * @public
248
+ */
249
+ value: number;
250
+ }
251
+
252
+ /**
253
+ * Built-in rounding presets keyed by semantic name.
254
+ *
255
+ * @remarks
256
+ * Stripe defines the full set of supported preset names accepted by
257
+ * `Decimal.round()`.
258
+ *
259
+ * | Preset | Equivalent DecimalRoundingOptions |
260
+ * | ------------------- | ----------------------------------------------------- |
261
+ * | `"ubb-usage-count"` | `{ mode: "significant-figures", value: 15 }` |
262
+ * | `"v1-api"` | `{ mode: "decimal-places", value: 12 }` |
263
+ *
264
+ * @public
265
+ */
266
+ export declare const DecimalRoundingPresets: Readonly<{
267
+ 'ubb-usage-count': Readonly<{
268
+ mode: "significant-figures";
269
+ value: number;
270
+ }>;
271
+ 'v1-api': Readonly<{
272
+ mode: "decimal-places";
273
+ value: number;
274
+ }>;
275
+ }>;
276
+
277
+ /**
278
+ * The IEEE 754 decimal128 coefficient size (34 digits) — the recommended
279
+ * precision for `Decimal.div()` when full precision is desired.
280
+ *
281
+ * @remarks
282
+ * Pass this as the `precision` argument to `div()` when you want the
283
+ * maximum available precision. Division requires explicit precision —
284
+ * no invisible defaults in financial code.
285
+ *
286
+ * @example
287
+ * ```ts
288
+ * // Use the full decimal128 precision explicitly
289
+ * a.div(b, DEFAULT_DIV_PRECISION, 'half-even');
290
+ * ```
291
+ *
292
+ * @public
293
+ */
294
+ export declare const DEFAULT_DIV_PRECISION = 34;
295
+
296
+ /* Excluded from this release type: _EnumSpec */
297
+
298
+ /**
299
+ * Extracts the string literal type of the `object` property from T.
300
+ *
301
+ * @public
302
+ */
303
+ export declare type ExtractObjectTag<T> = T extends { readonly object: infer O } ? O extends string ? O : never : never;
304
+
305
+ /* Excluded from this release type: _FieldDescriptor */
306
+
307
+ /* Excluded from this release type: _FieldTransformer */
308
+
309
+ /* Excluded from this release type: _identity */
310
+
311
+ /** A branded integer — a `number` guaranteed to satisfy `Number.isInteger`. @public */
312
+ export declare type Integer = {
313
+ readonly [__integerBrand]: true;
314
+ readonly [__stripeType]: 'int';
315
+ } & number;
316
+
317
+ /** Factory and type guard for {@link (Integer:type)} branded values. @public */
318
+ export declare const Integer: {
319
+ from: (value: number, rounding: IntegerRoundDirection) => Integer;
320
+ is: (value: number) => value is Integer;
321
+ };
322
+
323
+ /**
324
+ * Rounding directions for coercing a number to an integer.
325
+ *
326
+ * A focused subset of {@link https://standards.ieee.org/ieee/754/6210/ | IEEE 754-2019} §4.3:
327
+ *
328
+ * | Direction | Behavior | Examples (→ integer) |
329
+ * | -------------- | ---------------------------- | ------------------------------ |
330
+ * | `'ceil'` | Toward +∞ | 1.1→2, -1.1→-1 |
331
+ * | `'floor'` | Toward -∞ | 1.9→1, -1.1→-2 |
332
+ * | `'round-down'` | Toward zero (truncate) | 1.9→1, -1.9→-1 |
333
+ * | `'round-up'` | Away from zero | 1.1→2, -1.1→-2 |
334
+ * | `'half-up'` | Nearest; ties away from zero | 0.5→1, -0.5→-1, 1.4→1 |
335
+ *
336
+ * @public
337
+ */
338
+ export declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
339
+
340
+ /**
341
+ * Check whether a value is a `Decimal` instance.
342
+ *
343
+ * @remarks
344
+ * Use this instead of `instanceof` — the underlying class is not
345
+ * publicly exported, so `instanceof` checks are not available to
346
+ * consumers.
347
+ *
348
+ * @example
349
+ * ```ts
350
+ * if (isDecimal(value)) {
351
+ * value.add(Decimal.from('1')); // value is Decimal
352
+ * }
353
+ * ```
354
+ *
355
+ * @public
356
+ */
357
+ export declare function isDecimal(value: unknown): value is Decimal;
358
+
359
+ /* Excluded from this release type: _isPromiseLike */
360
+
361
+ /* Excluded from this release type: _JsonWireToType */
362
+
363
+ /* Excluded from this release type: _JsonWireToTypeStrategy */
364
+
365
+ /**
366
+ * Represents a monetary value with amount and currency.
367
+ * @format monetary-amount
368
+ * @public
369
+ */
370
+ export declare interface MonetaryAmount {
371
+ /** The numerical value. */
372
+ amount: Decimal;
373
+ /** The currency code. */
374
+ currency: Currency;
375
+ }
376
+
377
+ /* Excluded from this release type: _OneofBranchDescriptor */
378
+
379
+ /* Excluded from this release type: _OneofFieldDescriptor */
380
+
381
+ /**
382
+ * A branded non-negative integer — a `number` guaranteed to be an integer ≥ 0.
383
+ *
384
+ * This is a subtype of {@link (Integer:type)}: every non-negative integer is an
385
+ * integer, so `PositiveInteger` values are assignable to `Integer` contexts.
386
+ * The reverse is not true — an `Integer` cannot be assigned where a
387
+ * `PositiveInteger` is expected without going through the `PositiveInteger.is()`
388
+ * type guard or `PositiveInteger.from()` factory.
389
+ *
390
+ * @remarks
391
+ * Despite the name, this type includes zero (`>= 0`, not `> 0`).
392
+ * The schema-level constraint `@minimum 0` should be added to fields
393
+ * typed as `PositiveInteger` to ensure the non-negativity invariant
394
+ * is enforced at validation time.
395
+ *
396
+ * @public
397
+ */
398
+ export declare type PositiveInteger = {
399
+ readonly [__integerBrand]: true;
400
+ readonly [__positiveIntegerBrand]: true;
401
+ readonly [__stripeType]: 'int';
402
+ } & number;
403
+
404
+ /** Factory and type guard for {@link (PositiveInteger:type)} branded values. @public */
405
+ export declare const PositiveInteger: {
406
+ from: (value: number, rounding: IntegerRoundDirection) => PositiveInteger;
407
+ is: (value: number) => value is PositiveInteger;
408
+ };
409
+
410
+ /* Excluded from this release type: _ProtoEnum */
411
+
412
+ /* Excluded from this release type: _ProtoWireToType */
413
+
414
+ /* Excluded from this release type: _ProtoWireToTypeStrategy */
415
+
416
+ /**
417
+ * Object reference — a typed pointer to another API resource.
418
+ *
419
+ * @example
420
+ * ```
421
+ * { type: "v2.core.customer", id: "cus_1234" }
422
+ * ```
423
+ *
424
+ * The type parameter T must have a readonly `object` property
425
+ * whose string literal type becomes the `type` field's value.
426
+ *
427
+ * @discriminator :type T
428
+ *
429
+ * @public
430
+ */
431
+ export declare type Ref<T extends {
432
+ readonly object: string;
433
+ } = {
434
+ readonly object: string;
435
+ }> = {
436
+ id: string;
437
+ type: ExtractObjectTag<T>;
438
+ } & {
439
+ readonly __type?: T;
440
+ readonly [__brand]: 'Ref';
441
+ readonly [__stripeType]: 'string';
442
+ };
443
+
444
+ /** Factory for creating {@link (Ref:type)} values from an object with `object` and `id` fields. @public */
445
+ export declare const Ref: { create: <T extends { readonly object: string }>(step: { readonly id: string } & T) => Ref<T> };
446
+
447
+ /* Excluded from this release type: _required */
448
+
449
+ /**
450
+ * Rounding direction for Decimal operations.
451
+ *
452
+ * @remarks
453
+ * Seven modes corresponding to
454
+ * {@link https://standards.ieee.org/ieee/754/6210/ | IEEE 754-2019} §4.3
455
+ * rounding-direction attributes:
456
+ *
457
+ * | Direction | IEEE 754 name | Behavior | Examples (→ integer) |
458
+ * | -------------- | ----------------------- | --------------------------------- | ------------------------------------- |
459
+ * | `'ceil'` | `roundTowardPositive` | Toward +∞ | 1.1→2, -1.1→-1 |
460
+ * | `'floor'` | `roundTowardNegative` | Toward -∞ | 1.9→1, -1.1→-2 |
461
+ * | `'round-down'` | `roundTowardZero` | Toward zero (truncate) | 1.9→1, -1.9→-1 |
462
+ * | `'round-up'` | — | Away from zero | 1.1→2, -1.1→-2 |
463
+ * | `'half-up'` | `roundTiesToAway` | Nearest; ties away from zero | 0.5→1, -0.5→-1, 1.4→1 |
464
+ * | `'half-down'` | — | Nearest; ties toward zero | 0.5→0, -0.5→0, 1.6→2 |
465
+ * | `'half-even'` | `roundTiesToEven` | Nearest; ties to even (banker's) | 0.5→0, 1.5→2, 2.5→2, 3.5→4 |
466
+ *
467
+ * @public
468
+ */
469
+ export declare type RoundDirection = 'ceil' | 'floor' | 'half-down' | 'half-even' | 'half-up' | 'round-down' | 'round-up';
470
+
471
+ /* Excluded from this release type: _ShapeDescriptor */
472
+
473
+ /** A branded string representing a street address. @public */
474
+ export declare type StreetAddress = {
475
+ readonly [__brand]: 'StreetAddress';
476
+ readonly [__stripeType]: 'string';
477
+ } & string;
478
+
479
+ /** Factory for creating {@link (StreetAddress:type)} branded values. @public */
480
+ export declare const StreetAddress: { create: (address: string) => StreetAddress };
481
+
482
+ /** The type of the opaque Stripe type-tag symbol used in SDK scalar types. @public */
483
+ export declare type StripeTypeSymbol = typeof __stripeType;
484
+
485
+ /** A branded string representing an ISO 8601 datetime. @public */
486
+ export declare type Timestamp = {
487
+ readonly [__brand]: 'Timestamp';
488
+ readonly [__stripeType]: 'string';
489
+ } & string;
490
+
491
+ /** Factory for creating {@link (Timestamp:type)} branded values. @public */
492
+ export declare const Timestamp: { create: (value: string) => Timestamp };
493
+
494
+ /* Excluded from this release type: _translateArray */
495
+
496
+ /* Excluded from this release type: _translateDateTime */
497
+
498
+ /* Excluded from this release type: _translateDecimal */
499
+
500
+ /* Excluded from this release type: _translateEnum */
501
+
502
+ /* Excluded from this release type: _translateMap */
503
+
504
+ /* Excluded from this release type: _translateShape */
505
+
506
+ /* Excluded from this release type: _translateUnion */
507
+
508
+ /* Excluded from this release type: _TypeToProtoWire */
509
+
510
+ /* Excluded from this release type: _TypeToProtoWireStrategy */
511
+
512
+ /* Excluded from this release type: _UnionBranchDescriptor */
513
+
514
+ /* Excluded from this release type: _UnionDescriptor */
515
+
516
+ /**
517
+ * Shared types and error classes for the transform pipeline.
518
+ * See transforms.ts for the module overview.
519
+ */
520
+ /**
521
+ * Thrown when incoming wire data (proto → SDK) cannot be parsed.
522
+ * Indicates malformed or unexpected data from the proto infrastructure —
523
+ * not a bug in the user's code.
524
+ *
525
+ * @public
526
+ */
527
+ export declare class WireReadError extends Error {
528
+ /* Excluded from this release type: name */
529
+ }
530
+
531
+ /**
532
+ * Thrown when outgoing SDK data (SDK → proto) cannot be serialized.
533
+ * Indicates that the user's code returned a value that cannot be translated
534
+ * back to wire format.
535
+ *
536
+ * @public
537
+ */
538
+ export declare class WireWriteError extends Error {
539
+ /* Excluded from this release type: name */
540
+ }
541
+
542
+ export { }