import { NextRequest, NextResponse } from 'next/server'; import { WebhooksConfig } from '@polar-sh/adapter-utils'; export { EntitlementContext, EntitlementHandler, EntitlementProperties, EntitlementStrategy, Entitlements } from '@polar-sh/adapter-utils'; interface CheckoutConfig { accessToken?: string; successUrl?: string; returnUrl?: string; includeCheckoutId?: boolean; server?: "sandbox" | "production"; theme?: "light" | "dark"; } declare const Checkout: ({ accessToken, successUrl, returnUrl, server, theme, includeCheckoutId, }: CheckoutConfig) => (req: NextRequest) => Promise; interface CustomerPortalBaseConfig { accessToken: string; server: "sandbox" | "production"; returnUrl?: string; } interface CustomerPortalCustomerIdConfig extends CustomerPortalBaseConfig { getCustomerId: (req: NextRequest) => Promise; getExternalCustomerId?: never; } interface CustomerPortalExternalCustomerIdConfig extends CustomerPortalBaseConfig { getCustomerId?: never; getExternalCustomerId: (req: NextRequest) => Promise; } type CustomerPortalConfig = CustomerPortalCustomerIdConfig | CustomerPortalExternalCustomerIdConfig; declare const CustomerPortal: (config: CustomerPortalConfig) => (req: NextRequest) => Promise; declare const Webhooks: ({ webhookSecret, entitlements, onPayload, ...eventHandlers }: WebhooksConfig) => (request: NextRequest) => Promise>; export { Checkout, type CheckoutConfig, CustomerPortal, type CustomerPortalConfig, Webhooks };