import { CheckoutInitParams, CheckoutError, CheckoutErrorType, LocalOrderData, CartSummaryItem, ExtractedAmountInfo } from '../types';
import { CartItem } from '../../../modules/Cart/types';
import { PaymentItemInput } from '../../../modules/Payment/types';
/**
 * 验证结账数据
 */
export declare function validateCheckoutData(params: CheckoutInitParams): {
    valid: boolean;
    errors: string[];
};
/**
 * 创建结账错误对象
 */
export declare function createCheckoutError(type: CheckoutErrorType, message: string, details?: any): CheckoutError;
/**
 * 格式化金额
 */
export declare function formatAmount(amount: string | number): string;
/**
 * 验证金额
 */
export declare function validateAmount(amount: string | number): boolean;
/**
 * 生成唯一订单ID
 */
export declare function generateOrderId(prefix?: string): string;
/**
 * 检查是否为有效的支付方式代码
 */
export declare function isValidPaymentMethodCode(code: string): boolean;
/**
 * 安全地解析JSON
 */
export declare function safeJsonParse<T>(jsonString: string, defaultValue: T): T;
/**
 * 深度克隆对象
 */
export declare function deepClone<T>(obj: T): T;
/**
 * 防抖函数
 */
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
 * 节流函数
 */
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
 * 重试函数
 */
export declare function retry<T>(fn: () => Promise<T>, maxAttempts?: number, delay?: number): Promise<T>;
/**
 * 检查对象是否为空
 */
export declare function isEmpty(obj: any): boolean;
/**
 * 获取错误消息
 */
export declare function getErrorMessage(error: unknown): string;
/**
 * 检查是否为生产环境
 */
export declare function isProduction(): boolean;
/**
 * 日志记录器
 */
export declare const logger: {
    info: (message: string, ...args: any[]) => void;
    warn: (message: string, ...args: any[]) => void;
    error: (message: string, ...args: any[]) => void;
    debug: (message: string, ...args: any[]) => void;
};
/**
 * 验证本地订单数据
 */
export declare function validateLocalOrderData(orderData: LocalOrderData): {
    valid: boolean;
    errors: string[];
};
/**
 * 生成本地订单ID
 */
export declare function generateLocalOrderId(): string;
/**
 * 格式化日期时间为 YYYY-MM-DD hh:mm:ss 格式
 *
 * @param date 要格式化的日期对象
 * @returns 格式化后的日期时间字符串
 */
export declare function formatDateTime(date: Date): string;
/**
 * 从购物车小计数据中提取金额信息
 */
export declare function extractAmountFromCartSummary(cartSummary: CartSummaryItem[]): ExtractedAmountInfo;
/**
 * 计算购物车总金额
 */
export declare function calculateTotalAmount(cartItems: CartItem[]): string;
/**
 * 判断订单ID是否为本地生成的虚拟ID
 *
 * @param orderId 订单ID
 * @returns true 表示是虚拟ID，false 表示是真实的后端ID
 */
export declare function isVirtualOrderId(orderId: string): boolean;
/**
 * 判断支付方式是否需要同步订单到后端
 *
 * 现金支付(CASHMANUAL)和自定义支付不需要同步，其他支付方式需要同步
 *
 * @param paymentCode 支付方式代码
 * @param paymentType 支付方式类型
 * @returns 是否需要同步订单
 */
export declare function shouldSyncOrderForPayment(paymentCode: string, paymentType: string): boolean;
/**
 * 判断是否为现金支付
 *
 * @param paymentCode 支付方式代码
 * @param paymentType 支付方式类型
 * @returns 是否为现金支付
 */
export declare function isCashPayment(paymentItem: PaymentItemInput): boolean;
