type SmartDeviceSchema = typeof import('@/devices/schema').fanSchema;

type SmartDevices = {
  /**
   * 此处 TS 类型定义建议以智能设备的名称作为键名赋值
   */
  fan?: import('@ray-js/panel-sdk').SmartDeviceModel<SmartDeviceSchema>;
};

declare module '@ray-js/panel-sdk' {
  export const SdmProvider: React.FC<{
    value: SmartDeviceModel<SmartDeviceSchema>;
    children: React.ReactNode;
  }>;
  export type SmartDeviceInstanceData = {
    devInfo: ReturnType<SmartDevices['fan']['getDevInfo']>;
    dpSchema: ReturnType<SmartDevices['fan']['getDpSchema']>;
    network: ReturnType<SmartDevices['fan']['getNetwork']>;
    bluetooth: ReturnType<SmartDevices['fan']['getBluetooth']>;
  };
  export function useSdmProps(): SmartDevices['fan']['model']['props'];
  export function useSdmProps<Value extends any>(
    selector: (props?: SmartDevices['fan']['model']['props']) => Value,
    equalityFn?: (a: Value, b: Value) => boolean,
  ): Value;
  export function useSdmDevice(): SmartDeviceInstanceData;
  export function useSdmDevice<Device extends any>(
    selector: (device: SmartDeviceInstanceData) => Device,
    equalityFn?: (a: Device, b: Device) => boolean,
  ): Device;
}