botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
45 lines • 1.84 kB
TypeScript
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Converter } from 'botbuilder-dialogs';
/**
* Language policy with fallback for each language as most specific to default en-us -> en -> default.
*/
export declare class LanguagePolicy extends Map<string, string[]> {
/**
* Initializes a new instance of the [LanguagePolicy](xref:botbuilder-dialogs-adaptive.LanguagePolicy) class.
*
* @param defaultLanguages Default languages to use.
*/
constructor(...defaultLanguages: string[]);
static readonly locales: string[];
/**
* Walk through all of the cultures and create a dictionary map with most specific to least specific.
*
* @param defaultLanguages Default languages to use.
* @returns A Map object with a string array for each key.
* @example Example output "en-us" will generate fallback rule like this:
* "en-us" -> "en" -> ""
* "en" -> ""
* So that when we get a locale such as en-gb, we can try to resolve to "en-gb" then "en" then ""
* See commented section for full sample of output of this function.
*/
static defaultPolicy(defaultLanguages?: string[]): Map<string, string[]>;
}
/**
* Language policy converter that implements `Converter`.
*/
export declare class LanguagePolicyConverter implements Converter<Record<string, string[]>, LanguagePolicy> {
/**
* Converts an object to a [LanguagePolicy](xref:botbuilder-dialogs-adaptive.LanguagePolicy) instance.
*
* @param value Object.
* @returns A new [LanguagePolicy](xref:botbuilder-dialogs-adaptive.LanguagePolicy) instance.
*/
convert(value: Record<string, string[]> | LanguagePolicy): LanguagePolicy;
}
//# sourceMappingURL=languagePolicy.d.ts.map