import * as _stigg_js_client_sdk from '@stigg/js-client-sdk'; import { BillableFeature, Subscription, Plan, Customer, BillingPeriod, CustomerPortalSubscriptionScheduledUpdateDataFragment, PaywallCurrency, PaywallCalculatedPricePoint, PriceTierFragment, Price, CustomerPortalSubscription, FeatureEntitlementFragment, EntitlementUnionFragment, CreditEntitlementFragment, EntitlementsFallback, SubscriptionAddon, Addon, BillingAddress, SubscriptionBillingInfo, GetCheckoutState, GetCheckoutStateResults, ApplySubscription, ApplySubscriptionResults, CheckoutStatePlan, PreviewSubscription, SubscriptionPreviewV2, SubscriptionPreviewDiscount, SubscriptionPreviewTaxDetails, GetBooleanEntitlement, BooleanEntitlement, GetNumericEntitlement, NumericEntitlement, GetMeteredEntitlement, MeteredEntitlement, GetCreditEntitlement, CreditEntitlement, GetEnumEntitlement, EnumEntitlement, GetActiveSubscriptions, GetPaywall, GetCustomerPortal, CreditUsageTimeRange, GetCreditUsageInput, CursorPaging, CreditGrantFragment, PageInfoFragment } from '@stigg/js-client-sdk'; export * from '@stigg/js-client-sdk'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { FeatureFragment, BillingPeriod as BillingPeriod$1, BillableFeatureInput } from '@stigg/api-client-js/src/generated/sdk'; import react, { PropsWithChildren, ChangeEvent, ReactNode } from 'react'; import { ConfigType } from 'dayjs'; import { ChipProps } from '@mui/material/Chip'; type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; type HorizontalAlignment = 'left' | 'center' | 'right'; type TextAlignment = 'left' | 'center' | 'right'; type FontVariant = { fontSize: string; fontWeight: 'bold' | 'normal'; semanticElement: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div'; }; type StatusChipVariant = 'success' | 'warning' | 'error' | 'info' | 'neutral'; type StatusChipColors = { background: string; text: string; border: string; }; type StiggTheme = { palette: { primary: string; primaryDark: string; primaryLight: string; backgroundPaper: string; backgroundHighlight: string; backgroundSection: string; backgroundButton: string; outlinedBorder: string; outlinedRestingBorder: string; outlinedHoverBackground: string; switchBorder: string; switchFill: string; switchHandle: string; warning: string; error: string; errorDark: string; white: string; success: string; successDark: string; text: { primary: string; secondary: string; tertiary: string; disabled: string; }; statusChips: { success: StatusChipColors; warning: StatusChipColors; error: StatusChipColors; info: StatusChipColors; neutral: StatusChipColors; }; progress: { background: string; low: string; medium: string; high: string; }; }; layout: { planMinWidth: string; planMaxWidth: string; planMargin: string; planPadding: string; ctaAlignment: HorizontalAlignment; headerAlignment: HorizontalAlignment; descriptionAlignment: TextAlignment; descriptionMinHeight: string; switchBottomSpacing: string; }; shadows: { light: string; popover: string; }; border: { radius: string; }; typography: { fontFamily: string; fontFamilyUrl?: string; h1: FontVariant; h2: FontVariant; h3: FontVariant; body: FontVariant; caption: FontVariant; }; customCss?: string; }; type CustomizedTheme = DeepPartial; type PaywallData = { plans: PaywallPlan[] | null; customer: Customer | null; currentSubscription: Subscription | null; currentSubscriptionOverride?: CurrentSubscriptionOverride | null; isCustomerOnTrial: boolean; isLoading: boolean; selectedBillingPeriod: BillingPeriod; setSelectedBillingPeriod: (billingPeriod: BillingPeriod) => void; availableBillingPeriods: BillingPeriod[]; locale: string; configuration?: CustomizedTheme; showWatermark: boolean; }; type CurrentSubscriptionOverride = { planId: string; billableFeatures: BillableFeature[]; }; declare enum SubscribeIntentionType { START_TRIAL = "START_TRIAL", UPGRADE_TRIAL_TO_PAID = "UPGRADE_TRIAL_TO_PAID", REQUEST_CUSTOM_PLAN_ACCESS = "REQUEST_CUSTOM_PLAN_ACCESS", CHANGE_BILLING_PERIOD = "CHANGE_BILLING_PERIOD", CHANGE_UNIT_QUANTITY = "CHANGE_UNIT_QUANTITY", UPGRADE_PLAN = "UPGRADE_PLAN", DOWNGRADE_PLAN = "DOWNGRADE_PLAN", CANCEL_SCHEDULED_UPDATES = "CANCEL_SCHEDULED_UPDATES" } type PaywallPlan = Plan & { isLowerThanCurrentPlan?: boolean; isTriable: boolean; isCurrentCustomerPlan: boolean; currentCustomerPlanBillingPeriod?: BillingPeriod; trialDaysLeft?: number; isNextPlan?: (billingPeriod: BillingPeriod) => boolean; scheduledUpdate?: CustomerPortalSubscriptionScheduledUpdateDataFragment; paywallCurrency?: PaywallCurrency; paywallCalculatedPricePoints?: PaywallCalculatedPricePoint[]; }; type BillableCredit = { topUpCustomCurrencyId: string; quantity: number; }; type OnPlanSelectedCallbackFn = ({ plan, customer, subscription, intentionType, selectedBillingPeriod, billableFeatures, billableCredits, }: { plan: Plan; customer: Customer | null; subscription: Subscription | null; intentionType: SubscribeIntentionType; selectedBillingPeriod: BillingPeriod; billableFeatures?: BillableFeature[]; billableCredits?: BillableCredit[]; }) => void | Promise; type ShouldHidePlanFn = ({ plan }: { plan: PaywallPlan; }) => boolean | Promise; type CurrentSubscriptionOverrideFn = ({ currentSubscription, }: { currentSubscription: Subscription | null; }) => CurrentSubscriptionOverride | null | undefined; type SelectDefaultTierIndexFn = ({ plan }: { plan: PaywallPlan; }) => number; type PlanPriceText = { price: string; unit?: string; tiers?: PriceTierFragment[] | null | undefined; tierUnits?: string; }; type CurrentPlanParams = { plan: Plan; selectedBillingPeriod: BillingPeriod; }; type PaywallLocalization = { highlightChip: string; entitlementsTitle?: (plan: PaywallPlan) => string; addonsTitle?: string; planCTAButton: { upgrade: string | ((plan: PaywallPlan) => string); downgrade: string | ((plan: PaywallPlan) => string); startTrial: (plan: PaywallPlan) => string; custom: ((data: CurrentPlanParams) => string) | string; currentPlan: string; startNew: string; switchToBillingPeriod: (billingPeriod: BillingPeriod) => string; cancelScheduledUpdate: string; }; price: { startingAtCaption: string; billingPeriod?: (billingPeriod: BillingPeriod) => string; pricePeriod: (billingPeriod: BillingPeriod) => string; custom: ((data: CurrentPlanParams) => string) | string; priceNotSet: string; free: PlanPriceText | ((currency?: PaywallCurrency) => PlanPriceText); paid?: (priceData: { planPrices: Price[]; paywallCalculatedPrice?: PaywallCalculatedPricePoint; plan: Plan; selectedBillingPeriod: BillingPeriod; selectedTier?: PriceTierFragment; }) => PlanPriceText; }; }; type PaywallContainerProps = { productId?: string; resourceId?: string; highlightedPlanId?: string; showOnlyEligiblePlans?: boolean; onPlanSelected: OnPlanSelectedCallbackFn; preferredBillingPeriod?: BillingPeriod; onBillingPeriodChange?: (billingPeriod: BillingPeriod) => void; textOverrides?: DeepPartial; billingCountryCode?: string; shouldHidePlan?: ShouldHidePlanFn; selectDefaultTierIndex?: SelectDefaultTierIndexFn; hideCompatibleAddons?: boolean; currentSubscriptionOverride?: CurrentSubscriptionOverrideFn; skeletonPlanCount?: number; }; declare const PaywallContainer: ({ productId, resourceId, highlightedPlanId, showOnlyEligiblePlans, textOverrides, onPlanSelected, preferredBillingPeriod, onBillingPeriodChange, billingCountryCode, shouldHidePlan, selectDefaultTierIndex, currentSubscriptionOverride: currentSubscriptionOverrideFn, hideCompatibleAddons, skeletonPlanCount, }: PaywallContainerProps) => react_jsx_runtime.JSX.Element; type CustomerPortalLocalization = { manageSubscription: string; usageTabTitle: string; addonsTabTitle: string; promotionsTabTitle: string; promotionsSubtitle: string; contactSupportTitle: string; contactSupportLink: string; editBilling: string; invoicesTitle: string; viewInvoiceHistory: string; editPaymentDetails: string; paywallSectionTitle: string; cancelScheduledUpdatesButtonTitle: string; usageUnavailable?: string; nextBillUnavailable?: string; formatResetPeriod?: (usagePeriodEnd: Date) => string; }; type CustomerPortalTheme = { sectionTitleColor: string; planNameColor: string; backgroundColor: string; borderColor: string; listItemBackgroundColor: string; tabMaxHeight: string; iconsColor?: string; iconsBackgroundColor?: string; }; type OnBuyMoreCallbackFn = (feature: FeatureFragment, entitlement: FeatureEntitlementFragment) => void; type FilterEntitlementsFn = (entitlements: FeatureEntitlementFragment[]) => FeatureEntitlementFragment[]; type PackageEntitlementsFilterPayload = { entitlements: EntitlementUnionFragment[]; }; type FilterPackageEntitlementsFn = (input: PackageEntitlementsFilterPayload) => PackageEntitlementsFilterPayload; declare enum CustomerPortalIntentionType { MANAGE_SUBSCRIPTION = "MANAGE_SUBSCRIPTION", UPGRADE_PLAN = "UPGRADE_PLAN", UPGRADE_TRIAL_PLAN = "UPGRADE_TRIAL_PLAN" } type OnManageSubscriptionFn = ({ intentionType, customerSubscriptions, }: { intentionType: CustomerPortalIntentionType; customerSubscriptions: CustomerPortalSubscription[]; }) => Promise | void; type CustomerPortalSection = 'usage' | 'addons' | 'promotionalEntitlements' | 'billingInformation' | 'paymentDetails' | 'invoices'; type CustomerPortalProps = { onManageSubscription?: OnManageSubscriptionFn; onBuyMore?: OnBuyMoreCallbackFn; filterEntitlements?: FilterEntitlementsFn; filterPackageEntitlements?: FilterPackageEntitlementsFn; onCancelScheduledUpdates?: (subscription: CustomerPortalSubscription) => Promise | void; onContactSupport?: () => Promise | void; paywallComponent?: React.ReactNode; hiddenSections?: CustomerPortalSection[]; textOverrides?: DeepPartial; theme?: DeepPartial; resourceId?: string; productId?: string; /** Maximum number of decimal places for usage and limit values (null = locale default) */ decimalPlaces?: number | null; }; declare function CustomerPortal({ textOverrides, theme, resourceId, productId, decimalPlaces, ...restProps }: CustomerPortalProps): react_jsx_runtime.JSX.Element; type OnManageClick = ({ intentionType }: { intentionType: CustomerPortalIntentionType; }) => void; type SubscriptionsOverviewProps = { onManageSubscription: OnManageClick; onBuyMore?: OnBuyMoreCallbackFn; onCancelScheduledUpdates?: (subscription: CustomerPortalSubscription) => void; onContactSupport?: () => void; hiddenSections?: CustomerPortalSection[]; cancelScheduledUpdatesButtonTitle: string; }; declare function SubscriptionsOverview({ onManageSubscription, onBuyMore, onCancelScheduledUpdates, onContactSupport, hiddenSections, cancelScheduledUpdatesButtonTitle, }: SubscriptionsOverviewProps): react_jsx_runtime.JSX.Element; declare function PaymentDetailsSection(): react_jsx_runtime.JSX.Element | null; declare function InvoicesSection(): react_jsx_runtime.JSX.Element | null; type CustomerUsageDataProps = { onManageSubscription?: OnManageClick; onBuyMore?: OnBuyMoreCallbackFn; filterEntitlements?: FilterEntitlementsFn; filterPackageEntitlements?: FilterPackageEntitlementsFn; }; declare function CustomerUsageData({ onManageSubscription, onBuyMore, filterEntitlements, filterPackageEntitlements, }: CustomerUsageDataProps): react_jsx_runtime.JSX.Element | null; declare function AddonsList(): react_jsx_runtime.JSX.Element | null; declare function Promotions(): react_jsx_runtime.JSX.Element; declare function CustomerPortalProvider({ children, textOverrides, theme, resourceId, productId, decimalPlaces, }: { children: react.ReactNode; textOverrides?: DeepPartial; theme?: DeepPartial; resourceId?: string; productId?: string; decimalPlaces?: number | null; }): react_jsx_runtime.JSX.Element; declare function isFeatureEntitlement(entitlement: EntitlementUnionFragment): entitlement is FeatureEntitlementFragment; declare function isCreditEntitlement(entitlement: EntitlementUnionFragment): entitlement is CreditEntitlementFragment; interface StiggContextValue { stigg: _stigg_js_client_sdk.StiggClient; isInitialized: boolean; locale: string; updatedAt?: Date; customerPortalUpdatedAt?: Date; refreshData: () => Promise; theme?: CustomizedTheme; resourceId?: string; } declare const StiggContext: react.Context; type StiggProviderProps = { apiKey: string; baseUri?: string; baseEdgeUri?: string; enableEdge?: boolean; entitlementsFallback?: EntitlementsFallback; customerId?: string; customerToken?: string; resourceId?: string; theme?: CustomizedTheme; /** BCP 47 locale for formatting numbers in the widgets. Defaults to the browser locale (`en-US` when unavailable). */ locale?: string; offline?: boolean; cacheTtlMs?: number; /** @deprecated not longer in use */ useEntitlementPolling?: boolean; /** @deprecated not longer in use */ entitlementPollingInterval?: number; stiggClient?: _stigg_js_client_sdk.StiggClient; clientName?: string; clientVersion?: string; }; declare const StiggProvider: react.FC>; type AddonsStepState = { addons: SubscriptionAddon[]; initialAddons?: SubscriptionAddon[]; availableAddons?: Addon[]; }; type PaymentStepState = { useNewPaymentMethod: boolean; errorMessage?: string; billingAddress?: BillingAddress; taxPercentage?: number; taxId?: TaxId; }; type PlanStepState = { billingPeriod: BillingPeriod$1; billableFeatures: BillableFeatureInput[]; billingCountryCode?: string; }; declare enum CheckoutStepKey { PLAN = "PLAN", ADDONS = "ADDONS", PAYMENT = "PAYMENT" } type CheckoutState = { planStep: PlanStepState; addonsStep: AddonsStepState; paymentStep: PaymentStepState; }; type BillingInformation = { taxDetails?: TaxDetailsInput; }; type TaxDetailsInput = { taxPercentage?: SubscriptionBillingInfo['taxPercentage']; taxId?: TaxId; }; interface TaxId { type: string; value: string; } type MockCheckoutPreviewCallback = (params: PreviewSubscription) => SubscriptionPreviewV2; type MockCheckoutStateCallback = (params: GetCheckoutState) => GetCheckoutStateResults; type CheckoutMockProps = { onMockCheckoutPreview?: MockCheckoutPreviewCallback; onMockCheckoutState?: MockCheckoutStateCallback; }; type OnBeforeStepChangeCallback = (params: { from: CheckoutStepKey; to: CheckoutStepKey; state: CheckoutState; }) => Promise; type OnBillableFeatureChangeCallback = (params: { feature: NonNullable; quantity: number; }) => Promise<{ errorMessage?: string; disableNextStep?: boolean; }>; type OnAddonChangeCallback = (params: { addon: Addon; quantity: number; }) => Promise<{ errorMessage?: string; disableNextStep?: boolean; }>; type OnCheckoutCallback = (params: { customerId: string; checkoutParams: ApplySubscription; checkoutAction: (params: ApplySubscription) => Promise<{ success: boolean; errorMessage?: string; results?: ApplySubscriptionResults; }>; }) => Promise<{ success: boolean; errorMessage?: string; results?: ApplySubscriptionResults; }>; type OnCheckoutCompletedCallback = (params: { success: boolean; error?: string; }) => Promise; type OnChangePlanCallback = (params: { currentPlan: CheckoutStatePlan | undefined; }) => void; type OnBillingAddressChangeCallback = (params: { billingAddress: BillingAddress; }) => Promise; type OnCheckoutParams = { customerId: string; checkoutParams: ApplySubscription; checkoutAction: (params: ApplySubscription) => Promise<{ success: boolean; errorMessage?: string; results?: ApplySubscriptionResults; }>; }; type OnCheckoutCompletedParams = { success: boolean; error?: string; }; type CheckoutResult = { success: boolean; errorMessage?: string; results?: ApplySubscriptionResults; }; type CheckoutSteps = 'PLAN' | 'ADDONS'; type CheckoutLocalization = { changePlan: string; billingPeriodsTitle: string; addAddonText: string; addonBillingPeriodNotAvailableText: (params: { planBillingPeriod: BillingPeriod; }) => string; newPaymentMethodText: string; newPaymentMethodCardTitle: string; newPaymentMethodBillingAddressTitle: string; summary: { title: string; planName: (params: { plan: { displayName: string; }; }) => string; addCouponCodeText: string; couponCodeTitle: string; addonsSectionTitle: string; discountsSectionTitle: string; onlyPayAsYouGoText: string; startsAtText: string; proratedTotalDueText: string; baseChargeText: string | ((params: { billingPeriod: BillingPeriod; }) => string); totalText: string; totalDueText: string; totalBillingPeriodText: (params: { billingPeriod: BillingPeriod; }) => string; discountText: (params: { discountDetails: SubscriptionPreviewDiscount; currency: string; }) => string; appliedCreditsTitle: string; taxTitle: (params: { taxDetails: SubscriptionPreviewTaxDetails; }) => string; checkoutSuccessText: string; payAsYouGoTooltipText: string; changesWillApplyAtEndOfBillingPeriod: string | ((params: { billingPeriodEnd: Date; }) => string); creditsForUnusedTimeText: (params: { credits: string; }) => string; }; checkoutButton: { nextText: string; noChangesText: string; updateText: string; downgradeToFreeText: string; upgradeText: string; }; downgradeToFree: { alertText: (params: { plan: Plan; }) => string; freePlanHeader: (params: { plan: Plan; }) => string; freePlanName: (params: { plan: Plan; }) => string; freePlanPriceText: (params: { plan: Plan; }) => string; paidPlanHeader: (params: { plan: Plan; }) => string; paidPlanName: (params: { plan: Plan; }) => string; paidPlanPriceText: (params: { plan: Plan; billingPeriod?: BillingPeriod; }) => string; }; nextBillingCaption: (params: { plan: Plan; subscriptionPreview: SubscriptionPreviewV2; billingPeriod: BillingPeriod; activeSubscription?: Subscription | null; promotionCode?: string; }) => string; }; type CheckoutTheme = { primary: string; textColor: string; backgroundColor: string; borderColor: string; summaryBackgroundColor: string; paymentInputBackgroundColor?: string; paymentInputBorderColor?: string; paymentInputBorderRadius?: string; }; type CheckoutProviderProps = { textOverrides?: DeepPartial; theme?: DeepPartial; resourceId?: string; planId: string; preferredBillingPeriod?: BillingPeriod; billingCountryCode?: string; billableFeatures?: BillableFeature[]; billingInformation?: BillingInformation; onMockCheckoutState?: MockCheckoutStateCallback; skipCheckoutSteps?: CheckoutSteps[]; onBeforeStepChange?: OnBeforeStepChangeCallback; resetBillingPeriod?: boolean; }; type CheckoutContainerProps = { onCheckout?: OnCheckoutCallback; onCheckoutCompleted: OnCheckoutCompletedCallback; onChangePlan?: OnChangePlanCallback; onBillingAddressChange?: OnBillingAddressChangeCallback; onBillableFeatureChange?: OnBillableFeatureChangeCallback; onAddonChange?: OnAddonChangeCallback; disablePromotionCode?: boolean; disableSuccessAnimation?: boolean; collectPhoneNumber?: boolean; collectTaxId?: boolean; onMockCheckoutPreview?: MockCheckoutPreviewCallback; }; type CheckoutProps = CheckoutProviderProps & CheckoutContainerProps & CheckoutMockProps; declare const Checkout: ({ textOverrides, theme, resourceId, planId, preferredBillingPeriod, billingCountryCode, billableFeatures, billingInformation, onMockCheckoutState, skipCheckoutSteps, onBeforeStepChange, resetBillingPeriod, ...containerProps }: CheckoutProps) => react_jsx_runtime.JSX.Element; declare enum ProvisionStatus { IN_PROGRESS = "IN_PROGRESS", SUCCEEDED = "SUCCEEDED", FAILED = "FAILED" } declare const useWaitForCheckoutCompleted: ({ onProvisionStart, onProvisionSucceeded, onProvisionFailed, }?: { onProvisionStart?: () => void; onProvisionSucceeded?: (subscription?: Subscription | null) => void; onProvisionFailed?: (err?: any) => void; }) => { isAwaitingCheckout: boolean; provisionStatus: ProvisionStatus; }; type TypedGetBooleanEntitlement = Omit & { featureId: T; }; declare function useBooleanEntitlement(params: TypedGetBooleanEntitlement): BooleanEntitlement; type TypedGetNumericEntitlement = Omit & { featureId: T; }; declare function useNumericEntitlement(params: TypedGetNumericEntitlement): NumericEntitlement; type TypedGetMeteredEntitlement = Omit & { featureId: T; }; declare function useMeteredEntitlement(params: TypedGetMeteredEntitlement): MeteredEntitlement; type TypedGetCreditEntitlement = Omit & { currencyId: T; }; declare function useCreditEntitlement(params: TypedGetCreditEntitlement): CreditEntitlement; type TypedGetEnumEntitlement = Omit & { featureId: T; }; declare function useEnumEntitlement(params: TypedGetEnumEntitlement): EnumEntitlement; declare function useActiveSubscriptions(params?: GetActiveSubscriptions): { activeSubscriptions: _stigg_js_client_sdk.Subscription[] | null; isLoading: boolean; error: Error | null; }; declare function usePaywall(params?: GetPaywall): { paywall: _stigg_js_client_sdk.Paywall | null; isLoading: boolean; error: Error | null; }; declare function useCustomerPortal(params?: GetCustomerPortal): { customerPortal: _stigg_js_client_sdk.CustomerPortal | null; isLoading: boolean; error: Error | null; }; declare function useStiggContext(options?: { optional?: false; }): StiggContextValue; declare function useStiggContext(options: { optional: true; }): StiggContextValue | null; type BooleanEntitlementGuardProps = GetBooleanEntitlement & { noAccessComponent?: React.ReactNode; children: React.ReactElement; }; declare function BooleanEntitlementGuard({ noAccessComponent, children, ...rest }: BooleanEntitlementGuardProps): JSX.Element; type NumericEntitlementGuardProps = GetNumericEntitlement & { noAccessComponent?: React.ReactNode; children: React.ReactElement; }; declare function NumericEntitlementGuard({ noAccessComponent, children, ...rest }: NumericEntitlementGuardProps): JSX.Element; type MeteredEntitlementGuardProps = GetMeteredEntitlement & { noAccessComponent?: React.ReactNode; children: React.ReactElement; }; declare function MeteredEntitlementGuard({ noAccessComponent, children, ...rest }: MeteredEntitlementGuardProps): JSX.Element; type EnumEntitlementGuardProps = GetEnumEntitlement & { noAccessComponent?: React.ReactNode; children: React.ReactElement; }; declare function EnumEntitlementGuard({ noAccessComponent, children, ...rest }: EnumEntitlementGuardProps): JSX.Element; type OnAddCreditsCallbackFn = (entitlement: CreditEntitlement) => void | Promise; type CreditBalanceProps = { currencyId: string; localization?: Partial; decimalPlaces?: number | null; showUnits?: boolean; onAddCredits?: OnAddCreditsCallbackFn; }; type CreditBalanceLocalization = { title: string; addCredits: string; formatResetPeriod?: (usagePeriodEnd: Date) => string; }; declare function CreditBalance({ currencyId, localization, decimalPlaces, showUnits, onAddCredits, }: CreditBalanceProps): react_jsx_runtime.JSX.Element; type CreditUsageChartLocalization = { title: string; totalSpend: string; }; type CreditUsageChartProps = { currencyId: string; timeRange: CreditUsageTimeRange; localization?: Partial; /** * Maximum number of decimal places for credit values (total, legend, tooltip and y-axis). * Defaults to 5 for the total, legend and tooltip, and to the locale default for the y-axis. */ decimalPlaces?: number | null; }; declare function CreditUsageChart(props: CreditUsageChartProps): react_jsx_runtime.JSX.Element; declare function useCreditUsage(params: GetCreditUsageInput): { creditUsage: _stigg_js_client_sdk.CreditUsageFragment | null; isLoading: boolean; error: Error | null; }; type CreditUtilizationProps = { currencyId: string; localization?: Partial; decimalPlaces?: number | null; showUnits?: boolean; onAddCredits?: OnAddCreditsCallbackFn; }; type CreditUtilizationLocalization = { title: string; remaining: string; addCredits: string; formatResetPeriod?: (usagePeriodEnd: Date) => string; }; declare function CreditUtilization({ currencyId, localization, decimalPlaces, showUnits, onAddCredits, }: CreditUtilizationProps): react_jsx_runtime.JSX.Element; type CreditGrant = Pick & { effectiveAt: string; expireAt?: string | null; createdAt: string; updatedAt: string; }; declare enum CreditGrantStatus { SCHEDULED = "SCHEDULED", AVAILABLE = "AVAILABLE", EXPIRED = "EXPIRED", DEPLETED = "DEPLETED", VOIDED = "VOIDED" } interface GetCreditGrantsParams { currencyId?: string; pageSize?: number; paging?: CursorPaging; } type CreditGrantsLocalization = { receivedAt: string; effectiveAt: string; grantType: string; status: string; balance: string; expiryDate: string; emptyState: string; loadingState: string; errorState: string; overdraft: string; recurring: string; active: string; depleted: string; scheduled: string; expired: string; voided: string; }; type CreditGrantsProps = GetCreditGrantsParams & { localization?: Partial; decimalPlaces?: number | null; }; declare function CreditGrants({ currencyId, localization: customLocalization, decimalPlaces, pageSize, }: CreditGrantsProps): react_jsx_runtime.JSX.Element; declare function useCreditGrants(params: GetCreditGrantsParams): { creditGrants: CreditGrant[]; isLoading: boolean; error: Error | null; paging?: PageInfoFragment | null; totalCount?: number; }; interface AutoRechargeStatusLocalization { title?: string; activeLabel?: string; manageButton?: string; descriptionTemplate?: string; emptyStateMessage?: string; spendTemplate?: string; unlimitedSpendLimit?: string; } interface AutoRechargeStatusContentProps { customerId: string; currencyId: string; currencyUnit?: string; billingCurrency?: string; onManageClick?: () => void; className?: string; localization?: AutoRechargeStatusLocalization; } type AutoRechargeStatusProps = AutoRechargeStatusContentProps; declare function AutoRechargeStatus(props: AutoRechargeStatusProps): react_jsx_runtime.JSX.Element; interface AutomaticRechargeConfiguration { id: string; enabled: boolean; thresholdAmount: number; targetBalance: number; maxSpendLimit?: number; currencyId: string; customerId: string; currentMonthlySpend?: number; } interface UpdateAutomaticRechargeConfigParams { customerId: string; currencyId: string; enabled: boolean; thresholdAmount?: number; targetBalance?: number; maxSpendLimit?: number; } interface AutomaticRechargeConfigLocalization { title?: string; enableLabel?: string; enableDescription?: string; thresholdFieldPrefix?: string; thresholdFieldSuffix?: string; thresholdTooltip?: string; thresholdFieldPlaceholder?: string; thresholdFieldHint?: string; thresholdRequired?: string; thresholdMin?: string; thresholdMax?: string; targetFieldPrefix?: string; targetFieldSuffix?: string; targetBalanceTooltip?: string; targetFieldPlaceholder?: string; targetFieldHint?: string; targetRequired?: string; targetMin?: string; targetMax?: string; spendLimitFieldPrefix?: string; spendLimitFieldSuffix?: string; spendLimitFieldPlaceholder?: string; spendLimitHelpText?: string; spendLimitPeriod?: string; spendLimitPositive?: string; spendLimitMin?: string; spendLimitMax?: string; immediateRechargeWarning?: string; spendLimitTooLowWarning?: string; cancelButton?: string; saveButton?: string; editButton?: string; loadingState?: string; errorState?: string; emptyState?: string; } interface AutomaticRechargeFormData { enabled: boolean; thresholdAmount: string; targetBalance: string; maxSpendLimit: string; } interface AutomaticRechargeFormErrors { thresholdAmount?: string; targetBalance?: string; maxSpendLimit?: string; } interface AutomaticRechargeConfigFormProps { customerId: string; currencyId: string; currencyUnit?: string; poolSize?: number; currentBalance?: number; currentMonthlySpend?: number; initialData?: AutomaticRechargeConfiguration; readOnly?: boolean; onSave?: (data: UpdateAutomaticRechargeConfigParams) => void; onCancel?: () => void; localization?: AutomaticRechargeConfigLocalization; } interface AutomaticRechargeConfigProps { customerId: string; currencyId: string; currencyUnit?: string; poolSize?: number; readOnly?: boolean; localization?: AutomaticRechargeConfigLocalization; onSave?: (data: UpdateAutomaticRechargeConfigParams) => void; onCancel?: () => void; } declare function AutomaticRechargeConfig({ customerId, currencyId, currencyUnit, poolSize, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigProps): react_jsx_runtime.JSX.Element; declare function AutomaticRechargeConfigForm({ customerId, currencyId, initialData, currencyUnit, poolSize, currentBalance, currentMonthlySpend, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigFormProps): react_jsx_runtime.JSX.Element; interface UseAutomaticRechargeFormProps { initialData?: AutomaticRechargeConfiguration; poolSize?: number; localization: Required; } declare function useAutomaticRechargeForm({ initialData, poolSize, localization }: UseAutomaticRechargeFormProps): { formData: AutomaticRechargeFormData; errors: AutomaticRechargeFormErrors; touched: { [key: string]: boolean; }; handleEnabledChange: (event: ChangeEvent) => void; handleFieldChange: (field: keyof AutomaticRechargeFormData) => (event: ChangeEvent) => void; handleFieldBlur: (field: keyof AutomaticRechargeFormData) => () => void; getFieldError: (field: keyof AutomaticRechargeFormErrors) => string | undefined; validate: () => boolean; getFormValues: () => { enabled: boolean; thresholdAmount: number | undefined; targetBalance: number | undefined; maxSpendLimit: number | undefined; }; }; interface ValidationRules { poolSize?: number; minSpendLimit?: number; maxSpendLimit?: number; } declare function validateAutomaticRechargeForm(data: AutomaticRechargeFormData, rules: ValidationRules | undefined, localization: Pick, locale?: string): AutomaticRechargeFormErrors; type TableAlignment = 'left' | 'center' | 'right'; type PixelWidth = `${number}px`; interface HeadCell { id: string; alignment?: TableAlignment; label: string; width?: PixelWidth; maxWidth?: PixelWidth; minWidth?: PixelWidth; disableClick?: boolean; visible?: boolean; render: (item: T) => ReactNode; } interface GenericTableProps { data: T[]; headCells: Array>; isLoading?: boolean; error?: Error | null; emptyMessage?: ReactNode; loadingMessage?: string; errorMessage?: ReactNode; onRowClick?: (item: T) => void; className?: string; skeletonRows?: number; hideLastRowBorder?: boolean; pageSize?: number; pageNum?: number; totalCount?: number; onPageChange?: (event: any, nextPage: number) => void; } declare function GenericTable({ data, headCells, isLoading, error, emptyMessage, errorMessage, onRowClick, className, skeletonRows, hideLastRowBorder, pageSize, pageNum, totalCount, onPageChange, }: GenericTableProps): react_jsx_runtime.JSX.Element; interface ErrorStateProps { errorMessage?: ReactNode; className?: string; } declare function ErrorState({ errorMessage, className }: ErrorStateProps): react_jsx_runtime.JSX.Element; interface EmptyStateProps { message?: ReactNode; className?: string; } declare function EmptyState({ message, className }: EmptyStateProps): react_jsx_runtime.JSX.Element; /** * Formats a date with time in the format "MMM D, YYYY h:mmA" * Example: "Aug 2, 2025 3:45PM" */ declare function formatDateTime(date: ConfigType): string; /** * Formats a date without time in the format "MMM D, YYYY" * Example: "Aug 2, 2025" */ declare function formatDateOnly(date: ConfigType): string; interface StatusChipProps extends Omit { variant: StatusChipVariant; label: string; } /** * StatusChip component for displaying status indicators with consistent theming * * @param variant - The status variant (success, warning, error, info, neutral) * @param label - The text to display in the chip * @param className - Optional CSS class name * @param size - Size of the chip (defaults to 'small') */ declare function StatusChip({ variant, label, className, size, ...props }: StatusChipProps): react_jsx_runtime.JSX.Element; declare const mapCreditGrantStatusToVariant: (status: CreditGrantStatus) => StatusChipVariant; export { AddonsList, AutoRechargeStatus, type AutoRechargeStatusLocalization, type AutoRechargeStatusProps, AutomaticRechargeConfig, AutomaticRechargeConfigForm, type AutomaticRechargeConfigFormProps, type AutomaticRechargeConfigLocalization, type AutomaticRechargeConfigProps, type AutomaticRechargeConfiguration, type AutomaticRechargeFormData, type AutomaticRechargeFormErrors, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FilterEntitlementsFn, type FilterPackageEntitlementsFn, type FontVariant, GenericTable, type GenericTableProps, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddCreditsCallbackFn, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, type PackageEntitlementsFilterPayload, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, type UpdateAutomaticRechargeConfigParams, formatDateOnly, formatDateTime, isCreditEntitlement, isFeatureEntitlement, mapCreditGrantStatusToVariant, useActiveSubscriptions, useAutomaticRechargeForm, useBooleanEntitlement, useCreditEntitlement, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted, validateAutomaticRechargeForm };