import type React from 'react';
import type { BaseResponsiveProps } from '../../../responsive/type';
export declare type DeviceKind = 'smart' | 'dumb' | 'integrated';
export declare type DeviceLinkStatus = 'linked' | 'unlinked' | string;
export declare type DeviceOnlineStatus = 'online' | 'offline' | 'unknown' | string;
/** 多语言字段，后端可能返回字符串或语言字典。 */
export declare type I18nText = string | {
    original?: string;
    'zh-CN'?: string;
    'zh-HK'?: string;
    en?: string;
    ja?: string;
    pt?: string;
    [key: string]: any;
};
export declare type LangDict = {
    original?: string;
    en?: string;
    'zh-CN'?: string;
    'zh-HK'?: string;
    ja?: string;
    pt?: string;
};
export interface SaasAppPeripheralProps extends BaseResponsiveProps {
    className?: string;
    style?: React.CSSProperties;
    showBack?: boolean;
    onBack?: () => void;
    onManageProfiles?: () => void;
    onTest?: (payload: PeripheralTestPayload) => void | Promise<void>;
}
export interface WorkAreaItem {
    id: number;
    tenant_id?: number;
    name: I18nText;
    description?: I18nText;
    sort: number;
    smart_devices_count?: number;
    dumb_devices_count?: number;
    integrated_devices_count?: number;
    created_at?: string;
    updated_at?: string;
}
export interface DeviceBrandItem {
    id: number;
    code: string;
    name: I18nText;
    description?: I18nText;
    website?: string;
    status?: string;
    created_at?: string;
    updated_at?: string;
    deleted_at?: string | null;
}
export interface DeviceTypeItem {
    id: number;
    kind: DeviceKind;
    code: string;
    icon?: string | null;
    name: I18nText;
    description?: I18nText;
    status?: string;
    sort?: number;
    active_models?: DeviceModelItem[];
}
export interface DeviceModelItem {
    id: number;
    brand_code?: string;
    type_code: string;
    type?: DeviceTypeItem;
    code: string;
    name: I18nText;
    description?: I18nText;
    data?: {
        profile_structure?: {
            required?: boolean;
            tabs?: unknown[];
        };
        connection_types?: string[];
        [key: string]: unknown;
    } | null;
    status?: string;
    sort?: number;
    active_profiles?: DeviceProfileItem[];
    brand?: DeviceBrandItem;
}
export interface DeviceProfileItem {
    id: number;
    model_code?: string;
    template_code?: string;
    name?: I18nText;
    description?: I18nText;
    setting?: Record<string, unknown> | null;
    status?: string;
}
export interface DeviceItem {
    id: number;
    tenant_id?: number;
    workarea_id?: number;
    type_kind: DeviceKind;
    type_code: string;
    model_code: string;
    profile_id?: number | null;
    number?: string;
    name: I18nText;
    data?: Record<string, unknown> | null;
    setting?: Record<string, unknown> | null;
    link?: DeviceLinkStatus;
    status?: DeviceOnlineStatus;
    sort?: number;
    last_seen?: string;
    created_at?: string;
    updated_at?: string;
    type?: DeviceTypeItem;
    model?: DeviceModelItem;
    profile?: DeviceProfileItem | null;
    workarea?: WorkAreaItem;
}
export interface DeviceConnectionConfig {
    connection_ip?: string;
    connection_type?: string;
    connection_method?: string;
    [key: string]: unknown;
}
export declare type PeripheralConnectType = 'USB' | 'ETHERNET' | 'WIFI' | 'BLUETOOTH';
export declare type PeripheralConnectStatus = 'CONNECTED' | 'NOT_CONNECT';
export declare type PeripheralUsage = 'label' | 'wristband';
export declare type PeripheralPrintUsage = PeripheralUsage;
export declare type RuntimeConnectionStatus = 'connected' | 'connecting' | 'disconnected' | 'select';
export interface PeripheralConnectTarget {
    uuid?: string;
    ip?: string;
}
export interface PeripheralConnectParams extends PeripheralConnectTarget {
    deviceBrand: string;
    deviceType: string;
    connectType: PeripheralConnectType;
}
export interface PeripheralFindListParams {
    deviceBrand: string;
    deviceType: string;
    connectType: PeripheralConnectType;
    connectStatus: PeripheralConnectStatus;
    uuid?: string;
}
/** 外设插件返回的物理设备结构，保持为宿主插件的最小兼容子集。 */
export interface PeripheralDevice {
    uuid: string;
    ip?: string;
    port?: string;
    mac?: string;
    is_connect: boolean;
    name: string;
    connect_type: PeripheralConnectType;
    status_code: string;
    metadata?: Record<string, unknown>;
    [key: string]: unknown;
}
export interface PeripheralRuntimeResult<T> {
    code?: string | number;
    message?: string;
    data?: T;
}
export interface PeripheralPlugin {
    findList?: (params: PeripheralFindListParams) => Promise<PeripheralRuntimeResult<PeripheralDevice[]>>;
    connect?: (params: PeripheralConnectParams) => Promise<PeripheralRuntimeResult<PeripheralDevice>>;
    disconnect?: (params: {
        uuid: string;
    }) => Promise<PeripheralRuntimeResult<{
        uuid: string;
    }>>;
}
export interface MarkDeviceConnectionConnectedPayload {
    _target_device: {
        data: Record<string, unknown>;
    };
}
export interface LocalPeripheralBinding {
    id: string;
    connection_id: number;
    source_device_id: number;
    target_device_id: number;
    type_code: string;
    model_code?: string;
    physical_uuid?: string;
    physical_device?: PeripheralDevice;
    peripheral_usage?: PeripheralUsage;
    is_connect: boolean;
    updated_at: number;
    payload: DeviceConnectionItem;
}
export interface PeripheralStatusChangePayload {
    event?: PeripheralRuntimeResult<PeripheralDevice>;
    data?: PeripheralDevice;
    binding?: LocalPeripheralBinding;
}
/** Test 按钮对外透出的通用载荷，不绑定 POS 侧的打印机模型。 */
export interface PeripheralTestPayload {
    connection: DeviceConnectionItem;
    targetDevice?: DeviceItem | null;
    physicalDevice?: PeripheralDevice;
    peripheralUsage?: PeripheralUsage;
}
/** 单张卡片的临时运行态，只描述当前渲染周期内的连接/选择状态。 */
export interface RuntimeConnectionState {
    status: RuntimeConnectionStatus;
    candidates?: PeripheralDevice[];
    physicalDevice?: PeripheralDevice;
    loading?: boolean;
}
/** 页面最终渲染的行模型：云端 connection/peripheral 与本地 physical/usage 隔离。 */
export interface PeripheralConnectionRow {
    /** 连接关系 ID，所有连接/断开/编辑接口都以它为主键。 */
    id: number;
    /** 外设设备 ID，用于已连接设备过滤和展示。 */
    peripheralId: number;
    /** 连接列表接口的原始 item，字段保持后端命名。 */
    connection: DeviceConnectionItem;
    /** 外设设备原始数据，即 connection.target_device。 */
    peripheral?: DeviceItem | null;
    /** 插件或本地缓存得到的物理设备状态，接口刷新不覆盖它。 */
    physical?: PeripheralDevice;
    /** 标签打印机的业务用途，选择后独立保存到本地。 */
    usage?: PeripheralUsage;
}
/** 多物理设备候选时的选择弹窗状态。 */
export interface PhysicalDeviceSelectState {
    row: PeripheralConnectionRow;
    devices: PeripheralDevice[];
}
/** 标签/手环用途选择弹窗状态。 */
export interface PrintUsageState {
    row: PeripheralConnectionRow;
    physicalDevice: PeripheralDevice | PeripheralConnectTarget;
}
/** 设备连接业务类型；当前接口仅启用哑设备连接。 */
export declare type DeviceConnectionType = 'dumb';
export interface DeviceConnectionItem {
    id: number;
    tenant_id?: number;
    type?: DeviceConnectionType;
    source_device_id: number;
    target_device_id: number;
    config?: DeviceConnectionConfig | null;
    profile_ids?: number[];
    status?: string | null;
    created_at?: string;
    updated_at?: string;
    source_device?: DeviceItem | null;
    target_device?: DeviceItem | null;
    profiles?: DeviceProfileItem[];
}
export interface ListDeviceParams {
    with?: string[];
    workarea_id?: number;
    type_kind?: DeviceKind;
    profile_id?: number;
}
export interface ListDeviceConnectionParams {
    type?: DeviceConnectionType;
    source_device_id?: number;
    target_device_id?: number;
    with?: string[];
}
export interface CreateConnectionTargetDevicePayload {
    workarea_id: number;
    model_code: string;
    name: LangDict;
}
export interface CreateDeviceConnectionPayload {
    type: DeviceConnectionType;
    source_device_id: number;
    target_device_id?: number;
    target_device?: CreateConnectionTargetDevicePayload;
    target_device_action: 'existing' | 'new';
    config: DeviceConnectionConfig;
    profile_ids: number[];
}
export interface UpdateDeviceConnectionPayload {
    config: DeviceConnectionConfig;
    profile_ids: number[];
}
export interface UpdateDevicePayload {
    workarea_id: number;
    profile_id: number | null;
    name: LangDict;
}
export interface DeviceRow {
    id: number;
    name: string;
    typeName: string;
    modelName: string;
    profileName: string;
    link: DeviceLinkStatus;
    status: DeviceOnlineStatus;
    typeCode: string;
    modelCode: string;
    _raw: DeviceItem;
}
export declare const EMPTY_I18N: LangDict;
export declare const toLangDict: (val?: I18nText) => LangDict;
export declare const validateI18nRequired: (message: string) => (_rule: unknown, value: I18nText | undefined) => Promise<void>;
