@bpinternal/billing-ui 0.22.0 → 0.24.0

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.
package/dist/index.d.ts CHANGED
@@ -29,11 +29,11 @@ export declare type Addon = Awaited<ReturnType<BillingClient['listAddons']>>[num
29
29
  export declare function addonDisplayName(name: string): string;
30
30
 
31
31
  /**
32
- * "Now → New" resource totals once the selected add-on quantities are applied.
33
- * new = plan base feature + Σ (quantity × add-on increment) across add-ons that grant it.
34
- * Only returns rows that actually change, so the preview stays focused.
32
+ * "Now → New" resource totals: plan base + add-ons owned now (`currentQuantities`) vs. plan base +
33
+ * the selected add-on quantities (`quantities`). One row per resource an add-on grants, even when
34
+ * unchanged (e.g. reverting a scheduled downgrade).
35
35
  */
36
- export declare function addonLimitsPreview(plan: Plan, addons: Addon[] | undefined, quantities: Record<string, number>): LimitPreviewRow[];
36
+ export declare function addonLimitsPreview(plan: Plan, addons: Addon[] | undefined, quantities: Record<string, number>, currentQuantities?: Record<string, number>): LimitPreviewRow[];
37
37
 
38
38
  /**
39
39
  * Add-on price for a given plan. Smaug keys add-on prices by plan id
@@ -263,7 +263,8 @@ export declare type BillingProviderProps = {
263
263
  * Analytics sink the library captures billing-funnel events into. Pass a
264
264
  * `posthog-js` instance directly (it satisfies the shape), or any object with
265
265
  * a matching `capture`. Omit and every event no-ops. The event names + props
266
- * the library emits are listed in `BILLING_EVENTS`.
266
+ * the library emits are listed in `BILLING_EVENTS`. Every event also carries
267
+ * `workspace_billing_version`, `workspace_plan` and `workspace_is_paid` when known.
267
268
  */
268
269
  analytics?: BillingAnalyticsClient;
269
270
  /** Override the human label shown for a plan feature key (e.g. bot_count) */