/** * Copyright(c) Microsoft Corporation.All rights reserved. * Licensed under the MIT License. */ import { Activity } from 'botbuilder-core'; import { Card } from './card'; import { IResponseIdCollection } from './responseIdCollection'; import { ResponseTemplate } from './responseTemplate'; export declare class ResponseManager { private readonly defaultLocaleKey; private static readonly simpleTokensRegex; private static readonly complexTokensRegex; constructor(locales: string[], responseTemplates: IResponseIdCollection[]); jsonResponses: Map>; /** * Gets a simple response from template with Text, Speak, InputHint, and SuggestedActions set. * @param templateId The name of the response template. * @param tokens string map of tokens to replace in the response. * @returns An Activity. */ getResponse(templateId: string, locale: string, tokens?: Map): Partial; /** * Gets a simple response from template with Text, Speak, InputHint, and SuggestedActions set. * @param templateId The name of the response template. * @param locale The locale for the response template. * @param tokens string map of tokens to replace in the response. * @returns An Activity. */ getLocalizedResponse(templateId: string, locale: string, tokens?: Map): Partial; /** * Gets the Text of a response. * @param templateId The name of the response template. * @param tokens string map of tokens to replace in the response. * @returns The response text. */ getResponseText(templateId: string, locale: string, tokens?: Map): string; /** * Get a response with an Adaptive Card attachment. * @param cards The card(s) to add to the response. * @returns An Activity. */ getCardResponse(cards: Card | Card[], locale: string): Partial; /** * Get a response from template with Text, Speak, InputHint, SuggestedActions, and an Adaptive Card attachment. * @param templateId The name of the response template. * @param cards The card(s) object to add to the response. * @param tokens Optional string map of tokens to replace in the response. */ getCardResponseWithTemplateId(templateId: string, cards: Card | Card[], locale: string, tokens?: Map): Partial; /** * Get a response from template with Text, Speak, InputHint, SuggestedActions, and a Card attachments with list items inside. * @param templateId The name of the response template. * @param card The main card container contains list. * @param tokens Optional string map of tokens to replace in the response. * @param containerName Target container. * @param containerItems Card list which will be injected to target container. * @returns An Activity. */ getCardResponseWithContainer(templateId: string, card: Card, locale: string, tokens?: Map, containerName?: string, containerItems?: Card[]): Partial; getResponseTemplate(templateId: string, locale: string): ResponseTemplate; format(messageTemplate: string, tokens?: Map): string; private loadResponses; private getJsonResponseKeyForLocale; private parseResponse; private loadCardJson; private buildCardAttachment; private buildCard; private jsonFromFile; }