import { Control } from '../controls/Control'; import { ControlInput } from '../controls/ControlInput'; import { ControlResponseBuilder } from '../responseGeneration/ControlResponseBuilder'; import { InvalidValuePayload, LiteralContentPayload, ProblematicInputValuePayload, ValueAddedPayload, ValueChangedPayload, ValueClearedPayload, ValueRemovedPayload, ValueSetPayload, CanFulfillIntentPayload } from './PayloadTypes'; import { SystemAct } from './SystemAct'; /** * Base type for System Acts that provides 'content' or 'simple information'. * * An act is 'content' if it does not directly encourage the user to reply. * * Examples: * * ApologyAct is-a ContentAct. Sample prompt: "A: Sorry, my mistake." (simple information, no encouragement to continue) * * WeatherAct is-a ContentAct. Sample prompt: "A: The weather will be warm." (business content, no encouragement to continue) * * 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`. */ export declare abstract class ContentAct extends SystemAct { constructor(control: Control); } /** * Communicates that an input cannot be consumed. * * Typically, 'invalid input' means that the input cannot be consumed given the current state of the skill and the input will be ignored. * * Default rendering (en-US): "Sorry, (renderedReason)." * * Usage: * * Controls should override the render and provide more detail about the specific problem by rendering * the reasonCode. * * Example: * * A list control offers three options but the user says "The fourth one". */ export declare class UnusableInputValueAct extends ContentAct { readonly payload: ProblematicInputValuePayload; constructor(control: Control, payload: ProblematicInputValuePayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that input was received an interpreted successfully. * * Default rendering (en-US): "OK." * * Usage: * * Often a more specific act (e.g. ValueSetAct) will be used to describe more * precisely what was understood and acted upon. * * Do not issue `AcknowledgeInputAct` if another act has been issued that * also conveys that the user's input was received and interpreted successfully. */ export declare class AcknowledgeInputAct extends ContentAct { constructor(control: Control); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that a value was received and recorded. * * This act does not imply that the value is valid or otherwise meets * any requirements. It merely communicates successful reception. * * This act implies that there was no significant ambiguity. In situations were * ambiguity is present a more specific act should be created and issued to communicate * that clearly to the user. * * Default rendering (en-US): "OK, (value)". * * Usage: * * If received value overrides a value previously obtained from the user * it is preferable to issue a `ValueChangedAct` which is more specific to that case. * * Typically issued when a Control elicits a value from the user and the * user replies directly. * * Also issued when the user provides data on their own initiative which * can be interpreted unambiguously, e.g. "U: Send it on Thursday". */ export declare class ValueSetAct extends ContentAct { readonly payload: ValueSetPayload; constructor(control: Control, payload: ValueSetPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that a value was received and recorded as a change to previously obtained information. * * This act does not imply that the value is valid or otherwise meets * any requirements. It merely communicates successful reception. * * This act implies that there was no significant ambiguity. In situations were * ambiguity is present a more specific act should be created and issued to communicate * that clearly to the user. * * Default rendering (en-US): "OK, updated to (value)." * * Usage: * * Typically issued when a user explicitly changes a value, e.g. 'actually change it to tomorrow'. * * Also issued when the user provides data on their own initiative which override previous data * e.g. "U: Send it Monday" ... then later ... "U: Send it on Thursday". */ export declare class ValueChangedAct extends ContentAct { payload: ValueChangedPayload; constructor(control: Control, payload: ValueChangedPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that a value is invalid. * * Typically, 'invalid' means that a value cannot be used in business functions with the implication that it * must be corrected or retracted before the user can complete their task. * * Note that a value can become invalid due to external causes as the validation rules can access other controls and context. * * Default rendering (en-US): "Sorry, (renderedReason)." * * Usage: * * Controls should override the render and provide more detail about the specific problem by rendering * the reasonCode. */ export declare class InvalidValueAct extends ContentAct { readonly payload: InvalidValuePayload; constructor(control: Control, payload: InvalidValuePayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that a value has been positively confirmed. * * Default rendering (en-US): "Great." * * Usage: * * Typically issued when the system issued a ConfirmValueAct and received an `affirm` in reply. * * May also be issued in cases where the user repeats a value which is interpreted as confirmation. * * Example: * ``` * "A: Did you say three?" ConfirmValueAct * "U: Yes" GeneralControlIntent( feedback = affirm ) * "A: Great. ." ValueConfirmedAct, * ``` */ export declare class ValueConfirmedAct extends ContentAct { payload: ValueSetPayload; constructor(control: Control, payload: ValueSetPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that a value has been disconfirmed. * * Default rendering (en-US): "My mistake." * * Usage: * * Typically issued when the system issued a ConfirmValueAct and received a `disaffirm` in reply. * * Also issued when the users realizes that a value is incorrect and corrects it directly "No, that should be three" * * Example: * ``` * "A: Did you say three?" ConfirmValueAct * "U: No." GeneralControlIntent( feedback = disaffirm ) * "A: My mistake. ." ValueDisconfirmedAct, * ``` */ export declare class ValueDisconfirmedAct extends ContentAct { payload: ValueSetPayload; constructor(control: Control, payload: ValueSetPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that the user's input could not be understood. * * Default rendering (en-US): "Sorry I didn't understand that." * * Usage: * * Typically issued in response to AMAZON.FallbackIntent. * * May also be issued as a generic response when an input doesn't make any * sense given the state of the skill. * * Example 1: * "U: " AMAZON.FallbackIntent * "A: Sorry I didn't understand that." * * Example 2: * "U: change Bob to Frank" ... but no Control is tracking a value of "Bob" * "A: Sorry I didn't understand that." */ export declare class NonUnderstandingAct extends ContentAct { constructor(control: Control); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates that the skill was launched. * * Default rendering (en-US): "Welcome." */ export declare class LaunchAct extends ContentAct { constructor(control: Control); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } /** * Communicates an arbitrary message to the user. * * Default: * * The repromptFragment defaults to be identical to promptFragment. * * Usage: * * Use LiteralContentAct 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 content acts convey information more clearly, * maintain controller/view separation and can often be reused in additional scenarios. * */ export declare class LiteralContentAct extends ContentAct { payload: LiteralContentPayload; constructor(control: Control, payload: LiteralContentPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class ValueAddedAct extends ContentAct { readonly payload: ValueAddedPayload; constructor(control: Control, payload: ValueAddedPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class ValueRemovedAct extends ContentAct { readonly payload: ValueRemovedPayload; constructor(control: Control, payload: ValueRemovedPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class ValueClearedAct extends ContentAct { readonly payload: ValueClearedPayload; constructor(control: Control, payload: ValueClearedPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class InvalidRemoveValueAct extends ContentAct { readonly payload: InvalidValuePayload; constructor(control: Control, payload: InvalidValuePayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } export declare class CanFulfillIntentAct extends ContentAct { payload: CanFulfillIntentPayload; constructor(control: Control, payload: CanFulfillIntentPayload); render(input: ControlInput, controlResponseBuilder: ControlResponseBuilder): void; } //# sourceMappingURL=ContentActs.d.ts.map