@constructorfleet/ultimate-govee
Version:
Library for interacting with Govee devices written in Typescript.
20 lines • 1.06 kB
TypeScript
import { ClassConstructor } from 'class-transformer';
import { Optional } from '../../common';
import { CommandBus, EventBus } from '@nestjs/cqrs';
import { DeviceModel } from './devices.model';
import { Device } from './device';
import { DeviceStatesType } from './devices.types';
export type GroupMatcher = RegExp | RegExp[] | true;
export type GroupMatchers = Record<string, GroupMatcher>;
export type CategoryMatchers = Record<string, GroupMatchers>;
export type FactoryType<States extends DeviceStatesType> = {
create: (device: DeviceModel, eventaBus: EventBus, commandBus: CommandBus) => Optional<Device<States>>;
};
export declare class DeviceFactory<TDevice extends Device<TStates>, TStates extends DeviceStatesType> {
private readonly typeConstructor;
private readonly matchers;
private static factories;
constructor(typeConstructor: ClassConstructor<TDevice>, matchers: CategoryMatchers);
create(device: DeviceModel, eventBus: EventBus, commandBus: CommandBus): Optional<TDevice>;
}
//# sourceMappingURL=device.factory.d.ts.map