import { Metadata } from "../types.mjs"; //#region src/stripe/config.d.ts type PriceId = `price_${string}`; declare const addMethod: unique symbol; declare class Product = Lowercase, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never, I extends PriceId = never> { readonly id: string; readonly config: StripeConfig; readonly plan: PE | null; readonly billingPeriod: BP | null; readonly prices: Map; defaultPriceId: I | null; constructor(config: StripeConfig, id: string, plan?: PE | null, billingPeriod?: BP | null); /** * Non-default prices stay declared on purpose: they keep resolving for * grandfathered subscribers and serve as price-experiment arms. Never * create new checkouts with a legacy price unless that is intentional. */ price: (priceId: K extends I ? never : K, metadata?: Metadata) => Product; default: (defaultPriceId: I) => StripeConfig; } type Options = { returnUrl: string; cancelUrl: string; successUrl: `${string}session_id={CHECKOUT_SESSION_ID}${string}`; cancellationCouponId: string; allowPromotionCodes: boolean; }; declare class StripeConfig = Lowercase, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never> { private readonly products; returnUrl: string; cancelUrl: string; successUrl: `${string}session_id={CHECKOUT_SESSION_ID}${string}`; cancellationCouponId: string; allowPromotionCodes: boolean; get productIds(): string[]; [addMethod]: (product: Product) => this; private constructor(); static create: , PE_1 extends string, BP_1 extends string = string>(options: Options) => StripeConfig; /** * One-time products take no extra args; subscriptions require both plan and billingPeriod. * A plan+period pair may be declared on only one product — version its prices in that chain. */ product: { }`>(productId: K extends PI ? never : K): Product; }`, L extends PE, P extends BP>(productId: K extends PI ? never : K, plan: L, billingPeriod: `${L}:${P}` extends PL ? never : P): Product; }; getPlan: (productId: string) => PE; getBillingPeriod: (productId: string) => BP; getMode: (productId: string) => 'payment' | 'subscription'; getPriceId: (productId: string) => PriceId; getCreditAmount: (productId: string, priceId?: string) => number; private readonly getCreditExpiresIn; getCreditExpiresAt: (productId: string, priceId?: string) => string; } //#endregion export { PriceId, StripeConfig }; //# sourceMappingURL=config.d.mts.map