import Stripe from 'stripe'; import { type ResolvedConfig } from './types.ts'; import { type BillableModel } from './contracts.ts'; import { type NormalizeConstructor } from '@poppinss/utils/types'; import type Subscription from './models/subscription.js'; import type SubscriptionItem from './models/subscription_item.ts'; import { type EmitterService, type HttpRouterService } from '@adonisjs/core/types'; import { type TransactionClientContract } from '@adonisjs/lucid/types/database'; export declare class Shopkeeper { #private; /** * @internal */ static $instance: Shopkeeper; constructor(config: ResolvedConfig, router: HttpRouterService, emitter: EmitterService); get stripe(): Stripe; get config(): ResolvedConfig; get customerModel(): BillableModel; get subscriptionModel(): NormalizeConstructor; get subscriptionItemModel(): NormalizeConstructor; get calculateTaxes(): boolean; get currency(): string; /** * Get the customer instance by its Stripe ID. */ findBillable(customer: Stripe.Customer | Stripe.DeletedCustomer | string): Promise | null>; /** * Format the given amount into a displayable currency. */ formatAmount(amount: number, currency?: string): string; registerRoutes(): import("@adonisjs/http-server").Route; /** * Wrap webhook handling with idempotency audit. * The event is recorded in `stripe_webhook_events` within the same transaction. * If the callback throws, the transaction rolls back and the event is not marked as processed. */ webhookAudit(event: Stripe.Event, callback: (trx: TransactionClientContract) => Promise): Promise; registerWebhookListeners(): void; }