import { Action, ActionSuccess } from "../Action/Action"; import { ActionHolder } from "./ActionHolder"; import { DynamicValue } from "../DynamicValue"; import { DynamicValueHolder } from "./DynamicValueClient"; /** * Devices are a semantic and the recommended way of organizing [[Action]]s and [[DynamicValue]]s. * They represent an external device and hold all of the actions and values associated with it. * * @example * ```typescript * const device = new Device({ * name:"test", * actions:[ * new HttpAction({ * name:"on", * method:"GET", * base:"http://device.ip/", * path:"turnOn" * }) * ] * }) * device.run("on") //runs the HttpAction * device.getAction("on") //returns HttpAction {name:"on", method:"GET",base:"http://device.ip/",path:"turnOn",url:"http://device.ip/turnOn"} * ``` */ export declare class Device implements ActionHolder, DynamicValueHolder { name: string; actions: Action[]; dynamicValues: DynamicValue[]; constructor({ name, actions, dynamicValues }: { name: string; actions: Action[]; dynamicValues?: DynamicValue[]; }); run(action: string): Promise; getAction(name: string): Action; getDynamicValue(name: string): DynamicValue; }