declare enum AppEnv {
    Sandbox = "sandbox",
    Live = "live"
}

declare const Infinite = "inf";
declare enum FreeTrialDuration {
    Day = "day"
}
declare enum UsageModel {
    Prepaid = "prepaid",
    PayPerUse = "pay_per_use"
}
type UsageModelType = "prepaid" | "pay_per_use";
declare enum ProductItemInterval {
    Minute = "minute",
    Hour = "hour",
    Day = "day",
    Week = "week",
    Month = "month",
    Quarter = "quarter",
    SemiAnnual = "semi_annual",
    Year = "year",
    Multiple = "multiple"
}
type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";

declare enum ProductStatus {
    Active = "active",
    Expired = "expired",
    Trialing = "trialing",
    Scheduled = "scheduled",
    PastDue = "past_due"
}
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities";

interface CustomerFeature {
    id: string;
    name: string;
    unlimited?: boolean;
    interval?: ProductItemInterval | null;
    balance?: number;
    usage?: number;
    included_usage?: number;
    next_reset_at?: number | null;
    breakdown?: {
        interval: ProductItemInterval;
        balance?: number;
        usage?: number;
        included_usage?: number;
        next_reset_at?: number;
    }[];
}
interface CustomerProduct {
    id: string;
    name: string | null;
    group: string | null;
    status: ProductStatus;
    started_at: number;
    canceled_at: number | null;
    subscription_ids?: string[] | null;
    current_period_start?: number | null;
    current_period_end?: number | null;
    trial_ends_at?: number;
    entity_id?: string;
    is_add_on: boolean;
    is_default: boolean;
}
interface Customer {
    id: string | null;
    created_at: number;
    name: string | null;
    email: string | null;
    fingerprint: string | null;
    stripe_id: string | null;
    env: AppEnv;
    metadata: Record<string, any>;
    products: CustomerProduct[];
    features: Record<string, CustomerFeature>;
    invoices?: CustomerInvoice[];
}
interface CustomerData {
    name?: string;
    email?: string;
    fingerprint?: string;
}
interface CreateCustomerParams {
    id?: string | null;
    email?: string | null;
    name?: string | null;
    fingerprint?: string | null;
    metadata?: Record<string, any>;
    expand?: CustomerExpandOption[];
}
interface BillingPortalResponse {
    customer_id: string;
    url: string;
}
interface CustomerInvoice {
    product_ids: string[];
    stripe_id: string;
    status: string;
    total: number;
    currency: string;
    created_at: number;
}

export { AppEnv as A, type BillingPortalResponse as B, type CustomerData as C, FreeTrialDuration as F, Infinite as I, type ProductItemIntervalType as P, UsageModel as U, type CreateCustomerParams as a, type Customer as b, type CustomerExpandOption as c, type CustomerProduct as d, type CustomerFeature as e, type CustomerInvoice as f, type UsageModelType as g };
