import { IControlInput } from './IControlInput'; import { IControlResultBuilder } from './IControlResultBuilder'; /** * Defines a Control object that manages state and dialog behavior. * * This is the minimal definition required by the Runtime (ControlHandler) * See `Control` for the actual class used by Control implementations. */ export interface IControl { id: string; /** * Determines if the Control or one of its children can consume the request. */ canHandle(input: IControlInput): boolean | Promise; /** * Handles the request. */ handle(input: IControlInput, resultBuilder: IControlResultBuilder): void | Promise; /** * Determines if the Control can take the initiative. */ canTakeInitiative(input: IControlInput): boolean | Promise; /** * Takes the initiative by adding an InitiativeAct to the result. */ takeInitiative(input: IControlInput, resultBuilder: IControlResultBuilder): void | Promise; /** TODO */ reestablishState(state: any, controlStateMap: { [index: string]: any; }): void; /** * Gets the Control's state as an object that is serializable. * * Framework behavior: * - The object will be serialized via a call to `JSON.stringify(obj)` */ getSerializableState(): any; /** * Sets the state from a serialized state object */ setSerializableState(serializedState: any): void; } //# sourceMappingURL=IControl.d.ts.map