import type { BookingTicketHandle } from '../types';
import type { GlobalScanHostBridge } from '../utils/createGlobalScanHostBridge';
export interface ScanResultPayload {
    code?: string;
    data?: string;
}
/**
 * 宿主注入的「扫码焦点栈」入口（acquireScanFocus）。
 * 申请焦点后只有栈顶成员的回调会被触发，返回 token.release() 用于释放焦点。
 */
export declare type SalesSdkAcquireScanFocus = (handler: (payload: ScanResultPayload) => void, options?: {
    priority?: number;
    id?: string;
}) => {
    release?: () => void;
} | undefined;
export interface UseSalesSdkGlobalScanListenerOptions {
    enabled: boolean;
    isActive: boolean;
    bookingTicket: BookingTicketHandle | null;
    /** 每次扫码时读取最新 bridge（uiHosts / cart 可能已更新） */
    bridgeFactory: () => GlobalScanHostBridge | undefined;
    /** 返回 app.pubsub；缺失时不订阅（仅在未注入焦点栈时作为回退） */
    getPubsub?: () => {
        subscribe?: (event: string, cb: (payload: ScanResultPayload) => void) => void;
        unsubscribe?: (event: string, cb: (payload: ScanResultPayload) => void) => void;
    } | null | undefined;
    /**
     * 返回宿主注入的「扫码焦点栈」入口；提供时**优先**走焦点栈，
     * 与 PisellFind 等共享同一个栈——上层（如 checkout/编辑弹窗里的 PisellFind）取得焦点时，
     * 本全局监听自动不响应，上层释放后自动恢复。缺失时回退到 getPubsub 直连订阅。
     */
    getAcquireScanFocus?: () => SalesSdkAcquireScanFocus | null | undefined;
}
/**
 * 监听原生扫码，在回调里调用 OS handleGlobalScanCode(code, bridge)。
 * 优先接入宿主「扫码焦点栈」（只有栈顶响应），未注入时回退到直连 pubsub。
 *
 * @example
 * ```tsx
 * useSalesSdkGlobalScanListener({
 *   enabled: enableGlobalScanListener,
 *   isActive,
 *   bookingTicket,
 *   bridgeFactory: () => createGlobalScanHostBridge({ ... }),
 *   getPubsub: () => app?.pubsub,
 *   getAcquireScanFocus: () => appHelper?.utils?.acquireScanFocus,
 * });
 * ```
 */
export declare function useSalesSdkGlobalScanListener(options: UseSalesSdkGlobalScanListenerOptions): void;
