import { Intent } from 'ask-sdk-model'; import { ControlInput } from '../controls/ControlInput'; import { MultiValueSlot } from '../intents/ValueControlIntent'; /** * Utilities to assist with input handling. */ export declare namespace InputUtil { /** * Test and assert if an object looks like an Intent. * (user-defined type guard) */ function isIntentShape(x: any): x is Intent; /** * Test if the input is a LaunchRequest. * @param input - Input */ function isLaunchRequest(input: ControlInput): boolean; /** * Test if the input is a SessionEndedRequest. * @param input - Input */ function isSessionEndedRequest(input: ControlInput): boolean; /** * Test if the input is an IntentRequest (and optionally a specific Intent). * * @param input - Input * @param expectedIntentName - a specific intent name */ function isIntent(input: ControlInput, expectedIntentName?: string): boolean; /** * Test if the input is a ValueControlIntent for the provided slotType. * @param input - Input */ function isValueControlIntent(input: ControlInput, slotType: string): boolean; /** * Test if the input is an AMAZON.FallbackIntent. * @param input - Input */ function isFallbackIntent(input: ControlInput): boolean; /** * Test if the input is an Alexa.Presentation.APL.UserEvent and has arguments. * @param input - Input */ function isAPLUserEventWithArgs(input: ControlInput): boolean; /** * Test if the input is an Alexa.Presentation.APL.UserEvent with sourceId * equal to the provided source ID. * @param input - Input */ function isAPLUserEventWithMatchingSourceId(input: ControlInput, sourceId: string): boolean; /** * Test if the input is an Alexa.Presentation.APL.UserEvent with a first * argument equal to the provided control ID. * @param input - Input * @param controlId - the expected control ID */ function isAPLUserEventWithMatchingControlId(input: ControlInput, controlId: string): boolean; /** * Test if the input is an Alexa.Presentation.APL.UserEvent with a first * argument equal to the provided control ID and total argument length equal to the provided length. * @param input - Input * @param controlId - the expected control ID * @param argLength - the expected argument length */ function isAPLUserEventWithMatchingControlIdAndArgLength(input: ControlInput, controlId: string, argLength: number): boolean; /** * Test if the feedback is 'builtin_affirm' * @param feedback - Feedback slot value ID */ function feedbackIsTrue(feedback: string | undefined): boolean; /** * Test if the feedback is 'builtin_disaffirm' * @param feedback - Feedback slot value ID */ function feedbackIsFalse(feedback: string | undefined): boolean; /** * Test if the feedback is defined * @param feedback - Feedback slot value ID */ function feedbackIsDefined(feedback: string | undefined): boolean; /** * Test if the feedback is undefined * @param feedback - Feedback slot value ID */ function feedbackIsUndefined(feedback: string | undefined): boolean; /** * Test if the feedback matches one of the provided identifiers, or is undefined. * @param feedback - Feedback slot value * @param feedbackIds - Feedback slot value IDs to match against */ function feedbackIsMatchOrUndefined(feedback: string | undefined, feedbackIds: string[]): boolean; /** * Test if the feedback is defined and matches one of the provided identifiers. * @param feedback - Feedback slot value * @param expectedValues - Feedback slot value IDs to match against */ function feedbackIsMatch(feedback: string | undefined, expectedValues: string[]): boolean; /** * Test if the slot value matches one of the provided identifiers, or is undefined. * @param slotValue - Slot value ID * @param expectedValues - Slot value IDs to match against */ function slotIsUndefinedOrMatch(slotValue: string | undefined, expectedValues: string[]): boolean; /** * Test if the action matches one of the provided identifiers, or is undefined. * @param action - Action slot value ID * @param expectedValues - Action slot value IDs to match against */ function actionIsSetOrUndefined(action: string | undefined, expectedValues: string[]): boolean; /** * Test if the action is defined and matches one of the provided identifiers. * @param action - Action slot value ID * @param expectedValues - Action slot value IDs to match against */ function actionIsMatch(action: string | undefined, expectedValues: string[]): boolean; /** * Test if the action is undefined. * @param action - Action slot value ID */ function actionIsUndefined(action: string | undefined): boolean; /** * Test if the target is defined and matches one of the provided identifiers. * @param target - Target slot value ID * @param targetIds - Target slot value IDs to match against */ function targetIsMatch(target: string | undefined, targetIds: string[]): boolean; /** * Test if the feedback is defined. * @param target - Target slot value ID */ function targetIsDefined(target: string | undefined): boolean; /** * Test if the feedback is undefined. * @param target - Target slot value ID */ function targetIsUndefined(target: string | undefined): boolean; /** * Test if the target matches one of the provided identifiers, or is undefined. * @param target - Target slot value ID * @param targetIds - Target slot value IDs to match against */ function targetIsMatchOrUndefined(target: string | undefined, targetIds: string[]): boolean; /** * Test if the action matches one of the provided identifiers, or is undefined. * @param action - Action slot value ID * @param expectedValues - Action slot value IDs to match against */ function actionIsMatchOrUndefined(action: string | undefined, actionIds: string[]): boolean; /** * Test if the valueType is defined and matches the provided identifier. * @param valueType - ValueType slot value ID * @param expectedValueType - ValueType slot value ID to match against */ function valueTypeMatch(valueType: string | undefined, expectedValueType: string | string[]): boolean; /** * Test if the valueType is undefined. * @param valueType - ValueType slot value ID */ function valueTypeIsUndefined(valueType: string | undefined): boolean; /** * Test if the value is defined. * * A value of '?' is interpreted as being equal to undefined. (A value of * '?' is produced by NLU when slot elicitation is used but the response * cannot be understood.) * @param value - Value */ function valueStrDefined(value: MultiValueSlot[] | string | undefined): boolean; /** * Test if the value is undefined. * * A value of '?' is interpreted as being equal to undefined. (A value of * '?' is produced by NLU when slot elicitation is used but the response * cannot be understood.) * @param value - Value */ function valueStrIsUndefined(value: string | undefined): boolean; /** * Test if the input is equivalent to simply saying "yes". * * @param input - Input * * @returns true if the input is: * - `AMAZON.YesIntent`, or, * - A `GeneralControlIntent` with `feedback = builtin_affirm` and no other * filled. */ function isBareYes(input: ControlInput): boolean; /** * Test if the input is equivalent to simply saying "no". * * @param input - Input * * @returns true if the input is: * - `AMAZON.NoIntent`, or, * - A `GeneralControlIntent` with `feedback = builtin_disaffirm` and no other * filled. */ function isBareNo(input: ControlInput): boolean; /** * Extracts the value and erMatch from a ValueControlIntent * @param input - Input */ function getValueResolution(input: ControlInput): { valueStr: string; erMatch: boolean; }; /** * Extracts the value and erMatch array list from a ValueControlIntent * @param input - Input */ function getMultiValueResolution(input: ControlInput): MultiValueSlot[]; } //# sourceMappingURL=InputUtil.d.ts.map