import type { Context } from '../context.js';
import type { Currency, TimeRange } from './types.js';
import type { Decimal, _ConfigApplicationContext } from '../../stdlib/index.js';
/** @public */
export declare namespace Prorations {
    /** @public */
    type PricingTierMode = 'graduated' | 'volume';
    /** @public */
    type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
    /** @public */
    type PriceType = 'one_time' | 'recurring';
    /** @public */
    type PricingScheme = 'per_unit' | 'tiered';
    /** @public */
    type UsageType = 'licensed' | 'metered';
    /** @public */
    type ItemType = 'credit' | 'debit';
    /**
     * The result of the prorations extension.
     * @public
     */
    interface ProrateItemsResult {
        /** The items with computed proration factors. */
        items: ItemWithProration[];
    }
    /**
     * An item with a computed proration factor.
     * @public
     */
    interface ItemWithProration {
        /** The unique identifier of the item, matching a key from the input. */
        key: string;
        /** The computed proration factor. Positive for charges, negative for credits. */
        prorationFactor: Decimal;
        /** The displayed period for the invoice line item. */
        lineItemPeriod: TimeRange;
    }
    /**
     * The input to the prorations extension.
     * @public
     */
    interface ProrateItemsInput {
        /** The list of items that can have their proration factor and line item period modified. */
        items: ProratableItem[];
    }
    /** @public */
    type ProratableItem = ({
        customPricingUnitOverageRate: CustomPricingUnitOverageRate;
        priceKind: 'customPricingUnitOverageRate';
    } | {
        licenseFee: LicenseFee;
        priceKind: 'licenseFee';
    } | {
        otherPriceKind: string;
        priceKind: 'other';
    } | {
        price: Price;
        priceKind: 'price';
    } | {
        priceKind: 'rateCardRate';
        rateCardRate: RateCardRate;
    }) & {
        correspondingDebit?: PreviousDebit;
        currentProrationFactor: Decimal;
        isProration: boolean;
        key: string;
        priceIntervalDuration: number;
        servicePeriod: TimeRange;
        type: ItemType;
    };
    /**
     * Information about a previous debit that a credit item offsets.
     * @public
     */
    interface PreviousDebit {
        /** The service period of the corresponding debit. */
        servicePeriod: TimeRange;
    }
    /** @public */
    interface CustomPricingUnitOverageRate {
        id: string;
        metadata: Record<string, string>;
        rateCard: RateCard;
        customPricingUnit: string;
        unitAmount: Decimal;
    }
    /** @public */
    interface RateCard {
        id: string;
        currency: Currency;
    }
    /** @public */
    interface RateCardRate {
        id: string;
        metadata: Record<string, string>;
        rateCard: RateCard;
        tieringMode?: PricingTierMode;
        tiers: RateCardRateTier[];
        unitAmount?: Decimal;
    }
    /** @public */
    interface RateCardRateTier {
        flatAmount?: Decimal;
        unitAmount?: Decimal;
        upTo?: Decimal;
    }
    /** @public */
    interface LicenseFee {
        id: string;
        lookupKey?: string;
        metadata: Record<string, string>;
        serviceInterval: RecurringPriceInterval;
        serviceIntervalCount: number;
        tieringMode?: PricingTierMode;
        tiers: LicenseFeeTier[];
        currency: Currency;
        unitAmount?: Decimal;
    }
    /** @public */
    interface LicenseFeeTier {
        flatAmount?: Decimal;
        unitAmount?: Decimal;
        upTo?: Decimal;
    }
    /** @public */
    interface Price {
        id: string;
        product: Product;
        recurring?: RecurringPrice;
        billingScheme: PricingScheme;
        tiers: PriceTier[];
        type: PriceType;
        tiersMode?: PricingTierMode;
        metadata: Record<string, string>;
        currency: Currency;
        unitAmount?: Decimal;
    }
    /** @public */
    interface PriceTier {
        flatAmount?: Decimal;
        unitAmount?: Decimal;
        upTo?: number;
    }
    /** @public */
    interface RecurringPrice {
        interval: RecurringPriceInterval;
        intervalCount: number;
        usageType?: UsageType;
        meter?: string;
    }
    /** @public */
    interface Product {
        id: string;
        name: string;
        metadata: Record<string, string>;
    }
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    function prepareArgsProrateItems(proto: unknown): ProrateItemsInput;
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    function prepareResultProrateItems(result: ProrateItemsResult): ProrateItemsResult;
    /** @internal */
    function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { prorateItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    const prepareArgs: typeof prepareArgsProrateItems;
    /**
     * @public
     * @deprecated Platform dispatch handles wire/SDK conversion.
     */
    const prepareResult: typeof prepareResultProrateItems;
    /**
     * Calculates prorated amounts for subscription items when changes occur mid-billing period. The script receives the invoice items, then returns computed proration factors for each item.
     * @public
     */
    type ProrateItemsFunction<Config> = (request: ProrateItemsInput, config: Config, context: Context) => ProrateItemsResult;
}
/**
 * @example
 * ```ts
 * import type { Billing, Context } from '@stripe/extensibility-sdk';
 *
 * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
 * interface MyProrationsConfig {}
 *
 * export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
 *   prorateItems(
 *     _request: Billing.Prorations.ProrateItemsInput,
 *     _config: MyProrationsConfig,
 *     _context: Context
 *   ) {
 *     // TODO: implement your proration logic here
 *
 *     return {
 *       items: [],
 *     };
 *   }
 * }
 *
 * ```
 * @public
 */
export interface Prorations<Config> {
    prorateItems: Prorations.ProrateItemsFunction<Config>;
}
//# sourceMappingURL=prorations.d.ts.map