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<Response>;

interface CustomerPortalBaseConfig {
    accessToken: string;
    server: "sandbox" | "production";
    returnUrl?: string;
}
interface CustomerPortalCustomerIdConfig extends CustomerPortalBaseConfig {
    getCustomerId: (req: NextRequest) => Promise<string>;
    getExternalCustomerId?: never;
}
interface CustomerPortalExternalCustomerIdConfig extends CustomerPortalBaseConfig {
    getCustomerId?: never;
    getExternalCustomerId: (req: NextRequest) => Promise<string>;
}
type CustomerPortalConfig = CustomerPortalCustomerIdConfig | CustomerPortalExternalCustomerIdConfig;
declare const CustomerPortal: (config: CustomerPortalConfig) => (req: NextRequest) => Promise<Response>;

declare const Webhooks: ({ webhookSecret, entitlements, onPayload, ...eventHandlers }: WebhooksConfig) => (request: NextRequest) => Promise<NextResponse<{
    received: boolean;
}>>;

export { Checkout, type CheckoutConfig, CustomerPortal, type CustomerPortalConfig, Webhooks };
