/** A single API cost rule: JsonLogic `conditions` → `consumption` (number or expression). */ export interface ICostRule { conditions: Record; consumption: number | Record; hidden?: boolean; } /** First matching rule's consumption (evaluated against payload). 0 if none match, undefined if rules invalid. */ export declare function getConsumption(payload: Record, rules: ICostRule[]): number | undefined; /** Format a consumption value (trims trailing zeros). `-` for nullish, `0` for zero. */ export declare function formatConsumption(consumption: number | undefined | null, fractionDigits?: number): string; export interface PriceResult { value: number; currency: string; label: string; } export interface PriceFormatterConfig { /** Current exchange-rate map, keyed `usd-` (e.g. from a store). */ getExchange: () => Record | undefined | null; /** Current target currency, e.g. `cny`. */ getCurrency: () => string | undefined | null; /** currency code → display label/symbol. */ currencyLabels: Record; /** Fallback currency when none resolved. Default `usd`. */ defaultCurrency?: string; } export interface PriceFormatter { getPrice(payload: { value: number; currency?: string; }): PriceResult; getPriceString(payload: { value?: number; defaultValue?: number; fractionDigits?: number; }): string; getConsumptionPriceString(consumption: number | undefined | null, fractionDigits?: number): string; } /** Build currency-aware price formatters; exchange/currency/labels are injected. */ export declare function createPriceFormatter(config: PriceFormatterConfig): PriceFormatter; //# sourceMappingURL=index.d.ts.map