import { ResponseBuilder } from 'ask-sdk-core'; import { canfulfill, dialog, Directive, Intent, interfaces, Response, ui } from 'ask-sdk-model'; import { APLMode } from './AplMode'; /** * A specialized ResponseBuilder for use with Controls framework * * This differs from the the regular @see ResponseBuilder in a couple of ways: * 1. The prompt and reprompt can be built up incrementally via * `addPromptFragment()` and `addRepromptFragment()` * 2. `.withShouldEndSession()` is disabled as the information should be * provided via see `ControlResultBuilder` during `Control.handle()` and * `Control.takeInitiative()` */ export declare class ControlResponseBuilder implements ResponseBuilder { coreBuilder: ResponseBuilder; private promptFragments; private promptPlayBehavior?; private repromptFragments; private repromptPlayBehavior?; private displayUsed; shouldEndSession: boolean; aplMode: APLMode; aplDocumentDataSources: { [key: string]: any; }; aplDocumentStyles: { [key: string]: any; }; aplDocumentLayouts: { [key: string]: any; }; constructor(responseBuilder: ResponseBuilder); /** * Determines if a 'display or APL' directive has been added to the response. */ isDisplayUsed(): boolean; /** * Sets the displayUsed flag to indicate if the Response includes content * for the device display. * * Note: calling `.withSimpleCard()`, `.withStandardCard()`, * `.addAPLRenderDocumentDirective()` or * `.addDirective(type=Alexa.Presentation)` sets this to `true` * automatically. * * Usage: * * If you wish to keep existing APL active on device without resending, * call this to communicate that the screen remains 'in use'. * * Use this if the auto-detection does not work for some directive. */ setDisplayUsed(used?: boolean): void; /** * Build the response. */ build(): Response; /** * Get the complete prompt. * * Concatenates the fragments with a single space between each. */ getPrompt(): string; /** * Get the complete reprompt. * * Concatenates the fragments with a single space between each. */ getReprompt(): string; /** * Add a fragment to the prompt. * @param promptFragment - Prompt fragment */ addPromptFragment(promptFragment: string): this; /** * Add a fragment to the reprompt. * @param repromptFragment - Reprompt fragment */ addRepromptFragment(repromptFragment: string): this; /** * Set the prompt play behavior to associate with the complete prompt. */ withPromptPlayBehavior(playBehavior?: ui.PlayBehavior): this; /** * Set the reprompt play behavior to associate with the complete prompt. */ withRepromptPlayBehavior(playBehavior?: ui.PlayBehavior): this; /** * Disabled. Use addPromptFragment and withPromptPlayBehavior. */ speak(speechOutput: string, playBehavior?: 'ENQUEUE' | 'REPLACE_ALL' | 'REPLACE_ENQUEUED' | undefined): this; /** * Disabled. Use addRepromptFragment and withRepromptPlayBehavior. */ reprompt(repromptSpeechOutput: string, playBehavior?: 'ENQUEUE' | 'REPLACE_ALL' | 'REPLACE_ENQUEUED' | undefined): this; withSimpleCard(cardTitle: string, cardContent: string): this; withStandardCard(cardTitle: string, cardContent: string, smallImageUrl?: string | undefined, largeImageUrl?: string | undefined): this; withLinkAccountCard(): this; withAskForPermissionsConsentCard(permissionArray: string[]): this; addDelegateDirective(updatedIntent?: Intent | undefined): this; addElicitSlotDirective(slotToElicit: string, updatedIntent?: Intent | undefined): this; addConfirmSlotDirective(slotToConfirm: string, updatedIntent?: Intent | undefined): this; addConfirmIntentDirective(updatedIntent?: Intent | undefined): this; addAudioPlayerPlayDirective(playBehavior: ui.PlayBehavior, url: string, token: string, offsetInMilliseconds: number, expectedPreviousToken?: string | undefined, audioItemMetadata?: interfaces.audioplayer.AudioItemMetadata | undefined): this; addAudioPlayerStopDirective(): this; addAudioPlayerClearQueueDirective(clearBehavior: interfaces.audioplayer.ClearBehavior): this; addRenderTemplateDirective(template: interfaces.display.Template): this; addHintDirective(text: string): this; addVideoAppLaunchDirective(source: string, title?: string | undefined, subtitle?: string | undefined): this; withApiResponse(apiResponse: any): this; withCanFulfillIntent(canFulfillIntent: canfulfill.CanFulfillIntent): this; /** * Set the 'shouldEndSession' flag * * See * https://developer.amazon.com/en-GB/docs/alexa/custom-skills/manage-skill-session-and-session-attributes.html#session-lifecycle * for full details. * * Usage: * - Use this if you cannot control the session behavior via `ControlResultBuilder` * such as when handing a turn initialization exception in `ControlManager.handleInternalError` * @param val - true to end the session, false to leave the session open, * undefined|null to keep session alive with microphone closed (APL devices only). */ withShouldEndSession(val: boolean): this; addDirective(directive: Directive): this; addDirectiveToReprompt(directive: Directive): this; addDynamicEntitiesDirective(dynamicEntitiesDirective: dialog.DynamicEntitiesDirective): void; addAPLRenderDocumentDirective(token?: string, document?: { [key: string]: any; }, datasources?: { [key: string]: any; }, packages?: any[]): void; addAPLExecuteCommandsDirective(token: string, commands: interfaces.alexa.presentation.apl.Command[]): void; /** * Builds and returns the complete response. */ getResponse(): Response; addAPLDocumentDataSource(key: string, data: { [key: string]: any; }): void; addAPLDocumentStyle(key: string, data: { [key: string]: any; }): void; addAPLDocumentLayout(key: string, data: { [key: string]: any; }): void; addExperimentTrigger(experimentId: string): this; } //# sourceMappingURL=ControlResponseBuilder.d.ts.map