import React from 'react'; import type { PisellLookupProps, PisellLookupRef } from '../pisellLookup'; /** * 原生扫码事件名,对齐宿主端约定。 */ export declare const SCAN_RESULT_EVENT = "nativeScanResult"; /** * 扫码枪回传数据(对齐宿主 ScanResultPayload) * - code: 条码标识(如条码格式 / 业务字段) * - data: 扫描得到的字符串值(写入输入框的内容) */ export interface PisellFindScannerData { code: string; data: string; } /** * PisellFind Props * 继承 PisellLookup 的所有 Props,并扩展扫码枪监听相关字段。 */ export interface PisellFindProps extends PisellLookupProps { /** * 是否开启扫码枪监听 * 通过宿主 `app.pubsub.subscribe('nativeScanResult', ...)` 订阅; * 切换 false 时会 unsubscribe,停止接收事件。 * @default false */ enableScanner?: boolean; /** * 扫码枪回调 * 监听到扫码枪事件时触发,参数为原始 payload 对象(含 `data` 字段)。 * 注意:仅在 enableScanner 为 true 时才会触发。 */ onScannerData?: (data: PisellFindScannerData) => void; } /** * PisellFind Ref * 继承 PisellLookup 的所有 Ref 方法 */ export declare type PisellFindRef = PisellLookupRef; /** * PisellFind 组件 * 基于 PisellLookup 的组件内查找优化版本 * * 核心特点: * - 默认使用 button 触发器 * - 默认不显示确认按钮(输入即搜索) * - 默认开启搜索历史 * - 默认不展示结果区(结果在页面其他位置展示) * - 通过 `enableScanner` 接入扫码枪:使用宿主 `app.pubsub.subscribe(SCAN_RESULT_EVENT, ...)`, * 每次扫码直接覆盖输入框内容并触发 onSearch / onScannerData;切回 false 时自动 unsubscribe。 * * @example * ```tsx * console.log('scan:', payload.data)} * onSearch={(keyword) => filterData(keyword)} * /> * ``` */ export declare const PisellFind: React.ForwardRefExoticComponent>;