import { Source, ID, message } from '../sources/source'; import { camera } from './camera'; import { InitObject, DomoModule } from '../lib/module'; import { ConfigLoader } from '../lib/load'; import * as persistence from '../persistence/persistence'; declare type TransformFunction = (cb: (value: any) => void, transform?: (value: string) => string) => any; export declare type DeviceOptions = { transform?: string | TransformFunction; camera?: camera; others?: { [K in string]: any; }; }; export declare class CustomDeviceType { name: string; constructor(name: string); toString(): string; } export declare type DeviceType = 'device' | 'sensor' | 'variable' | 'group' | 'camera' | 'relay' | CustomDeviceType; export declare type WidgetType = 'text' | 'toggle'; export declare type EventType = "change"; export declare abstract class GenericDevice implements DomoModule { [x: string]: any; name: string; path: string; id: ID; attribute: string; source: Source; type: DeviceType; widget: WidgetType; state: string; previousState: string; persistence: persistence.mongoDB; persistStates: boolean; lastUpdateDate: Date; tags: string; debugMode: boolean; transform?: (value: any) => any; stateHasBeenSet: boolean; constructor(source: Source, type: DeviceType, instancePath: string, id: ID, attribute: string, name: string, initObject: InitObject, options?: DeviceOptions); restoreStateFromDB(callback: (err: Error, success: boolean) => void): void; backupStateToDB(callback: (err: Error, success: boolean) => void): void; abstract createInstance(configLoader: ConfigLoader, instanceFullname: string, initObject: InitObject): DomoModule; release(): void; setState(newState: string | Date, callback: (err: Error) => void): void; getState(): string; getPreviousState(): string; private eventListener; on(event: EventType, callback: (msg: message) => void): this; once(event: EventType, callback: (msg: message) => void): this; removeListener(event: EventType, callback: (msg: message) => void): this; matchTag(tag: string): boolean; } export {};