@constructorfleet/ultimate-govee
Version:
Library for interacting with Govee devices written in Typescript.
81 lines • 3.09 kB
TypeScript
import { ClassConstructor } from 'class-transformer';
import { BehaviorSubject } from 'rxjs';
import { Optional } from '../../common';
import { DeviceExtensionProperties, DeviceExternalResources, GoveeDevice, GoveeDeviceStatus, Product } from '../../data';
import { Version } from './version.info';
export declare class ProductModel {
readonly category: string;
readonly group: string;
readonly modelName: string;
readonly ic: number;
readonly goodsType: number;
constructor(category: string, group: string, modelName: string, ic: number, goodsType: number);
}
type ClassToType<Clz extends object | Record<string, unknown>> = Partial<{
[K in keyof Clz]: Clz[K] extends object | Record<string, unknown> ? ClassToType<Clz[K]> : Clz[K];
}>;
export type DeviceImageResources = Partial<ClassToType<DeviceExternalResources>>;
export type DeviceConstructorArgs = {
id: string;
name: string;
model: string;
iotTopic?: Optional<string>;
modelName: string;
ic: number;
goodsType: number;
pactCode: number;
pactType: number;
category: string;
categoryGroup: string;
version: Version;
deviceExt: ClassToType<DeviceExtensionProperties>;
} & GoveeDeviceStatus;
export declare class DeviceModel {
readonly id: string;
readonly name: string;
readonly model: string;
readonly modelName: string;
readonly iotTopic?: Optional<string>;
readonly bleAddress?: Optional<string>;
readonly ic: number;
readonly goodsType: number;
readonly pactCode: number;
readonly pactType: number;
readonly version: Version;
readonly category: string;
readonly categoryGroup: string;
readonly status: BehaviorSubject<GoveeDeviceStatus>;
readonly images?: DeviceImageResources;
constructor(args: DeviceConstructorArgs);
private product;
get productData(): Optional<ProductModel>;
set productData(product: Optional<ProductModel>);
}
export type BLEDeviceConstructorArgs = {
bleAddress: string;
bleName: string;
} & DeviceConstructorArgs;
export type BLEDevice = {
get bleAddress(): string;
bleName: string;
};
export declare const BLEDevice: <TDevice extends ClassConstructor<DeviceModel>>(device: TDevice) => ClassConstructor<DeviceModel>;
export type WiFiDeviceConstructorArgs = {
wifiAddress: string;
wifiSSID: string;
} & DeviceConstructorArgs;
export type WiFiDevice = {
get wifiAddress(): string;
get wifiSSID(): string;
};
export declare const WiFiDevice: <TDevice extends ClassConstructor<DeviceModel>>(device: TDevice) => ClassConstructor<DeviceModel>;
export type IoTDeviceConstructorArgs = {
iotTopic: string;
} & DeviceConstructorArgs;
export type IoTDevice = {
get iotTopic(): Optional<string>;
} & DeviceModel;
export declare const IoTDevice: <TDevice extends ClassConstructor<DeviceModel>>(device: TDevice) => ClassConstructor<DeviceModel>;
export declare const createDeviceModel: (device: GoveeDevice, productCategories: Record<string, Product>) => DeviceModel;
export {};
//# sourceMappingURL=devices.model.d.ts.map