import type { Context } from '../../context.js';
import type { AnyTimeRange, MonetaryAmount } from '../types.js';
import type { Decimal, _ConfigApplicationContext } from '../../../stdlib/index.js';
/** @public */
export declare namespace DiscountCalculation {
    /** @public */
    type BillingReason = 'automatic_pending_invoice_item_invoice' | 'manual' | 'quote_accept' | 'subscription_cancel' | 'subscription_create' | 'subscription_cycle' | 'subscription_threshold' | 'subscription_trial_ended' | 'subscription_update' | 'subscription' | 'upcoming';
    /** @public */
    type PricingTierMode = 'graduated' | 'volume';
    /** @public */
    type PriceType = 'one_time' | 'recurring';
    /** @public */
    type PricingScheme = 'per_unit' | 'tiered';
    /** @public */
    type UsageType = 'licensed' | 'metered';
    /** @public */
    type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
    /**
     * The result of a discount calculation.
     * @public
     */
    interface DiscountResult {
        /** The computed discount to apply. */
        discount: Discount;
    }
    /**
     * A discount to apply to a discountable item.
     * @public
     */
    interface Discount {
        /** The discount amount to subtract from the discountable item. */
        amount: MonetaryAmount;
    }
    /**
     * An item eligible for discount calculation, containing its line items and billing context.
     * @public
     */
    interface DiscountableItem {
        /** The individual line items that make up the discountable item. */
        lineItems: DiscountableLineItem[];
        /** The total gross amount of the discountable item before any discounts. */
        grossAmount: MonetaryAmount;
        /** The customer associated with the discountable item. */
        customer?: Customer;
        /** The reason this item is being billed. */
        billingReason?: BillingReason;
        /** The subscription associated with the discountable item. */
        subscription?: Subscription;
    }
    /**
     * The subscription associated with the discountable item.
     * @public
     */
    interface Subscription {
        /** The unique identifier of the subscription. */
        id: string;
        /** The Unix timestamp of the billing cycle anchor. */
        billingCycleAnchor?: number;
        /** The structured billing cycle anchor configuration. */
        billingCycleAnchorConfig?: BillingCycleAnchorConfig;
        /** Custom key-value pairs attached to the subscription. */
        metadata: Record<string, string>;
    }
    /**
     * Configuration for the billing cycle anchor, specifying when recurring billing periods start.
     * @public
     */
    interface BillingCycleAnchorConfig {
        /** The month component of the billing cycle anchor. */
        month: number;
        /** The day of the month for the billing cycle anchor. */
        dayOfMonth: number;
        /** The hour component of the billing cycle anchor. */
        hour: number;
        /** The minute component of the billing cycle anchor. */
        minute: number;
        /** The second component of the billing cycle anchor. */
        second: number;
    }
    /**
     * The customer associated with the discountable item.
     * @public
     */
    interface Customer {
        /** The unique identifier of the customer. */
        id: string;
        /** Custom key-value pairs attached to the customer. */
        metadata: Record<string, string>;
    }
    /**
     * A single line item within a discountable item.
     * @public
     */
    interface DiscountableLineItem {
        /** The subtotal amount of this line item. */
        subtotal: MonetaryAmount;
        /** The quantity of this line item. */
        quantity?: Decimal;
        /** The billing period this line item covers. */
        period: AnyTimeRange;
        /** The price information for this line item. */
        price?: Price;
    }
    /**
     * The price associated with a line item.
     * @public
     */
    interface Price {
        /** The unique identifier for the price. */
        id: string;
        /** The product this price belongs to. */
        product?: Product;
        /** The recurring pricing configuration, if applicable. */
        recurring?: RecurringPrice;
        /** The billing scheme, either per-unit or tiered. */
        billingScheme?: PricingScheme;
        /** The pricing tiers, applicable for tiered billing schemes. */
        tiers: PriceTier[];
        /** The price type, either one-time or recurring. */
        type?: PriceType;
        /** The tiering mode, either graduated or volume. */
        tiersMode?: PricingTierMode;
        /** Key-value metadata attached to the price. */
        metadata: Record<string, string>;
        /** The unit amount of the price. */
        unitAmount?: Decimal;
    }
    /**
     * A tier within a tiered pricing structure.
     * @public
     */
    interface PriceTier {
        /** The flat fee charged for this tier. */
        flatAmount?: Decimal;
        /** The per-unit price for this tier. */
        unitAmount?: Decimal;
        /** The upper bound of the tier range. */
        upTo?: Decimal;
    }
    /**
     * The recurring pricing configuration for a price.
     * @public
     */
    interface RecurringPrice {
        /** The billing interval for the recurring price. */
        interval: RecurringPriceInterval;
        /** The number of intervals between each billing cycle. */
        intervalCount: number;
        /** The usage type, either licensed or metered. */
        usageType?: UsageType;
        /** The identifier of the meter tracking usage for this price. */
        meter?: string;
    }
    /**
     * The product associated with a price.
     * @public
     */
    interface Product {
        /** The unique identifier of the product. */
        id: string;
        /** The name of the product. */
        name: string;
        /** Custom key-value pairs attached to the product. */
        metadata: Record<string, string>;
    }
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    function prepareArgsComputeDiscounts(proto: unknown): DiscountableItem;
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    function prepareResultComputeDiscounts(result: DiscountResult): DiscountResult;
    /** @internal */
    function $platformWrapComputeDiscounts(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { computeDiscounts(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    const prepareArgs: typeof prepareArgsComputeDiscounts;
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    const prepareResult: typeof prepareResultComputeDiscounts;
    /**
     * Computes discount amounts for a discountable item and returns a discount result.
     * @public
     */
    type ComputeDiscountsFunction<Config> = (request: DiscountableItem, config: Config, context: Context) => DiscountResult;
}
/**
 * @example
 * ```ts
 * import type { Billing, Context } from '@stripe/extensibility-sdk';
 *
 * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
 * interface MyDiscountCalculationConfig {}
 *
 * export default class MyDiscountCalculation implements Billing.Bill
 *   .DiscountCalculation<MyDiscountCalculationConfig> {
 *   computeDiscounts(
 *     request: Billing.Bill.DiscountCalculation.DiscountableItem,
 *     _config: MyDiscountCalculationConfig,
 *     _context: Context
 *   ) {
 *     // TODO: implement your discount logic here
 *
 *     return {
 *       discount: { amount: request.grossAmount },
 *     };
 *   }
 * }
 *
 * ```
 * @public
 */
export interface DiscountCalculation<Config> {
    computeDiscounts: DiscountCalculation.ComputeDiscountsFunction<Config>;
}
//# sourceMappingURL=discount_calculation.d.ts.map