export interface PayLogContext { /** 渠道 */ channel?: string; /** 订单ID */ orderId?: string | number; /** 设备ID */ deviceId?: string | number; /** 支付类型:PAYO / WINDCAVE / LINKLY / TYRO */ paymentType?: string; /** 交易记录号 */ transactionNumber?: string; /** 模式:pay / refund / query */ mode?: string; /** 其他扩展信息 */ extra?: Record; } declare class PayLog { private static instance; private sessionKey; private context; private constructor(); static getInstance(): PayLog; /** * 初始化一次交易会话 * - 生成唯一 sessionKey * - 恢复上报 localStorage 中残留的旧日志 * - 接受部分 context(后续可通过 setContext 补充) */ init(context?: Partial): void; /** * 补充/更新上下文信息 * 新值覆盖旧值,extra 做浅合并 */ setContext(partial: Partial): void; /** * 记录一条日志 */ log(title: string, data?: any): void; /** * 销毁一次交易会话 */ destroy(): void; } declare const payLog: PayLog; export default payLog; /** * 在根组件中使用,管理 PayLog 生命周期 * - mount 时 init(+ 恢复上报残留日志) * - unmount 时 destroy */ export declare function usePayLog(context?: Partial): { log: (title: string, data?: any) => void; setContext: (partial: Partial) => void; };