import type { DglabSocketDeviceType } from '../base/types'; /** * V3 服务端帧 */ export type V3ServerFrame = V3BindFrame | V3MessageFrame | V3BreakFrame | V3ErrorFrame | V3HeartbeatFrame; /** * V3 绑定流程帧 */ export interface V3BindFrame { type: 'bind'; clientId: string; targetId?: string; message?: string; } /** * V3 消息帧 */ export interface V3MessageFrame { type: 'msg' | string | number; clientId?: string; targetId?: string; message?: string; channel?: number | string; strength?: number; [key: string]: unknown; } /** * V3 断开帧 */ export interface V3BreakFrame { type: 'break'; clientId?: string; targetId?: string; message?: string; } /** * V3 错误帧 */ export interface V3ErrorFrame { type: 'error'; message?: string; } /** * V3 心跳帧 */ export interface V3HeartbeatFrame { type: 'heartbeat'; } /** * V3 旧协议命令 */ export interface V3LegacyCommand { type: string | number; message: string; channel?: number | string; time?: number; strength?: number; [key: string]: unknown; } /** * V3 通道定义 * - A: A 通道 * - B: B 通道 */ export declare enum V3Channel { A = 1, B = 2 } export type V3WaveChannel = 'A' | 'B'; /** * V3 单设备信息 */ export interface V3DeviceInfo { type: DglabSocketDeviceType.COYOTE_030; props?: { strength?: { A?: number; B?: number; }; softLimit?: { A?: number; B?: number; }; [key: string]: unknown; }; } /** * V3 单设备事件 */ export type V3DeviceEventPayload = V3DeviceInfo | (Partial & { type: DglabSocketDeviceType.COYOTE_030; }); /** * V3 波形选项 */ export interface V3WaveOptions { channel: V3WaveChannel; time: number; data: string | string[]; }