@aws-amplify/interactions
Version:
Interactions category of aws-amplify
22 lines (21 loc) • 1.2 kB
TypeScript
import { PostContentCommandOutput, PostTextCommandOutput } from '@aws-sdk/client-lex-runtime-service';
import { AmplifyContext } from '@aws-amplify/core';
import { InteractionsMessage, InteractionsOnCompleteCallback, InteractionsResponse } from '../types/Interactions';
import { AWSLexProviderOption } from './types';
interface PostContentCommandOutputFormatted extends Omit<PostContentCommandOutput, 'audioStream'> {
audioStream?: Uint8Array;
}
type AWSLexProviderSendResponse = PostTextCommandOutput | PostContentCommandOutputFormatted;
declare class AWSLexProvider {
private readonly _botsCompleteCallbackByCtx;
/**
* @deprecated
* This is used internally by 'sendMessage' to call onComplete callback
* for a bot if configured
*/
reportBotStatus(ctx: AmplifyContext, data: AWSLexProviderSendResponse, { name }: AWSLexProviderOption): void;
sendMessage(ctx: AmplifyContext, botConfig: AWSLexProviderOption, message: string | InteractionsMessage): Promise<InteractionsResponse>;
onComplete(ctx: AmplifyContext, { name }: AWSLexProviderOption, callback: InteractionsOnCompleteCallback): void;
}
export declare const lexProvider: AWSLexProvider;
export {};