import { Control } from '../controls/Control'; import { ControlInput } from '../controls/ControlInput'; import { ControlResponseBuilder } from '../responseGeneration/ControlResponseBuilder'; import { LiteralContentPayload, RequestChangedValueByListPayload, RequestChangedValuePayload, RequestRemovedValueByListActPayload, RequestValueByListPayload, RequestValuePayload, SuggestActionPayload, ValueSetPayload } from './PayloadTypes'; import { SystemAct } from './SystemAct'; /** * Base type for System Acts that 'take the initiative'. * * An act is 'taking the initiative' if it represents a direct question or otherwise encourages the user to continue the conversation. * * Examples: * * RequestValueAct is-a InitiativeAct. Sample prompt: "How many ducks?" (an explicit question requesting a response) * * NextTaskAct is-a InitiativeAct. Sample prompt: "Next task please." (this is explicit encouragement to continue) * * Usage: * * Introduce a new InitiativeAct for any behavior that is not precisely captured by existing acts. * The is no restriction on creating as many act types as necessary for a new control or skill * * * An InitiativeAct is not restricted to only represent initiative. It is valid * to represent both initiative and some content if they are fundamentally connected. * However, it is usual to define separate acts if they can reasonably be used in isolation. * * Framework behavior: * * The framework requires that every turn includes exactly one InitiativeAct except for * terminal turns that stop the user's session. (by setting ControlResult.sessionBehavior) * * Remarks: * * Alexa certification policy requires that each turn that leaves the microphone open clearly prompts * the user to reply or continue. Hence an initiative act must always be present and rendered clearly. * * If Alexa's reply doesn't not explicitly encourage the user to continue the conversation, the session must be closed. */ export declare abstract class InitiativeAct extends SystemAct { constructor(control: Control); } /** * The APL document is providing the initiative by offering input widgets. * * Use this act if, and only if, * 1. a control received touch input * 2. the APL document has input widgets and the user clearly knows they should press something * 3. it is desirable to avoid disrupting the user with voice while they interact with the * screen. */ export declare class ActiveAPLInitiativeAct extends InitiativeAct { render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Asks the user to provide a value. * * Default rendering (en-US): "What value for (renderedTarget)?" for both prompt & reprompt * * Usage: * * If the system already has a value from the user it may be preferable to issue a `RequestChangedValueAct` * which is more specific to that case. * * Typically issued when a Control gains the initiative for the first time and requests a value for the first time. */ export declare class RequestValueAct extends InitiativeAct { payload: RequestValuePayload; constructor(control: Control, payload?: RequestValuePayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Asks the user to provide a new/updated value. * * Default rendering (en-US): "What is the new value for (renderedTarget)?" for both * prompt & reprompt * * Usage: * * Typically issued in response to the user saying they want to change a value, e.g. "U: Please change the event date." * */ export declare class RequestChangedValueAct extends InitiativeAct { payload: RequestChangedValuePayload; constructor(control: Control, payload: RequestChangedValuePayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Asks the user to provide a value by speaking and showing items in the form of a list. * * Default rendering (en-US): "What value for (renderedTarget)? Choices include * (renderedChoices)." for both prompt & reprompt * * Usage: * * Typically issued when a Control gains the initiative for the first time and requests a value for the first time. * * If the system already has a value from the user it may be preferable to issue a `RequestChangedValueAct` * which is more specific to that case. */ export declare class RequestValueByListAct extends InitiativeAct { payload: RequestValueByListPayload; constructor(control: Control, payload: RequestValueByListPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Asks the user to provide a new/updated value by speaking and showing items in the form of a list. * * Default rendering (en-US): "What is the new value for (renderedTarget)? Choices include * (renderedChoices)." for both prompt & reprompt * * Usage: * * Typically issued when a Control gains the initiative for the first time and requests a value for the first time. * * If the system already has a value from the user it may be preferable to issue a `RequestChangedValueAct` * which is more specific to that case. */ export declare class RequestChangedValueByListAct extends InitiativeAct { payload: RequestChangedValueByListPayload; constructor(control: Control, payload: RequestChangedValueByListPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class RequestRemovedValueByListAct extends InitiativeAct { payload: RequestRemovedValueByListActPayload; constructor(control: Control, payload: RequestRemovedValueByListActPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * An initiative act that asks the user if a value is correct. * * Default rendering (en-US): "Was that [value]?" for both prompt & reprompt */ export declare class ConfirmValueAct extends InitiativeAct { payload: ValueSetPayload; constructor(control: Control, payload: ValueSetPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * An initiative act that defines literal prompt and reprompt fragments. * * Default rendering: "[this.payload.promptFragment]?" for both prompt & reprompt * * Usage: * * Use LiteralInitiativeAct only in simple situations where it would be annoying * to create a new custom act only to have a single way to render it. * * In contrast, specific initiative acts convey information more clearly, * maintain controller/view separation and can often be reused in additional scenarios. */ export declare class LiteralInitiativeAct extends InitiativeAct { payload: LiteralContentPayload; constructor(control: Control, payload: LiteralContentPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * An initiative act that suggests a specific value with a asks yes/no question. * * Default (en-US): "Did you perhaps mean [this.payload.value]?" for both prompt and reprompt */ export declare class SuggestValueAct extends InitiativeAct { payload: ValueSetPayload; constructor(control: Control, payload: ValueSetPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class SuggestActionAct extends InitiativeAct { payload: SuggestActionPayload; constructor(control: Control, payload?: SuggestActionPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } //# sourceMappingURL=InitiativeActs.d.ts.map