botbuilder-dialogs
Advanced tools
@@ -28,5 +28,5 @@ /** | ||
* @private | ||
* @param channelId id of a channel | ||
* @param _channelId id of a channel | ||
*/ | ||
export declare function maxActionTitleLength(channelId: string): number; | ||
export declare function maxActionTitleLength(_channelId: string): number; | ||
/** | ||
@@ -33,0 +33,0 @@ * @private |
@@ -77,2 +77,3 @@ /** | ||
* @param options (Optional) formatting options to use when rendering as a list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -104,2 +105,3 @@ static forChannel(channelOrContext: string | TurnContext, choices: (string | Choice)[], text?: string, speak?: string, options?: ChoiceFactoryOptions): Partial<Activity>; | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -122,2 +124,3 @@ static inline(choices: (string | Choice)[], text?: string, speak?: string, options?: ChoiceFactoryOptions): Partial<Activity>; | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -139,2 +142,3 @@ static list(choices: (string | Choice)[], text?: string, speak?: string, options?: ChoiceFactoryOptions): Partial<Activity>; | ||
* @param speak (Optional) SSML to speak for the message. | ||
* @returns An activity with choices as suggested actions. | ||
*/ | ||
@@ -155,2 +159,3 @@ static suggestedAction(choices: (string | Choice)[], text?: string, speak?: string): Partial<Activity>; | ||
* @param choices List of choices to add. | ||
* @returns A list of choices. | ||
*/ | ||
@@ -157,0 +162,0 @@ static toChoices(choices: (string | Choice)[] | undefined): Choice[]; |
@@ -117,4 +117,5 @@ /** | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
export declare function findChoices(utterance: string, choices: (string | Choice)[], options?: FindChoicesOptions): ModelResult<FoundChoice>[]; | ||
//# sourceMappingURL=findChoices.d.ts.map |
@@ -69,7 +69,9 @@ /** | ||
* the fuzzy search algorithm that drives choice recognition. | ||
* | ||
* @param utterance The text or user utterance to search over. | ||
* @param values List of values to search over. | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found values. | ||
*/ | ||
export declare function findValues(utterance: string, values: SortedValue[], options?: FindValuesOptions): ModelResult<FoundValue>[]; | ||
//# sourceMappingURL=findValues.d.ts.map |
@@ -40,4 +40,5 @@ /** | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
export declare function recognizeChoices(utterance: string, choices: (string | Choice)[], options?: FindChoicesOptions): ModelResult<FoundChoice>[]; | ||
//# sourceMappingURL=recognizeChoices.d.ts.map |
@@ -46,2 +46,5 @@ /** | ||
* | ||
* @param text The input text. | ||
* @param _locale Optional, identifies the locale of the input text. | ||
* @returns A list of tokens. | ||
* @remarks | ||
@@ -56,7 +59,7 @@ * The only normalization done is to lowercase the tokens. Developers can wrap this tokenizer with | ||
* function customTokenizer(text, locale) { | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* } | ||
@@ -69,3 +72,3 @@ * | ||
*/ | ||
export declare function defaultTokenizer(text: string, locale?: string): Token[]; | ||
export declare function defaultTokenizer(text: string, _locale?: string): Token[]; | ||
//# sourceMappingURL=tokenizer.d.ts.map |
@@ -82,2 +82,3 @@ /** | ||
* Override this method in a derived class to implement interrupt logic. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -95,2 +96,3 @@ * @param options Optional, initial information to pass to the dialog. | ||
* If this method is *not* overridden, the dialog automatically ends when the user replies. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -107,5 +109,6 @@ * @returns A Promise representing the asynchronous operation. | ||
* control to this dialog component. | ||
* @param outerDc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param reason Reason why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* | ||
* @param outerDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param _reason Reason why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
@@ -123,5 +126,6 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(outerDC: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(outerDC: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
* Called when the dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -134,2 +138,3 @@ * @param instance State information for this dialog. | ||
* Called when the [Dialog](xref:botbuilder-dialogs.Dialog) is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -146,3 +151,5 @@ * @param instance State information associated with the instance of this component | ||
* Adds a child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to the components internal [DialogSet](xref:botbuilder-dialogs.DialogSet). | ||
* | ||
* @param dialog The child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to add. | ||
* @returns The [ComponentDialog](xref:botbuilder-dialogs.ComponentDialog) after the operation is complete. | ||
* @remarks | ||
@@ -154,3 +161,5 @@ * The [Dialog.id](xref:botbuilder-dialogs.Dialog.id) of the first child added to the component will be assigned to the initialDialogId property. | ||
* Creates the inner dialog context | ||
* | ||
* @param outerDC the outer dialog context | ||
* @returns The created Dialog Context. | ||
*/ | ||
@@ -167,2 +176,3 @@ createChildContext(outerDC: DialogContext): DialogContext; | ||
* @param options (Optional) options that were passed to the component by its parent. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -177,2 +187,3 @@ protected onBeginDialog(innerDC: DialogContext, options?: O): Promise<DialogTurnResult>; | ||
* @param innerDC Dialog context for the components internal `DialogSet`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -186,7 +197,8 @@ protected onContinueDialog(innerDC: DialogContext): Promise<DialogTurnResult>; | ||
* will be cancelled before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The components instance data within its parents dialog stack. | ||
* @param reason The reason the component is ending. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The components instance data within its parents dialog stack. | ||
* @param _reason The reason the component is ending. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
protected onEndDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void>; | ||
protected onEndDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void>; | ||
/** | ||
@@ -197,6 +209,7 @@ * Called when the component has been requested to re-prompt the user for input. | ||
* The active child dialog will have already been asked to reprompt before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The instance of the current dialog. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The instance of the current dialog. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
protected onRepromptDialog(context: TurnContext, instance: DialogInstance): Promise<void>; | ||
protected onRepromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void>; | ||
/** | ||
@@ -211,2 +224,3 @@ * Called when the components last active child dialog ends and the component is ending. | ||
* @param result Result returned by the last active child dialog. Can be a value of `undefined`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -213,0 +227,0 @@ protected endComponent(outerDC: DialogContext, result: any): Promise<DialogTurnResult>; |
@@ -15,7 +15,13 @@ /** | ||
* Fluent method for configuring the object. | ||
* | ||
* @param config Configuration settings to apply. | ||
* @returns The [Configurable](xref:botbuilder-dialogs.Configurable) after the operation is complete. | ||
*/ | ||
configure(config: Record<string, unknown>): this; | ||
/** | ||
* @param _property The key of the conditional selector configuration. | ||
* @returns The converter for the selector configuration. | ||
*/ | ||
getConverter(_property: string): Converter | ConverterFactory; | ||
} | ||
//# sourceMappingURL=configurable.d.ts.map |
@@ -11,3 +11,3 @@ /** | ||
* | ||
* @typeparam T Optional. The type that represents state information for the dialog. | ||
* @template T Optional. The type that represents state information for the dialog. | ||
* | ||
@@ -160,3 +160,3 @@ * @remarks | ||
* | ||
* @typeparam T Optional. The type that represents a result returned by the active dialog when it | ||
* @template T Optional. The type that represents a result returned by the active dialog when it | ||
* successfully completes. | ||
@@ -235,2 +235,3 @@ * | ||
* This will be automatically generated if not specified. | ||
* @returns The Id for the dialog. | ||
@@ -243,2 +244,4 @@ | ||
* Gets the telemetry client for this dialog. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
@@ -259,2 +262,3 @@ | ||
* Returning an empty string will disable version tracking for the component all together. | ||
* @returns Unique string which should only change when dialog has changed in a way that should restart the dialog. | ||
*/ | ||
@@ -300,2 +304,3 @@ getVersion(): string; | ||
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -327,2 +332,3 @@ continueDialog(dc: DialogContext): Promise<DialogTurnResult>; | ||
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -333,4 +339,4 @@ resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* | ||
@@ -348,9 +354,9 @@ * @remarks | ||
*/ | ||
repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void>; | ||
repromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void>; | ||
/** | ||
* When overridden in a derived class, performs clean up for the dialog before it ends. | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param reason The reason the dialog is ending. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* @param _reason The reason the dialog is ending. | ||
* | ||
@@ -369,3 +375,3 @@ * @remarks | ||
*/ | ||
endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void>; | ||
endDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void>; | ||
/** | ||
@@ -386,7 +392,7 @@ * Called when an event has been raised, using `DialogContext.emitEvent()`, by either the current dialog or a dialog that the current dialog started. | ||
* dialogs from performing their default processing. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
protected onPreBubbleEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>; | ||
protected onPreBubbleEvent(_dc: DialogContext, _e: DialogEvent): Promise<boolean>; | ||
/** | ||
@@ -398,7 +404,7 @@ * Called after an event was bubbled to all parents and wasn't handled. | ||
* prevent any processing of the event by child dialogs. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
protected onPostBubbleEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>; | ||
protected onPostBubbleEvent(_dc: DialogContext, _e: DialogEvent): Promise<boolean>; | ||
/** | ||
@@ -405,0 +411,0 @@ * Called when a unique ID needs to be computed for a dialog. |
@@ -22,2 +22,3 @@ /** | ||
* Creates an inner dialog context for the containers active child. | ||
* | ||
* @param dc Parents dialog context. | ||
@@ -29,3 +30,5 @@ * @returns A new dialog context for the active child or `undefined` if there is no active child. | ||
* Finds a child dialog that was previously added to the container. | ||
* | ||
* @param dialogId ID of the dialog to lookup. | ||
* @returns The Dialog if found; otherwise null. | ||
*/ | ||
@@ -39,2 +42,3 @@ findDialog(dialogId: string): Dialog | undefined; | ||
* @param e The event being raised. | ||
* @returns True if the event is handled by the current dialog and bubbling should stop. | ||
*/ | ||
@@ -65,2 +69,4 @@ onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>; | ||
* Get the current telemetry client. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
@@ -67,0 +73,0 @@ |
@@ -49,2 +49,3 @@ /** | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -59,2 +60,3 @@ * @param contextOrDC The [TurnContext](xref:botbuilder-core.TurnContext) object for the current turn of the bot. | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -89,7 +91,7 @@ * @param contextOrDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for the current turn of the bot. | ||
/* | ||
* Returns dialog context for child if the active dialog is a container. | ||
* @returns Dialog context for child if the active dialog is a container. | ||
*/ | ||
readonly child: DialogContext | undefined; | ||
/* | ||
* Returns the state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* @returns The state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* the stack is empty. | ||
@@ -107,5 +109,4 @@ */ | ||
/* | ||
* Returns the current dialog manager instance. This property is obsolete. | ||
* | ||
* @obsolete This property serves no function. | ||
* @deprecated This property serves no function. | ||
* @returns The current dialog manager instance. This property is deprecated. | ||
*/ | ||
@@ -115,2 +116,3 @@ readonly dialogManager: DialogManager; | ||
* Obtain the CultureInfo in DialogContext. | ||
* | ||
* @returns a locale string. | ||
@@ -125,3 +127,3 @@ */ | ||
* @param options Optional. Arguments to pass into the dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -155,3 +157,3 @@ * If there's already an active dialog on the stack, that dialog will be paused until | ||
* @param eventValue Optional. Value to pass along with custom cancellation event. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -179,3 +181,3 @@ * This calls each dialog's [Dialog.endDialog](xref:botbuilder-dialogs.Dialog.endDialog) method before | ||
* @param dialogId ID of the dialog to search for. | ||
* | ||
* @returns The dialog for the provided ID. | ||
* @remarks | ||
@@ -192,2 +194,3 @@ * If the dialog to start is not found in the [DialogSet](xref:botbuilder-dialogs.DialogSet) associated | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -211,2 +214,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -231,2 +235,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -257,3 +262,3 @@ * After the call completes, you can check the turn context's [responded](xref:botbuilder-core.TurnContext.responded) | ||
* the bot's turn handler. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -289,3 +294,3 @@ * The _parent_ dialog is the next dialog on the dialog stack, if there is one. This method | ||
* @param options Optional. Arguments to pass into the new dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -319,2 +324,3 @@ * This is particularly useful for creating a loop or redirecting to another dialog. | ||
* Searches for a dialog with a given ID. | ||
* | ||
* @remarks | ||
@@ -321,0 +327,0 @@ * Emits a named event for the current dialog, or someone who started it, to handle. |
@@ -20,2 +20,9 @@ /** | ||
export declare function runDialog(dialog: Dialog, context: TurnContext, accessor: StatePropertyAccessor<DialogState>): Promise<void>; | ||
/** | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param dialogId The dialog ID. | ||
* @param dialogContext The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param dialogStateManagerConfiguration Configuration for the dialog state manager. | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
*/ | ||
export declare function internalRun(context: TurnContext, dialogId: string, dialogContext: DialogContext, dialogStateManagerConfiguration?: DialogStateManagerConfiguration): Promise<DialogTurnResult>; | ||
@@ -25,4 +32,5 @@ /** | ||
* | ||
* @param context | ||
* @param turnResult | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param turnResult The dialog turn result. | ||
* @returns True if should send EoC, otherwise false. | ||
*/ | ||
@@ -29,0 +37,0 @@ export declare function shouldSendEndOfConversationToParent(context: TurnContext, turnResult: DialogTurnResult): boolean; |
@@ -41,3 +41,3 @@ /** | ||
* | ||
* @obsolete This class will be deprecated. | ||
* @deprecated This class will be deprecated. | ||
*/ | ||
@@ -65,2 +65,4 @@ export declare class DialogManager extends Configurable { | ||
* Values that will be copied to the `TurnContext.turnState` at the beginning of each turn. | ||
* | ||
* @returns The turn state collection. | ||
*/ | ||
@@ -67,0 +69,0 @@ readonly initialTurnState: TurnContextStateCollection; |
import { BotComponent } from 'botbuilder-core'; | ||
import { Configuration, ServiceCollection } from 'botbuilder-dialogs-adaptive-runtime-core'; | ||
/** | ||
* Bot component for bot Dialogs. | ||
*/ | ||
export declare class DialogsBotComponent extends BotComponent { | ||
/** | ||
* @param services Services Collection to register. | ||
* @param configuration Configuration for the bot component. | ||
*/ | ||
configureServices(services: ServiceCollection, configuration: Configuration): void; | ||
} | ||
//# sourceMappingURL=dialogsBotComponent.d.ts.map |
@@ -15,2 +15,5 @@ /** | ||
private readonly services; | ||
/** | ||
* Creates an instance of the [DialogsComponentRegistration](xref:botbuilder-dialogs.DialogsComponentRegistration) class. | ||
*/ | ||
constructor(); | ||
@@ -17,0 +20,0 @@ /** |
@@ -85,2 +85,3 @@ /** | ||
* | ||
* @returns A version that will change when any of the child dialogs version changes. | ||
* @remarks | ||
@@ -100,2 +101,3 @@ * This hash is persisted to state storage and used to detect changes to a dialog set. | ||
* If a telemetryClient is present on the dialog set, it will be added to each dialog. | ||
* @returns The dialog set after the operation is complete. | ||
*/ | ||
@@ -105,3 +107,5 @@ add<T extends Dialog>(dialog: T): this; | ||
* Creates a dialog context which can be used to work with the dialogs in the set. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -119,2 +123,3 @@ createContext(context: TurnContext): Promise<DialogContext>; | ||
* @param dialogId ID of the dialog or prompt to lookup. | ||
* @returns The dialog if found; otherwise undefined. | ||
*/ | ||
@@ -124,2 +129,4 @@ find(dialogId: string): Dialog | undefined; | ||
* Set the telemetry client for this dialog set and apply it to all current dialogs. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
@@ -126,0 +133,0 @@ |
@@ -52,3 +52,3 @@ /** | ||
* This always returns a CLONE of the memory, any modifications to the result will not affect memory. | ||
* @param T The value type to return. | ||
* @template T The value type to return. | ||
* @param pathExpression Path expression to use. | ||
@@ -61,2 +61,3 @@ * @param defaultValue (Optional) default value to use if the path isn't found. May be a function that returns the default value to use. | ||
* Set memory to value. | ||
* | ||
* @param pathExpression Path to memory. | ||
@@ -68,3 +69,4 @@ * @param value Value to set. | ||
* Delete property from memory | ||
* @param path The leaf property to remove. | ||
* | ||
* @param pathExpression The leaf property to remove. | ||
*/ | ||
@@ -88,2 +90,4 @@ deleteValue(pathExpression: string): void; | ||
* Deletes all of the backing memory for a given scope. | ||
* | ||
* @param name Name of the scope. | ||
*/ | ||
@@ -103,2 +107,3 @@ deleteScopesMemory(name: string): Promise<void>; | ||
* Transform the path using the registered path transformers. | ||
* | ||
* @param pathExpression The path to transform. | ||
@@ -110,2 +115,3 @@ * @returns The transformed path. | ||
* Gets all memory scopes suitable for logging. | ||
* | ||
* @returns Object which represents all memory scopes. | ||
@@ -116,2 +122,3 @@ */ | ||
* Track when specific paths are changed. | ||
* | ||
* @param paths Paths to track. | ||
@@ -123,2 +130,3 @@ * @returns Normalized paths to pass to [anyPathChanged()](#anypathchanged). | ||
* Check to see if any path has changed since watermark. | ||
* | ||
* @param counter Time counter to compare to. | ||
@@ -155,2 +163,3 @@ * @param paths Paths from [trackPaths()](#trackpaths) to check. | ||
* Gets the version number. | ||
* | ||
* @returns A string with the version number. | ||
@@ -157,0 +166,0 @@ */ |
@@ -18,2 +18,3 @@ /** | ||
* Initializes a new instance of the [AliasPathResolver](xref:botbuilder-dialogs.AliasPathResolver) class. | ||
* | ||
* @param alias Alias name. | ||
@@ -26,2 +27,3 @@ * @param prefix Prefix name. | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
@@ -28,0 +30,0 @@ * @returns The transformed path. |
@@ -21,2 +21,3 @@ /** | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
@@ -23,0 +24,0 @@ * @returns The transformed path. |
@@ -11,2 +11,3 @@ /** | ||
* Transform the path | ||
* | ||
* @param path Path to inspect. | ||
@@ -13,0 +14,0 @@ * @returns Transformed path |
@@ -10,2 +10,3 @@ import { MemoryScope } from './memoryScope'; | ||
* Initializes a new instance of the [BotStateMemoryScope](xref:adaptive-expressions.BotStateMemoryScope) class. | ||
* | ||
* @param name name of the property. | ||
@@ -16,3 +17,5 @@ */ | ||
* Get the backing memory for this scope. | ||
* @param dc current dialog context | ||
* | ||
* @param dc current dialog context. | ||
* @returns Memory for the scope. | ||
*/ | ||
@@ -22,8 +25,10 @@ getMemory(dc: DialogContext): object; | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc current dialog context | ||
* @param memory memory | ||
* @param _memory memory | ||
*/ | ||
setMemory(dc: DialogContext, memory: object): void; | ||
setMemory(dc: DialogContext, _memory: object): void; | ||
/** | ||
* Populates the state cache for this [BotState](xref:botbuilder-core.BotState) from the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -37,2 +42,3 @@ * @param force Optional, `true` to overwrite any existing state cache; | ||
* Writes the state cache for this [BotState](xref:botbuilder-core.BotState) to the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -46,7 +52,8 @@ * @param force Optional, `true` to save the state cache to storage; | ||
* Deletes any state in storage and the cache for this [BotState](xref:botbuilder-core.BotState). | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns A Promise that represents the work queued to execute. | ||
*/ | ||
delete(dc: DialogContext): Promise<void>; | ||
delete(_dc: DialogContext): Promise<void>; | ||
} | ||
//# sourceMappingURL=botStateMemoryScope.d.ts.map |
@@ -17,2 +17,3 @@ /** | ||
* Initializes a new instance of the [ClassMemoryScope](xref:botbuilder-dialogs.ClassMemoryScope) class. | ||
* | ||
* @param name Name of the scope class. | ||
@@ -23,2 +24,3 @@ */ | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -30,3 +32,5 @@ * @returns The memory for the scope. | ||
* Override to find the dialog instance referenced by the scope. | ||
* | ||
* @param dc Current dialog context. | ||
* @returns The dialog instance referenced by the scope. | ||
*/ | ||
@@ -33,0 +37,0 @@ protected onFindDialog(dc: DialogContext): Dialog; |
@@ -22,3 +22,3 @@ /** | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @retuns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* @returns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
*/ | ||
@@ -25,0 +25,0 @@ protected onFindDialog(dc: DialogContext): Dialog; |
@@ -20,2 +20,3 @@ /** | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The `DialogContext` object for this turn. | ||
@@ -22,0 +23,0 @@ * @returns Memory for the scope. |
@@ -20,2 +20,3 @@ /** | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -27,2 +28,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -29,0 +31,0 @@ * @param memory Memory object to set for the scope. |
@@ -15,2 +15,3 @@ /** | ||
* Initializes a new instance of the [MemoryScope](xref:botbuilder-dialogs.MemoryScope) class. | ||
* | ||
* @param name Name of the scope. | ||
@@ -31,2 +32,3 @@ * @param includeInSnapshot Boolean value indicating whether this memory | ||
* Get the backing memory for this scope | ||
* | ||
* @param dc Current dialog context. | ||
@@ -38,22 +40,26 @@ * @returns memory for the scope | ||
* Changes the backing object for the memory scope. | ||
* @param dc Current dialog context | ||
* @param memory memory to assign | ||
* | ||
* @param _dc Current dialog context | ||
* @param _memory memory to assign | ||
*/ | ||
setMemory(dc: DialogContext, memory: object): void; | ||
setMemory(_dc: DialogContext, _memory: object): void; | ||
/** | ||
* Loads a scopes backing memory at the start of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
load(dc: DialogContext): Promise<void>; | ||
load(_dc: DialogContext): Promise<void>; | ||
/** | ||
* Saves a scopes backing memory at the end of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
saveChanges(dc: DialogContext): Promise<void>; | ||
saveChanges(_dc: DialogContext): Promise<void>; | ||
/** | ||
* Deletes the backing memory for a scope. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
delete(dc: DialogContext): Promise<void>; | ||
delete(_dc: DialogContext): Promise<void>; | ||
} | ||
//# sourceMappingURL=memoryScope.d.ts.map |
@@ -29,2 +29,5 @@ /** | ||
getMemory(dc: DialogContext): Record<string, unknown>; | ||
/** | ||
* @param dc Current dialog context. | ||
*/ | ||
load(dc: DialogContext): Promise<void>; | ||
@@ -31,0 +34,0 @@ /** |
@@ -20,2 +20,3 @@ /** | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -27,2 +28,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -29,0 +31,0 @@ * @param memory Memory object to set for the scope. |
@@ -20,2 +20,3 @@ /** | ||
* Get the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
@@ -27,2 +28,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
@@ -29,0 +31,0 @@ * @param memory Memory object to set for the scope. |
@@ -24,2 +24,3 @@ /** | ||
* Creates a new ActivityPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -31,2 +32,3 @@ * @param validator Validator that will be called each time a new activity is received. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -44,2 +46,3 @@ * turn of the conversation. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -58,13 +61,15 @@ * turn of conversation. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
* of the conversation. | ||
* @param reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* @param _reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* the dialog resumed. | ||
* @param result Optional. Value returned from the previous dialog on the stack. | ||
* @param _result Optional. Value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -79,2 +84,3 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -91,11 +97,12 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, attempts to recognize the incoming [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: object, options: PromptOptions): Promise<PromptRecognizerResult<Activity>>; | ||
protected onRecognize(context: TurnContext, _state: object, _options: PromptOptions): Promise<PromptRecognizerResult<Activity>>; | ||
} | ||
//# sourceMappingURL=activityPrompt.d.ts.map |
@@ -19,2 +19,3 @@ /** | ||
* Creates a new `AttachmentPrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -26,2 +27,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -38,10 +40,11 @@ * @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A prompt options object constructed from the options initially provided | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A prompt options object constructed from the options initially provided | ||
* in the call to Prompt. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<Attachment[]>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<Attachment[]>>; | ||
} | ||
//# sourceMappingURL=attachmentPrompt.d.ts.map |
@@ -49,2 +49,3 @@ /** | ||
* Creates a new `ChoicePrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet`. | ||
@@ -59,2 +60,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. If the validator replies with a message no additional retry prompt will be sent. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -72,2 +74,3 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext) context for the current | ||
@@ -74,0 +77,0 @@ * turn of conversation with the user. |
@@ -46,5 +46,7 @@ import { TurnContext } from 'botbuilder-core'; | ||
* Creates a new ConfirmPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
* @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`. | ||
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on [[PromptCultureModels.getSupportedCultures()]]. | ||
*/ | ||
@@ -54,2 +56,3 @@ constructor(dialogId: string, validator?: PromptValidator<boolean>, defaultLocale?: string, choiceDefaults?: ChoiceDefaultsConfirmPrompt); | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -67,10 +70,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<boolean>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<boolean>>; | ||
/** | ||
@@ -77,0 +81,0 @@ * @private |
@@ -35,2 +35,3 @@ import { TurnContext } from 'botbuilder-core'; | ||
* Creates a new DateTimePrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -43,2 +44,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -56,11 +58,12 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<DateTimeResolution[]>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<DateTimeResolution[]>>; | ||
} | ||
//# sourceMappingURL=datetimePrompt.d.ts.map |
@@ -16,2 +16,3 @@ import { TurnContext } from 'botbuilder-core'; | ||
* Creates a new NumberPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -24,2 +25,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -37,10 +39,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: unknown, options: PromptOptions): Promise<PromptRecognizerResult<number>>; | ||
protected onRecognize(context: TurnContext, _state: unknown, _options: PromptOptions): Promise<PromptRecognizerResult<number>>; | ||
/** | ||
@@ -47,0 +50,0 @@ * @private |
@@ -124,2 +124,3 @@ /** | ||
* Creates a new OAuthPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -145,2 +146,3 @@ * @param settings Settings used to configure the prompt. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
@@ -158,4 +160,6 @@ * of the conversation. | ||
* Attempts to retrieve the stored token for the current user. | ||
* | ||
* @param context Context reference the user that's being looked up. | ||
* @param code (Optional) login code received from the user. | ||
* @returns The token response. | ||
*/ | ||
@@ -177,2 +181,3 @@ getUserToken(context: TurnContext, code?: string): Promise<TokenResponse | undefined>; | ||
* @param context Context referencing the user that's being signed out. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -179,0 +184,0 @@ signOutUser(context: TurnContext): Promise<void>; |
@@ -70,2 +70,3 @@ /** | ||
* Result returned by a prompts recognizer function. | ||
* | ||
* @param T Type of value being recognized. | ||
@@ -105,2 +106,3 @@ */ | ||
* Contextual information passed to a custom `PromptValidator`. | ||
* | ||
* @param T Type of recognizer result being validated. | ||
@@ -147,2 +149,3 @@ */ | ||
* Base class for all prompts. | ||
* | ||
* @param T Type of value being returned by the prompts recognizer function. | ||
@@ -154,2 +157,3 @@ */ | ||
* Creates a new Prompt instance. | ||
* | ||
* @param dialogId Unique ID of the prompt within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -161,2 +165,3 @@ * @param validator (Optional) custom validator used to provide additional validation and re-prompting logic for the prompt. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -174,2 +179,3 @@ * turn of the conversation. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -186,2 +192,3 @@ * @returns A `Promise` representing the asynchronous operation. | ||
* Called before an event is bubbled to its parent. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -199,5 +206,6 @@ * @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The DialogContext for the current turn of the conversation. | ||
* @param reason An enum indicating why the dialog resumed. | ||
* @param result Optional, value returned from the previous dialog on the stack. | ||
* @param _reason An enum indicating why the dialog resumed. | ||
* @param _result Optional, value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
@@ -209,5 +217,6 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -222,2 +231,3 @@ * turn of conversation with the user. | ||
* Called anytime the derived class should send the user a prompt. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -242,2 +252,3 @@ * @param state Additional state being persisted for the prompt. | ||
* Helper function to compose an output activity containing a set of choices. | ||
* | ||
* @param prompt The prompt to append the users choices to. | ||
@@ -248,2 +259,3 @@ * @param channelId ID of the channel the prompt is being sent to. | ||
* @param options (Optional) options to configure the underlying ChoiceFactory call. | ||
* @returns The composed activity ready to send to the user. | ||
*/ | ||
@@ -250,0 +262,0 @@ protected appendChoices(prompt: string | Partial<Activity>, channelId: string, choices: (string | Choice)[], style: ListStyle, options?: ChoiceFactoryOptions): Partial<Activity>; |
export interface PromptCultureModel { | ||
/** | ||
* Culture Model's Locale. | ||
* | ||
* @example | ||
@@ -10,2 +11,3 @@ * "en-US" | ||
* Culture Model's InlineSeparator. | ||
* | ||
* @example | ||
@@ -17,2 +19,3 @@ * ", " | ||
* Culture Model's InlineOr. | ||
* | ||
* @example | ||
@@ -24,2 +27,3 @@ * " or " | ||
* Culture Model's InlineOrMore. | ||
* | ||
* @example | ||
@@ -31,2 +35,3 @@ * ", or " | ||
* Equivalent of "Yes" in Culture Model's Language. | ||
* | ||
* @example | ||
@@ -38,2 +43,3 @@ * "Yes" | ||
* Equivalent of "No" in Culture Model's Language. | ||
* | ||
* @example | ||
@@ -63,2 +69,3 @@ * "No" | ||
* Use Recognizers-Text to normalize various potential Locale strings to a standard. | ||
* | ||
* @remarks This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39 | ||
@@ -65,0 +72,0 @@ * This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts. |
@@ -21,2 +21,3 @@ /** | ||
* Creates a new TextPrompt instance. | ||
* | ||
* @param dialogId (Optional) unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -28,2 +29,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -41,15 +43,17 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<string>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<string>>; | ||
/** | ||
* Called before an event is bubbled to its parent. | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* turn of conversation. | ||
* @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @param _event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
@@ -61,4 +65,4 @@ * @remarks | ||
*/ | ||
protected onPreBubbleEvent(dc: DialogContext, event: DialogEvent): Promise<boolean>; | ||
protected onPreBubbleEvent(_dc: DialogContext, _event: DialogEvent): Promise<boolean>; | ||
} | ||
//# sourceMappingURL=textPrompt.d.ts.map |
@@ -31,9 +31,8 @@ /** | ||
* | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {Partial<Activity>} activity Activity. | ||
* @param {Record<string, string>} telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
* @returns {Promise<RecognizerResult>} Recognized result. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @param {Partial<Activity>} _activity Activity. | ||
* @param {Record<string, string>} _telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} _telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
*/ | ||
recognize(dialogContext: DialogContext, activity: Partial<Activity>, telemetryProperties?: Record<string, string>, telemetryMetrics?: Record<string, number>): Promise<RecognizerResult>; | ||
recognize(_dialogContext: DialogContext, _activity: Partial<Activity>, _telemetryProperties?: Record<string, string>, _telemetryMetrics?: Record<string, number>): Promise<RecognizerResult>; | ||
/** | ||
@@ -51,6 +50,6 @@ * Creates choose intent result in the case that there are conflicting or ambiguous signals from the recognizers. | ||
* @param {Record<string, string>} telemetryProperties A list of properties to append or override the properties created using the RecognizerResult. | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @returns {Record<string, string>} A collection of properties that can be included when calling the TrackEvent method on the TelemetryClient. | ||
*/ | ||
protected fillRecognizerResultTelemetryProperties(recognizerResult: RecognizerResult, telemetryProperties: Record<string, string>, dialogContext?: DialogContext): Record<string, string>; | ||
protected fillRecognizerResultTelemetryProperties(recognizerResult: RecognizerResult, telemetryProperties: Record<string, string>, _dialogContext?: DialogContext): Record<string, string>; | ||
protected stringifyAdditionalPropertiesOfRecognizerResult(recognizerResult: RecognizerResult): string; | ||
@@ -57,0 +56,0 @@ /** |
@@ -15,2 +15,3 @@ /** | ||
* A specialized Dialog that can wrap remote calls to a skill. | ||
* | ||
* @remarks | ||
@@ -31,4 +32,4 @@ * The options parameter in beginDialog must be a BeginSkillDialogOptions instance | ||
* | ||
* @param dialogOptions | ||
* @param dialogId | ||
* @param dialogOptions The options to execute the skill dialog. | ||
* @param dialogId The id of the dialog. | ||
*/ | ||
@@ -38,2 +39,3 @@ constructor(dialogOptions: SkillDialogOptions, dialogId?: string); | ||
* Called when the skill dialog is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -49,2 +51,3 @@ * @param options Initial information to pass to the dialog. | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -60,2 +63,3 @@ * @returns A Promise representing the asynchronous operation. | ||
* Called when the skill dialog is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -69,2 +73,3 @@ * @param instance State information associated with the instance of this dialog on the dialog stack. | ||
* Called when the skill dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -77,9 +82,10 @@ * @param instance State information for this dialog. | ||
* Called when a child skill dialog completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
* @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* @param _reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
@@ -92,5 +98,6 @@ * @protected | ||
* If this method returns false, the dialog will end the turn without processing the activity. | ||
* @param activity The Activity for the current turn of conversation. | ||
* @param _activity The Activity for the current turn of conversation. | ||
* @returns True if the activity is valid, false if not. | ||
*/ | ||
protected onValidateActivity(activity: Activity): boolean; | ||
protected onValidateActivity(_activity: Activity): boolean; | ||
/** | ||
@@ -97,0 +104,0 @@ * @private |
@@ -15,2 +15,3 @@ /** | ||
* Given the turn context bind to the data to create the object | ||
* | ||
* @param dialogContext DialogContext. | ||
@@ -17,0 +18,0 @@ * @param data Data to bind to. |
@@ -12,2 +12,3 @@ import { TurnContext } from 'botbuilder-core'; | ||
* ``` | ||
* | ||
* @param O (Optional) type of dialog options passed into the step. | ||
@@ -76,2 +77,3 @@ * @param WaterfallStep.step Contextual information for the current step being executed. | ||
* Gets the dialog version, composed of the ID and number of steps. | ||
* | ||
* @returns Dialog version, composed of the ID and number of steps. | ||
@@ -117,2 +119,3 @@ */ | ||
* @param step Asynchronous step function to call. | ||
* @returns Waterfall dialog for fluent calls to `addStep()`. | ||
*/ | ||
@@ -122,2 +125,3 @@ addStep(step: WaterfallStep<O>): this; | ||
* Called when the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -134,2 +138,3 @@ * @param options Optional, initial information to pass to the [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -145,2 +150,3 @@ * @returns A Promise representing the asynchronous operation. | ||
* Called when a child [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
@@ -168,2 +174,3 @@ * @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param step Context object for the waterfall step to execute. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -173,2 +180,3 @@ protected onStep(step: WaterfallStepContext<O>): Promise<DialogTurnResult>; | ||
* Executes a step of the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -191,2 +199,3 @@ * @param index The index of the current waterfall step to execute. | ||
* Identifies the step name by its position index. | ||
* | ||
* @param index Step position | ||
@@ -193,0 +202,0 @@ * @returns A string that identifies the step name. |
@@ -37,2 +37,3 @@ /** | ||
* Called to skip to the next waterfall step. | ||
* | ||
* @param result (Optional) result to pass to the next step. | ||
@@ -44,2 +45,3 @@ */ | ||
* Context object passed in to a `WaterfallStep`. | ||
* | ||
* @param O (Optional) type of options passed to the steps waterfall dialog in the call to `DialogContext.beginDialog()`. | ||
@@ -51,2 +53,3 @@ */ | ||
* Creates a new WaterfallStepContext instance. | ||
* | ||
* @param dc The dialog context for the current turn of conversation. | ||
@@ -58,2 +61,4 @@ * @param info Values to initialize the step context with. | ||
* The index of the current waterfall step being executed. | ||
* | ||
* @returns The index of the current waterfall step being executed. | ||
*/ | ||
@@ -64,2 +69,4 @@ readonly index: number; | ||
* `DialogContext.beginDialog()`. | ||
* | ||
* @returns Any options the waterfall dialog was called with. | ||
*/ | ||
@@ -69,2 +76,4 @@ readonly options: O; | ||
* The reason the waterfall step is being executed. | ||
* | ||
* @returns The reason the waterfall step is being executed. | ||
*/ | ||
@@ -74,2 +83,4 @@ readonly reason: DialogReason; | ||
* Results returned by a dialog or prompt that was called in the previous waterfall step. | ||
* | ||
* @returns The result from the previous waterfall step. | ||
*/ | ||
@@ -79,2 +90,4 @@ readonly result: any; | ||
* A dictionary of values which will be persisted across all waterfall steps. | ||
* | ||
* @returns A dictionary of values which will be persisted across all waterfall steps. | ||
*/ | ||
@@ -91,2 +104,3 @@ readonly values: object; | ||
* @param result (Optional) result to pass to the next step. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -93,0 +107,0 @@ next(result?: any): Promise<DialogTurnResult>; |
@@ -28,5 +28,5 @@ /** | ||
* @private | ||
* @param channelId id of a channel | ||
* @param _channelId id of a channel | ||
*/ | ||
export declare function maxActionTitleLength(channelId: string): number; | ||
export declare function maxActionTitleLength(_channelId: string): number; | ||
/** | ||
@@ -33,0 +33,0 @@ * @private |
@@ -79,5 +79,5 @@ "use strict"; | ||
* @private | ||
* @param channelId id of a channel | ||
* @param _channelId id of a channel | ||
*/ | ||
function maxActionTitleLength(channelId) { | ||
function maxActionTitleLength(_channelId) { | ||
return 20; | ||
@@ -84,0 +84,0 @@ } |
@@ -77,2 +77,3 @@ /** | ||
* @param options (Optional) formatting options to use when rendering as a list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -104,2 +105,3 @@ static forChannel(channelOrContext: string | TurnContext, choices: (string | Choice)[], text?: string, speak?: string, options?: ChoiceFactoryOptions): Partial<Activity>; | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -122,2 +124,3 @@ static inline(choices: (string | Choice)[], text?: string, speak?: string, options?: ChoiceFactoryOptions): Partial<Activity>; | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -139,2 +142,3 @@ static list(choices: (string | Choice)[], text?: string, speak?: string, options?: ChoiceFactoryOptions): Partial<Activity>; | ||
* @param speak (Optional) SSML to speak for the message. | ||
* @returns An activity with choices as suggested actions. | ||
*/ | ||
@@ -155,2 +159,3 @@ static suggestedAction(choices: (string | Choice)[], text?: string, speak?: string): Partial<Activity>; | ||
* @param choices List of choices to add. | ||
* @returns A list of choices. | ||
*/ | ||
@@ -157,0 +162,0 @@ static toChoices(choices: (string | Choice)[] | undefined): Choice[]; |
@@ -54,2 +54,3 @@ "use strict"; | ||
* @param options (Optional) formatting options to use when rendering as a list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -124,2 +125,3 @@ static forChannel(channelOrContext, choices, text, speak, options) { | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -162,2 +164,3 @@ static inline(choices, text, speak, options) { | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
@@ -193,2 +196,3 @@ static list(choices, text, speak, options) { | ||
* @param speak (Optional) SSML to speak for the message. | ||
* @returns An activity with choices as suggested actions. | ||
*/ | ||
@@ -221,2 +225,3 @@ static suggestedAction(choices, text, speak) { | ||
* @param choices List of choices to add. | ||
* @returns A list of choices. | ||
*/ | ||
@@ -223,0 +228,0 @@ static toChoices(choices) { |
@@ -117,4 +117,5 @@ /** | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
export declare function findChoices(utterance: string, choices: (string | Choice)[], options?: FindChoicesOptions): ModelResult<FoundChoice>[]; | ||
//# sourceMappingURL=findChoices.d.ts.map |
@@ -40,2 +40,3 @@ "use strict"; | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
@@ -42,0 +43,0 @@ function findChoices(utterance, choices, options) { |
@@ -69,7 +69,9 @@ /** | ||
* the fuzzy search algorithm that drives choice recognition. | ||
* | ||
* @param utterance The text or user utterance to search over. | ||
* @param values List of values to search over. | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found values. | ||
*/ | ||
export declare function findValues(utterance: string, values: SortedValue[], options?: FindValuesOptions): ModelResult<FoundValue>[]; | ||
//# sourceMappingURL=findValues.d.ts.map |
@@ -10,5 +10,7 @@ "use strict"; | ||
* the fuzzy search algorithm that drives choice recognition. | ||
* | ||
* @param utterance The text or user utterance to search over. | ||
* @param values List of values to search over. | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found values. | ||
*/ | ||
@@ -143,3 +145,3 @@ // tslint:disable-next-line:max-func-body-length | ||
// Apply filters | ||
let add = !foundIndexes.hasOwnProperty(match.resolution.index); | ||
let add = !Object.prototype.hasOwnProperty.call(foundIndexes, match.resolution.index); | ||
for (let i = match.start; i <= match.end; i++) { | ||
@@ -146,0 +148,0 @@ if (usedTokens[i]) { |
@@ -40,4 +40,5 @@ /** | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
export declare function recognizeChoices(utterance: string, choices: (string | Choice)[], options?: FindChoicesOptions): ModelResult<FoundChoice>[]; | ||
//# sourceMappingURL=recognizeChoices.d.ts.map |
@@ -43,2 +43,3 @@ "use strict"; | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
@@ -64,3 +65,3 @@ function recognizeChoices(utterance, choices, options) { | ||
} | ||
catch (e) { | ||
catch (_a) { | ||
// noop | ||
@@ -67,0 +68,0 @@ // TODO: Should this log an error or do something? |
@@ -46,2 +46,5 @@ /** | ||
* | ||
* @param text The input text. | ||
* @param _locale Optional, identifies the locale of the input text. | ||
* @returns A list of tokens. | ||
* @remarks | ||
@@ -56,7 +59,7 @@ * The only normalization done is to lowercase the tokens. Developers can wrap this tokenizer with | ||
* function customTokenizer(text, locale) { | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* } | ||
@@ -69,3 +72,3 @@ * | ||
*/ | ||
export declare function defaultTokenizer(text: string, locale?: string): Token[]; | ||
export declare function defaultTokenizer(text: string, _locale?: string): Token[]; | ||
//# sourceMappingURL=tokenizer.d.ts.map |
@@ -14,2 +14,5 @@ "use strict"; | ||
* | ||
* @param text The input text. | ||
* @param _locale Optional, identifies the locale of the input text. | ||
* @returns A list of tokens. | ||
* @remarks | ||
@@ -24,7 +27,7 @@ * The only normalization done is to lowercase the tokens. Developers can wrap this tokenizer with | ||
* function customTokenizer(text, locale) { | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* } | ||
@@ -37,3 +40,3 @@ * | ||
*/ | ||
function defaultTokenizer(text, locale) { | ||
function defaultTokenizer(text, _locale) { | ||
const tokens = []; | ||
@@ -40,0 +43,0 @@ let token; |
@@ -82,2 +82,3 @@ /** | ||
* Override this method in a derived class to implement interrupt logic. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -95,2 +96,3 @@ * @param options Optional, initial information to pass to the dialog. | ||
* If this method is *not* overridden, the dialog automatically ends when the user replies. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -107,5 +109,6 @@ * @returns A Promise representing the asynchronous operation. | ||
* control to this dialog component. | ||
* @param outerDc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param reason Reason why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* | ||
* @param outerDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param _reason Reason why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
@@ -123,5 +126,6 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(outerDC: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(outerDC: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
* Called when the dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -134,2 +138,3 @@ * @param instance State information for this dialog. | ||
* Called when the [Dialog](xref:botbuilder-dialogs.Dialog) is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -146,3 +151,5 @@ * @param instance State information associated with the instance of this component | ||
* Adds a child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to the components internal [DialogSet](xref:botbuilder-dialogs.DialogSet). | ||
* | ||
* @param dialog The child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to add. | ||
* @returns The [ComponentDialog](xref:botbuilder-dialogs.ComponentDialog) after the operation is complete. | ||
* @remarks | ||
@@ -154,3 +161,5 @@ * The [Dialog.id](xref:botbuilder-dialogs.Dialog.id) of the first child added to the component will be assigned to the initialDialogId property. | ||
* Creates the inner dialog context | ||
* | ||
* @param outerDC the outer dialog context | ||
* @returns The created Dialog Context. | ||
*/ | ||
@@ -167,2 +176,3 @@ createChildContext(outerDC: DialogContext): DialogContext; | ||
* @param options (Optional) options that were passed to the component by its parent. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -177,2 +187,3 @@ protected onBeginDialog(innerDC: DialogContext, options?: O): Promise<DialogTurnResult>; | ||
* @param innerDC Dialog context for the components internal `DialogSet`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -186,7 +197,8 @@ protected onContinueDialog(innerDC: DialogContext): Promise<DialogTurnResult>; | ||
* will be cancelled before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The components instance data within its parents dialog stack. | ||
* @param reason The reason the component is ending. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The components instance data within its parents dialog stack. | ||
* @param _reason The reason the component is ending. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
protected onEndDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void>; | ||
protected onEndDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void>; | ||
/** | ||
@@ -197,6 +209,7 @@ * Called when the component has been requested to re-prompt the user for input. | ||
* The active child dialog will have already been asked to reprompt before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The instance of the current dialog. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The instance of the current dialog. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
protected onRepromptDialog(context: TurnContext, instance: DialogInstance): Promise<void>; | ||
protected onRepromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void>; | ||
/** | ||
@@ -211,2 +224,3 @@ * Called when the components last active child dialog ends and the component is ending. | ||
* @param result Result returned by the last active child dialog. Can be a value of `undefined`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -213,0 +227,0 @@ protected endComponent(outerDC: DialogContext, result: any): Promise<DialogTurnResult>; |
@@ -88,2 +88,3 @@ "use strict"; | ||
* Override this method in a derived class to implement interrupt logic. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -124,2 +125,3 @@ * @param options Optional, initial information to pass to the dialog. | ||
* If this method is *not* overridden, the dialog automatically ends when the user replies. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -150,5 +152,6 @@ * @returns A Promise representing the asynchronous operation. | ||
* control to this dialog component. | ||
* @param outerDc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param reason Reason why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* | ||
* @param outerDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param _reason Reason why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
@@ -166,3 +169,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(outerDC, reason, result) { | ||
resumeDialog(outerDC, _reason, _result) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -181,2 +184,3 @@ yield this.checkForVersionChange(outerDC); | ||
* Called when the dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -197,2 +201,3 @@ * @param instance State information for this dialog. | ||
* Called when the [Dialog](xref:botbuilder-dialogs.Dialog) is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -219,3 +224,5 @@ * @param instance State information associated with the instance of this component | ||
* Adds a child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to the components internal [DialogSet](xref:botbuilder-dialogs.DialogSet). | ||
* | ||
* @param dialog The child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to add. | ||
* @returns The [ComponentDialog](xref:botbuilder-dialogs.ComponentDialog) after the operation is complete. | ||
* @remarks | ||
@@ -233,3 +240,5 @@ * The [Dialog.id](xref:botbuilder-dialogs.Dialog.id) of the first child added to the component will be assigned to the initialDialogId property. | ||
* Creates the inner dialog context | ||
* | ||
* @param outerDC the outer dialog context | ||
* @returns The created Dialog Context. | ||
*/ | ||
@@ -248,2 +257,3 @@ createChildContext(outerDC) { | ||
* @param options (Optional) options that were passed to the component by its parent. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -260,2 +270,3 @@ onBeginDialog(innerDC, options) { | ||
* @param innerDC Dialog context for the components internal `DialogSet`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -271,7 +282,8 @@ onContinueDialog(innerDC) { | ||
* will be cancelled before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The components instance data within its parents dialog stack. | ||
* @param reason The reason the component is ending. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The components instance data within its parents dialog stack. | ||
* @param _reason The reason the component is ending. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
onEndDialog(context, instance, reason) { | ||
onEndDialog(_context, _instance, _reason) { | ||
return Promise.resolve(); | ||
@@ -284,6 +296,7 @@ } | ||
* The active child dialog will have already been asked to reprompt before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The instance of the current dialog. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The instance of the current dialog. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
onRepromptDialog(context, instance) { | ||
onRepromptDialog(_context, _instance) { | ||
return Promise.resolve(); | ||
@@ -300,2 +313,3 @@ } | ||
* @param result Result returned by the last active child dialog. Can be a value of `undefined`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -302,0 +316,0 @@ endComponent(outerDC, result) { |
@@ -15,7 +15,13 @@ /** | ||
* Fluent method for configuring the object. | ||
* | ||
* @param config Configuration settings to apply. | ||
* @returns The [Configurable](xref:botbuilder-dialogs.Configurable) after the operation is complete. | ||
*/ | ||
configure(config: Record<string, unknown>): this; | ||
/** | ||
* @param _property The key of the conditional selector configuration. | ||
* @returns The converter for the selector configuration. | ||
*/ | ||
getConverter(_property: string): Converter | ConverterFactory; | ||
} | ||
//# sourceMappingURL=configurable.d.ts.map |
@@ -17,3 +17,5 @@ "use strict"; | ||
* Fluent method for configuring the object. | ||
* | ||
* @param config Configuration settings to apply. | ||
* @returns The [Configurable](xref:botbuilder-dialogs.Configurable) after the operation is complete. | ||
*/ | ||
@@ -53,2 +55,6 @@ configure(config) { | ||
} | ||
/** | ||
* @param _property The key of the conditional selector configuration. | ||
* @returns The converter for the selector configuration. | ||
*/ | ||
getConverter(_property) { | ||
@@ -55,0 +61,0 @@ return undefined; |
@@ -11,3 +11,3 @@ /** | ||
* | ||
* @typeparam T Optional. The type that represents state information for the dialog. | ||
* @template T Optional. The type that represents state information for the dialog. | ||
* | ||
@@ -160,3 +160,3 @@ * @remarks | ||
* | ||
* @typeparam T Optional. The type that represents a result returned by the active dialog when it | ||
* @template T Optional. The type that represents a result returned by the active dialog when it | ||
* successfully completes. | ||
@@ -235,2 +235,3 @@ * | ||
* This will be automatically generated if not specified. | ||
* @returns The Id for the dialog. | ||
*/ | ||
@@ -244,2 +245,4 @@ get id(): string; | ||
* Gets the telemetry client for this dialog. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
@@ -261,2 +264,3 @@ get telemetryClient(): BotTelemetryClient; | ||
* Returning an empty string will disable version tracking for the component all together. | ||
* @returns Unique string which should only change when dialog has changed in a way that should restart the dialog. | ||
*/ | ||
@@ -302,2 +306,3 @@ getVersion(): string; | ||
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -329,2 +334,3 @@ continueDialog(dc: DialogContext): Promise<DialogTurnResult>; | ||
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -335,4 +341,4 @@ resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* | ||
@@ -350,9 +356,9 @@ * @remarks | ||
*/ | ||
repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void>; | ||
repromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void>; | ||
/** | ||
* When overridden in a derived class, performs clean up for the dialog before it ends. | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param reason The reason the dialog is ending. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* @param _reason The reason the dialog is ending. | ||
* | ||
@@ -371,3 +377,3 @@ * @remarks | ||
*/ | ||
endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void>; | ||
endDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void>; | ||
/** | ||
@@ -388,7 +394,7 @@ * Called when an event has been raised, using `DialogContext.emitEvent()`, by either the current dialog or a dialog that the current dialog started. | ||
* dialogs from performing their default processing. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
protected onPreBubbleEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>; | ||
protected onPreBubbleEvent(_dc: DialogContext, _e: DialogEvent): Promise<boolean>; | ||
/** | ||
@@ -400,7 +406,7 @@ * Called after an event was bubbled to all parents and wasn't handled. | ||
* prevent any processing of the event by child dialogs. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
protected onPostBubbleEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>; | ||
protected onPostBubbleEvent(_dc: DialogContext, _e: DialogEvent): Promise<boolean>; | ||
/** | ||
@@ -407,0 +413,0 @@ * Called when a unique ID needs to be computed for a dialog. |
@@ -129,2 +129,3 @@ "use strict"; | ||
* This will be automatically generated if not specified. | ||
* @returns The Id for the dialog. | ||
*/ | ||
@@ -145,2 +146,4 @@ get id() { | ||
* Gets the telemetry client for this dialog. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
@@ -166,2 +169,3 @@ get telemetryClient() { | ||
* Returning an empty string will disable version tracking for the component all together. | ||
* @returns Unique string which should only change when dialog has changed in a way that should restart the dialog. | ||
*/ | ||
@@ -188,2 +192,3 @@ getVersion() { | ||
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -220,2 +225,3 @@ continueDialog(dc) { | ||
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -231,4 +237,4 @@ resumeDialog(dc, reason, result) { | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* | ||
@@ -246,3 +252,3 @@ * @remarks | ||
*/ | ||
repromptDialog(context, instance) { | ||
repromptDialog(_context, _instance) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -255,5 +261,5 @@ // No-op by default | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param reason The reason the dialog is ending. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* @param _reason The reason the dialog is ending. | ||
* | ||
@@ -272,3 +278,3 @@ * @remarks | ||
*/ | ||
endDialog(context, instance, reason) { | ||
endDialog(_context, _instance, _reason) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -307,7 +313,7 @@ // No-op by default | ||
* dialogs from performing their default processing. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
onPreBubbleEvent(dc, e) { | ||
onPreBubbleEvent(_dc, _e) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -323,7 +329,7 @@ return false; | ||
* prevent any processing of the event by child dialogs. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
onPostBubbleEvent(dc, e) { | ||
onPostBubbleEvent(_dc, _e) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -341,3 +347,3 @@ return false; | ||
onComputeId() { | ||
throw new Error(`Dialog.onComputeId(): not implemented.`); | ||
throw new Error('Dialog.onComputeId(): not implemented.'); | ||
} | ||
@@ -344,0 +350,0 @@ } |
@@ -22,2 +22,3 @@ /** | ||
* Creates an inner dialog context for the containers active child. | ||
* | ||
* @param dc Parents dialog context. | ||
@@ -29,3 +30,5 @@ * @returns A new dialog context for the active child or `undefined` if there is no active child. | ||
* Finds a child dialog that was previously added to the container. | ||
* | ||
* @param dialogId ID of the dialog to lookup. | ||
* @returns The Dialog if found; otherwise null. | ||
*/ | ||
@@ -39,2 +42,3 @@ findDialog(dialogId: string): Dialog | undefined; | ||
* @param e The event being raised. | ||
* @returns True if the event is handled by the current dialog and bubbling should stop. | ||
*/ | ||
@@ -70,2 +74,4 @@ onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>; | ||
* Get the current telemetry client. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
@@ -72,0 +78,0 @@ get telemetryClient(): BotTelemetryClient; |
@@ -37,3 +37,5 @@ "use strict"; | ||
* Finds a child dialog that was previously added to the container. | ||
* | ||
* @param dialogId ID of the dialog to lookup. | ||
* @returns The Dialog if found; otherwise null. | ||
*/ | ||
@@ -49,2 +51,3 @@ findDialog(dialogId) { | ||
* @param e The event being raised. | ||
* @returns True if the event is handled by the current dialog and bubbling should stop. | ||
*/ | ||
@@ -115,2 +118,4 @@ onDialogEvent(dc, e) { | ||
* Get the current telemetry client. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
@@ -117,0 +122,0 @@ get telemetryClient() { |
@@ -49,2 +49,3 @@ /** | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -59,2 +60,3 @@ * @param contextOrDC The [TurnContext](xref:botbuilder-core.TurnContext) object for the current turn of the bot. | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -89,7 +91,7 @@ * @param contextOrDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for the current turn of the bot. | ||
/** | ||
* Returns dialog context for child if the active dialog is a container. | ||
* @returns Dialog context for child if the active dialog is a container. | ||
*/ | ||
get child(): DialogContext | undefined; | ||
/** | ||
* Returns the state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* @returns The state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* the stack is empty. | ||
@@ -107,5 +109,4 @@ */ | ||
/** | ||
* Returns the current dialog manager instance. This property is obsolete. | ||
* | ||
* @obsolete This property serves no function. | ||
* @deprecated This property serves no function. | ||
* @returns The current dialog manager instance. This property is deprecated. | ||
*/ | ||
@@ -115,2 +116,3 @@ get dialogManager(): DialogManager; | ||
* Obtain the CultureInfo in DialogContext. | ||
* | ||
* @returns a locale string. | ||
@@ -125,3 +127,3 @@ */ | ||
* @param options Optional. Arguments to pass into the dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -155,3 +157,3 @@ * If there's already an active dialog on the stack, that dialog will be paused until | ||
* @param eventValue Optional. Value to pass along with custom cancellation event. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -179,3 +181,3 @@ * This calls each dialog's [Dialog.endDialog](xref:botbuilder-dialogs.Dialog.endDialog) method before | ||
* @param dialogId ID of the dialog to search for. | ||
* | ||
* @returns The dialog for the provided ID. | ||
* @remarks | ||
@@ -192,2 +194,3 @@ * If the dialog to start is not found in the [DialogSet](xref:botbuilder-dialogs.DialogSet) associated | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -211,2 +214,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -231,2 +235,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -257,3 +262,3 @@ * After the call completes, you can check the turn context's [responded](xref:botbuilder-core.TurnContext.responded) | ||
* the bot's turn handler. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -289,3 +294,3 @@ * The _parent_ dialog is the next dialog on the dialog stack, if there is one. This method | ||
* @param options Optional. Arguments to pass into the new dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -319,2 +324,3 @@ * This is particularly useful for creating a loop or redirecting to another dialog. | ||
* Searches for a dialog with a given ID. | ||
* | ||
* @remarks | ||
@@ -321,0 +327,0 @@ * Emits a named event for the current dialog, or someone who started it, to handle. |
@@ -29,2 +29,3 @@ "use strict"; | ||
* @param promise a promise to await inside a try-catch for error enrichment | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -68,2 +69,3 @@ const wrapErrors = (dialogContext, promise) => __awaiter(void 0, void 0, void 0, function* () { | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -100,3 +102,3 @@ * @param contextOrDC The [TurnContext](xref:botbuilder-core.TurnContext) or [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the bot. | ||
/** | ||
* Returns dialog context for child if the active dialog is a container. | ||
* @returns Dialog context for child if the active dialog is a container. | ||
*/ | ||
@@ -115,3 +117,3 @@ get child() { | ||
/** | ||
* Returns the state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* @returns The state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* the stack is empty. | ||
@@ -123,5 +125,4 @@ */ | ||
/** | ||
* Returns the current dialog manager instance. This property is obsolete. | ||
* | ||
* @obsolete This property serves no function. | ||
* @deprecated This property serves no function. | ||
* @returns The current dialog manager instance. This property is deprecated. | ||
*/ | ||
@@ -133,2 +134,3 @@ get dialogManager() { | ||
* Obtain the CultureInfo in DialogContext. | ||
* | ||
* @returns a locale string. | ||
@@ -155,3 +157,3 @@ */ | ||
* @param options Optional. Arguments to pass into the dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -201,3 +203,3 @@ * If there's already an active dialog on the stack, that dialog will be paused until | ||
* @param eventValue Optional. Value to pass along with custom cancellation event. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -226,2 +228,3 @@ * This calls each dialog's [Dialog.endDialog](xref:botbuilder-dialogs.Dialog.endDialog) method before | ||
let notify = false; | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
let dc = this; | ||
@@ -257,3 +260,3 @@ while (dc != undefined) { | ||
* @param dialogId ID of the dialog to search for. | ||
* | ||
* @returns The dialog for the provided ID. | ||
* @remarks | ||
@@ -276,2 +279,3 @@ * If the dialog to start is not found in the [DialogSet](xref:botbuilder-dialogs.DialogSet) associated | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -282,2 +286,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
* for use with a [ChoicePrompt](xref:botbuilder-dialogs.ChoicePrompt). | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks This helper method formats the object to use as the `options` parameter, and then calls | ||
@@ -310,2 +315,3 @@ * beginDialog to start the specified prompt dialog. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -361,3 +367,3 @@ * After the call completes, you can check the turn context's [responded](xref:botbuilder-core.TurnContext.responded) | ||
* the bot's turn handler. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -413,3 +419,3 @@ * The _parent_ dialog is the next dialog on the dialog stack, if there is one. This method | ||
* @param options Optional. Arguments to pass into the new dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -468,2 +474,3 @@ * This is particularly useful for creating a loop or redirecting to another dialog. | ||
* Searches for a dialog with a given ID. | ||
* | ||
* @remarks | ||
@@ -486,4 +493,6 @@ * Emits a named event for the current dialog, or someone who started it, to handle. | ||
// Find starting dialog | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
let dc = this; | ||
if (fromLeaf) { | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
@@ -490,0 +499,0 @@ const childDc = dc.child; |
@@ -20,2 +20,9 @@ /** | ||
export declare function runDialog(dialog: Dialog, context: TurnContext, accessor: StatePropertyAccessor<DialogState>): Promise<void>; | ||
/** | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param dialogId The dialog ID. | ||
* @param dialogContext The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param dialogStateManagerConfiguration Configuration for the dialog state manager. | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
*/ | ||
export declare function internalRun(context: TurnContext, dialogId: string, dialogContext: DialogContext, dialogStateManagerConfiguration?: DialogStateManagerConfiguration): Promise<DialogTurnResult>; | ||
@@ -25,4 +32,5 @@ /** | ||
* | ||
* @param context | ||
* @param turnResult | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param turnResult The dialog turn result. | ||
* @returns True if should send EoC, otherwise false. | ||
*/ | ||
@@ -29,0 +37,0 @@ export declare function shouldSendEndOfConversationToParent(context: TurnContext, turnResult: DialogTurnResult): boolean; |
@@ -56,2 +56,9 @@ "use strict"; | ||
exports.runDialog = runDialog; | ||
/** | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param dialogId The dialog ID. | ||
* @param dialogContext The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param dialogStateManagerConfiguration Configuration for the dialog state manager. | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
*/ | ||
function internalRun(context, dialogId, dialogContext, dialogStateManagerConfiguration) { | ||
@@ -146,4 +153,5 @@ return __awaiter(this, void 0, void 0, function* () { | ||
* | ||
* @param context | ||
* @param turnResult | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param turnResult The dialog turn result. | ||
* @returns True if should send EoC, otherwise false. | ||
*/ | ||
@@ -150,0 +158,0 @@ function shouldSendEndOfConversationToParent(context, turnResult) { |
@@ -41,3 +41,3 @@ /** | ||
* | ||
* @obsolete This class will be deprecated. | ||
* @deprecated This class will be deprecated. | ||
*/ | ||
@@ -65,2 +65,4 @@ export declare class DialogManager extends Configurable { | ||
* Values that will be copied to the `TurnContext.turnState` at the beginning of each turn. | ||
* | ||
* @returns The turn state collection. | ||
*/ | ||
@@ -67,0 +69,0 @@ get initialTurnState(): TurnContextStateCollection; |
@@ -33,3 +33,3 @@ "use strict"; | ||
* | ||
* @obsolete This class will be deprecated. | ||
* @deprecated This class will be deprecated. | ||
*/ | ||
@@ -58,2 +58,4 @@ class DialogManager extends configurable_1.Configurable { | ||
* Values that will be copied to the `TurnContext.turnState` at the beginning of each turn. | ||
* | ||
* @returns The turn state collection. | ||
*/ | ||
@@ -105,3 +107,3 @@ get initialTurnState() { | ||
if (!this._rootDialogId) { | ||
throw new Error(`DialogManager.onTurn: the bot's 'rootDialog' has not been configured.`); | ||
throw new Error("DialogManager.onTurn: the bot's 'rootDialog' has not been configured."); | ||
} | ||
@@ -120,3 +122,3 @@ // Copy initial turn state to context | ||
if (!this.conversationState) { | ||
throw new Error(`DialogManager.onTurn: the bot's 'conversationState' has not been configured.`); | ||
throw new Error("DialogManager.onTurn: the bot's 'conversationState' has not been configured."); | ||
} | ||
@@ -123,0 +125,0 @@ botStateSet.add(this.conversationState); |
import { BotComponent } from 'botbuilder-core'; | ||
import { Configuration, ServiceCollection } from 'botbuilder-dialogs-adaptive-runtime-core'; | ||
/** | ||
* Bot component for bot Dialogs. | ||
*/ | ||
export declare class DialogsBotComponent extends BotComponent { | ||
/** | ||
* @param services Services Collection to register. | ||
* @param configuration Configuration for the bot component. | ||
*/ | ||
configureServices(services: ServiceCollection, configuration: Configuration): void; | ||
} | ||
//# sourceMappingURL=dialogsBotComponent.d.ts.map |
@@ -11,3 +11,10 @@ "use strict"; | ||
const InitialSettings = z.record(z.unknown()); | ||
/** | ||
* Bot component for bot Dialogs. | ||
*/ | ||
class DialogsBotComponent extends botbuilder_core_1.BotComponent { | ||
/** | ||
* @param services Services Collection to register. | ||
* @param configuration Configuration for the bot component. | ||
*/ | ||
configureServices(services, configuration) { | ||
@@ -14,0 +21,0 @@ services.composeFactory('memoryScopes', (memoryScopes) => { |
@@ -15,2 +15,5 @@ /** | ||
private readonly services; | ||
/** | ||
* Creates an instance of the [DialogsComponentRegistration](xref:botbuilder-dialogs.DialogsComponentRegistration) class. | ||
*/ | ||
constructor(); | ||
@@ -17,0 +20,0 @@ /** |
@@ -18,2 +18,5 @@ "use strict"; | ||
class DialogsComponentRegistration extends botbuilder_core_1.ComponentRegistration { | ||
/** | ||
* Creates an instance of the [DialogsComponentRegistration](xref:botbuilder-dialogs.DialogsComponentRegistration) class. | ||
*/ | ||
constructor() { | ||
@@ -20,0 +23,0 @@ super(); |
@@ -85,2 +85,3 @@ /** | ||
* | ||
* @returns A version that will change when any of the child dialogs version changes. | ||
* @remarks | ||
@@ -100,2 +101,3 @@ * This hash is persisted to state storage and used to detect changes to a dialog set. | ||
* If a telemetryClient is present on the dialog set, it will be added to each dialog. | ||
* @returns The dialog set after the operation is complete. | ||
*/ | ||
@@ -105,3 +107,5 @@ add<T extends Dialog>(dialog: T): this; | ||
* Creates a dialog context which can be used to work with the dialogs in the set. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -119,2 +123,3 @@ createContext(context: TurnContext): Promise<DialogContext>; | ||
* @param dialogId ID of the dialog or prompt to lookup. | ||
* @returns The dialog if found; otherwise undefined. | ||
*/ | ||
@@ -124,2 +129,4 @@ find(dialogId: string): Dialog | undefined; | ||
* Set the telemetry client for this dialog set and apply it to all current dialogs. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
@@ -126,0 +133,0 @@ get telemetryClient(): BotTelemetryClient; |
@@ -90,2 +90,3 @@ "use strict"; | ||
* | ||
* @returns A version that will change when any of the child dialogs version changes. | ||
* @remarks | ||
@@ -117,6 +118,7 @@ * This hash is persisted to state storage and used to detect changes to a dialog set. | ||
* If a telemetryClient is present on the dialog set, it will be added to each dialog. | ||
* @returns The dialog set after the operation is complete. | ||
*/ | ||
add(dialog) { | ||
if (!(dialog instanceof dialog_1.Dialog)) { | ||
throw new Error(`DialogSet.add(): Invalid dialog being added.`); | ||
throw new Error('DialogSet.add(): Invalid dialog being added.'); | ||
} | ||
@@ -126,3 +128,3 @@ // Ensure new version hash is computed | ||
// Ensure dialogs ID is unique. | ||
if (this.dialogs.hasOwnProperty(dialog.id)) { | ||
if (Object.prototype.hasOwnProperty.call(this.dialogs, dialog.id)) { | ||
// If we are trying to add the same exact instance, it's not a name collision. | ||
@@ -136,5 +138,6 @@ // No operation required since the instance is already in the dialog set. | ||
let nextSuffix = 2; | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const suffixId = dialog.id + nextSuffix.toString(); | ||
if (!this.dialogs.hasOwnProperty(suffixId)) { | ||
if (!Object.prototype.hasOwnProperty.call(this.dialogs, suffixId)) { | ||
dialog.id = suffixId; | ||
@@ -164,3 +167,5 @@ break; | ||
* Creates a dialog context which can be used to work with the dialogs in the set. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -170,3 +175,3 @@ createContext(context) { | ||
if (!this.dialogState) { | ||
throw new Error(`DialogSet.createContext(): the dialog set was not bound to a stateProperty when constructed.`); | ||
throw new Error('DialogSet.createContext(): the dialog set was not bound to a stateProperty when constructed.'); | ||
} | ||
@@ -187,8 +192,11 @@ const state = yield this.dialogState.get(context, { dialogStack: [] }); | ||
* @param dialogId ID of the dialog or prompt to lookup. | ||
* @returns The dialog if found; otherwise undefined. | ||
*/ | ||
find(dialogId) { | ||
return this.dialogs.hasOwnProperty(dialogId) ? this.dialogs[dialogId] : undefined; | ||
return Object.prototype.hasOwnProperty.call(this.dialogs, dialogId) ? this.dialogs[dialogId] : undefined; | ||
} | ||
/** | ||
* Set the telemetry client for this dialog set and apply it to all current dialogs. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
@@ -195,0 +203,0 @@ get telemetryClient() { |
@@ -52,3 +52,3 @@ /** | ||
* This always returns a CLONE of the memory, any modifications to the result will not affect memory. | ||
* @param T The value type to return. | ||
* @template T The value type to return. | ||
* @param pathExpression Path expression to use. | ||
@@ -61,2 +61,3 @@ * @param defaultValue (Optional) default value to use if the path isn't found. May be a function that returns the default value to use. | ||
* Set memory to value. | ||
* | ||
* @param pathExpression Path to memory. | ||
@@ -68,3 +69,4 @@ * @param value Value to set. | ||
* Delete property from memory | ||
* @param path The leaf property to remove. | ||
* | ||
* @param pathExpression The leaf property to remove. | ||
*/ | ||
@@ -88,2 +90,4 @@ deleteValue(pathExpression: string): void; | ||
* Deletes all of the backing memory for a given scope. | ||
* | ||
* @param name Name of the scope. | ||
*/ | ||
@@ -103,2 +107,3 @@ deleteScopesMemory(name: string): Promise<void>; | ||
* Transform the path using the registered path transformers. | ||
* | ||
* @param pathExpression The path to transform. | ||
@@ -110,2 +115,3 @@ * @returns The transformed path. | ||
* Gets all memory scopes suitable for logging. | ||
* | ||
* @returns Object which represents all memory scopes. | ||
@@ -116,2 +122,3 @@ */ | ||
* Track when specific paths are changed. | ||
* | ||
* @param paths Paths to track. | ||
@@ -123,2 +130,3 @@ * @returns Normalized paths to pass to [anyPathChanged()](#anypathchanged). | ||
* Check to see if any path has changed since watermark. | ||
* | ||
* @param counter Time counter to compare to. | ||
@@ -155,2 +163,3 @@ * @param paths Paths from [trackPaths()](#trackpaths) to check. | ||
* Gets the version number. | ||
* | ||
* @returns A string with the version number. | ||
@@ -157,0 +166,0 @@ */ |
@@ -76,3 +76,3 @@ "use strict"; | ||
* This always returns a CLONE of the memory, any modifications to the result will not affect memory. | ||
* @param T The value type to return. | ||
* @template T The value type to return. | ||
* @param pathExpression Path expression to use. | ||
@@ -103,2 +103,3 @@ * @param defaultValue (Optional) default value to use if the path isn't found. May be a function that returns the default value to use. | ||
* Set memory to value. | ||
* | ||
* @param pathExpression Path to memory. | ||
@@ -112,3 +113,3 @@ * @param value Value to set. | ||
if (segments.length < 1) { | ||
throw new Error(`DialogStateManager.setValue: path wasn't specified.`); | ||
throw new Error("DialogStateManager.setValue: path wasn't specified."); | ||
} | ||
@@ -164,3 +165,4 @@ // Track changes | ||
* Delete property from memory | ||
* @param path The leaf property to remove. | ||
* | ||
* @param pathExpression The leaf property to remove. | ||
*/ | ||
@@ -227,2 +229,4 @@ deleteValue(pathExpression) { | ||
* Deletes all of the backing memory for a given scope. | ||
* | ||
* @param name Name of the scope. | ||
*/ | ||
@@ -371,2 +375,3 @@ deleteScopesMemory(name) { | ||
* Transform the path using the registered path transformers. | ||
* | ||
* @param pathExpression The path to transform. | ||
@@ -385,2 +390,3 @@ * @returns The transformed path. | ||
* Gets all memory scopes suitable for logging. | ||
* | ||
* @returns Object which represents all memory scopes. | ||
@@ -399,2 +405,3 @@ */ | ||
* Track when specific paths are changed. | ||
* | ||
* @param paths Paths to track. | ||
@@ -420,2 +427,3 @@ * @returns Normalized paths to pass to [anyPathChanged()](#anypathchanged). | ||
* Check to see if any path has changed since watermark. | ||
* | ||
* @param counter Time counter to compare to. | ||
@@ -579,2 +587,3 @@ * @param paths Paths from [trackPaths()](#trackpaths) to check. | ||
* Gets the version number. | ||
* | ||
* @returns A string with the version number. | ||
@@ -581,0 +590,0 @@ */ |
@@ -18,2 +18,3 @@ /** | ||
* Initializes a new instance of the [AliasPathResolver](xref:botbuilder-dialogs.AliasPathResolver) class. | ||
* | ||
* @param alias Alias name. | ||
@@ -26,2 +27,3 @@ * @param prefix Prefix name. | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
@@ -28,0 +30,0 @@ * @returns The transformed path. |
@@ -10,2 +10,3 @@ "use strict"; | ||
* Initializes a new instance of the [AliasPathResolver](xref:botbuilder-dialogs.AliasPathResolver) class. | ||
* | ||
* @param alias Alias name. | ||
@@ -22,2 +23,3 @@ * @param prefix Prefix name. | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
@@ -24,0 +26,0 @@ * @returns The transformed path. |
@@ -21,2 +21,3 @@ /** | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
@@ -23,0 +24,0 @@ * @returns The transformed path. |
@@ -26,2 +26,3 @@ "use strict"; | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
@@ -28,0 +29,0 @@ * @returns The transformed path. |
@@ -11,2 +11,3 @@ /** | ||
* Transform the path | ||
* | ||
* @param path Path to inspect. | ||
@@ -13,0 +14,0 @@ * @returns Transformed path |
@@ -10,2 +10,3 @@ import { MemoryScope } from './memoryScope'; | ||
* Initializes a new instance of the [BotStateMemoryScope](xref:adaptive-expressions.BotStateMemoryScope) class. | ||
* | ||
* @param name name of the property. | ||
@@ -16,3 +17,5 @@ */ | ||
* Get the backing memory for this scope. | ||
* @param dc current dialog context | ||
* | ||
* @param dc current dialog context. | ||
* @returns Memory for the scope. | ||
*/ | ||
@@ -22,8 +25,10 @@ getMemory(dc: DialogContext): object; | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc current dialog context | ||
* @param memory memory | ||
* @param _memory memory | ||
*/ | ||
setMemory(dc: DialogContext, memory: object): void; | ||
setMemory(dc: DialogContext, _memory: object): void; | ||
/** | ||
* Populates the state cache for this [BotState](xref:botbuilder-core.BotState) from the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -37,2 +42,3 @@ * @param force Optional, `true` to overwrite any existing state cache; | ||
* Writes the state cache for this [BotState](xref:botbuilder-core.BotState) to the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -46,7 +52,8 @@ * @param force Optional, `true` to save the state cache to storage; | ||
* Deletes any state in storage and the cache for this [BotState](xref:botbuilder-core.BotState). | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns A Promise that represents the work queued to execute. | ||
*/ | ||
delete(dc: DialogContext): Promise<void>; | ||
delete(_dc: DialogContext): Promise<void>; | ||
} | ||
//# sourceMappingURL=botStateMemoryScope.d.ts.map |
@@ -20,2 +20,3 @@ "use strict"; | ||
* Initializes a new instance of the [BotStateMemoryScope](xref:adaptive-expressions.BotStateMemoryScope) class. | ||
* | ||
* @param name name of the property. | ||
@@ -28,3 +29,5 @@ */ | ||
* Get the backing memory for this scope. | ||
* @param dc current dialog context | ||
* | ||
* @param dc current dialog context. | ||
* @returns Memory for the scope. | ||
*/ | ||
@@ -40,6 +43,7 @@ getMemory(dc) { | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc current dialog context | ||
* @param memory memory | ||
* @param _memory memory | ||
*/ | ||
setMemory(dc, memory) { | ||
setMemory(dc, _memory) { | ||
const botState = dc.context.turnState.get(this.stateKey); | ||
@@ -49,6 +53,7 @@ if (!botState) { | ||
} | ||
throw new Error(`You cannot replace the root BotState object.`); | ||
throw new Error('You cannot replace the root BotState object.'); | ||
} | ||
/** | ||
* Populates the state cache for this [BotState](xref:botbuilder-core.BotState) from the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -69,2 +74,3 @@ * @param force Optional, `true` to overwrite any existing state cache; | ||
* Writes the state cache for this [BotState](xref:botbuilder-core.BotState) to the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -85,6 +91,7 @@ * @param force Optional, `true` to save the state cache to storage; | ||
* Deletes any state in storage and the cache for this [BotState](xref:botbuilder-core.BotState). | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns A Promise that represents the work queued to execute. | ||
*/ | ||
delete(dc) { | ||
delete(_dc) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -91,0 +98,0 @@ return Promise.resolve(); |
@@ -17,2 +17,3 @@ /** | ||
* Initializes a new instance of the [ClassMemoryScope](xref:botbuilder-dialogs.ClassMemoryScope) class. | ||
* | ||
* @param name Name of the scope class. | ||
@@ -23,2 +24,3 @@ */ | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -30,3 +32,5 @@ * @returns The memory for the scope. | ||
* Override to find the dialog instance referenced by the scope. | ||
* | ||
* @param dc Current dialog context. | ||
* @returns The dialog instance referenced by the scope. | ||
*/ | ||
@@ -33,0 +37,0 @@ protected onFindDialog(dc: DialogContext): Dialog; |
@@ -19,2 +19,3 @@ "use strict"; | ||
* Initializes a new instance of the [ClassMemoryScope](xref:botbuilder-dialogs.ClassMemoryScope) class. | ||
* | ||
* @param name Name of the scope class. | ||
@@ -27,2 +28,3 @@ */ | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -40,3 +42,3 @@ * @returns The memory for the scope. | ||
const prop = dialog[key]; | ||
if (dialog.hasOwnProperty(key) && typeof prop != 'function') { | ||
if (Object.prototype.hasOwnProperty.call(dialog, key) && typeof prop != 'function') { | ||
if (isExpression(prop)) { | ||
@@ -60,3 +62,5 @@ const { value, error } = prop.tryGetValue(dc.state); | ||
* Override to find the dialog instance referenced by the scope. | ||
* | ||
* @param dc Current dialog context. | ||
* @returns The dialog instance referenced by the scope. | ||
*/ | ||
@@ -63,0 +67,0 @@ onFindDialog(dc) { |
@@ -22,3 +22,3 @@ /** | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @retuns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* @returns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
*/ | ||
@@ -25,0 +25,0 @@ protected onFindDialog(dc: DialogContext): Dialog; |
@@ -27,3 +27,3 @@ "use strict"; | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @retuns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* @returns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
*/ | ||
@@ -30,0 +30,0 @@ onFindDialog(dc) { |
@@ -20,2 +20,3 @@ /** | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The `DialogContext` object for this turn. | ||
@@ -22,0 +23,0 @@ * @returns Memory for the scope. |
@@ -25,2 +25,3 @@ "use strict"; | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The `DialogContext` object for this turn. | ||
@@ -27,0 +28,0 @@ * @returns Memory for the scope. |
@@ -20,2 +20,3 @@ /** | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -27,2 +28,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -29,0 +31,0 @@ * @param memory Memory object to set for the scope. |
@@ -26,2 +26,3 @@ "use strict"; | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -43,2 +44,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -49,3 +51,3 @@ * @param memory Memory object to set for the scope. | ||
if (memory == undefined) { | ||
throw new Error(`DialogMemoryScope.setMemory: undefined memory object passed in.`); | ||
throw new Error('DialogMemoryScope.setMemory: undefined memory object passed in.'); | ||
} | ||
@@ -61,3 +63,3 @@ // If active dialog is a container dialog then "dialog" binds to it. | ||
if (!parent.activeDialog) { | ||
throw new Error(`DialogMemoryScope.setMemory: no active dialog found.`); | ||
throw new Error('DialogMemoryScope.setMemory: no active dialog found.'); | ||
} | ||
@@ -64,0 +66,0 @@ parent.activeDialog.state = memory; |
@@ -15,2 +15,3 @@ /** | ||
* Initializes a new instance of the [MemoryScope](xref:botbuilder-dialogs.MemoryScope) class. | ||
* | ||
* @param name Name of the scope. | ||
@@ -31,2 +32,3 @@ * @param includeInSnapshot Boolean value indicating whether this memory | ||
* Get the backing memory for this scope | ||
* | ||
* @param dc Current dialog context. | ||
@@ -38,22 +40,26 @@ * @returns memory for the scope | ||
* Changes the backing object for the memory scope. | ||
* @param dc Current dialog context | ||
* @param memory memory to assign | ||
* | ||
* @param _dc Current dialog context | ||
* @param _memory memory to assign | ||
*/ | ||
setMemory(dc: DialogContext, memory: object): void; | ||
setMemory(_dc: DialogContext, _memory: object): void; | ||
/** | ||
* Loads a scopes backing memory at the start of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
load(dc: DialogContext): Promise<void>; | ||
load(_dc: DialogContext): Promise<void>; | ||
/** | ||
* Saves a scopes backing memory at the end of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
saveChanges(dc: DialogContext): Promise<void>; | ||
saveChanges(_dc: DialogContext): Promise<void>; | ||
/** | ||
* Deletes the backing memory for a scope. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
delete(dc: DialogContext): Promise<void>; | ||
delete(_dc: DialogContext): Promise<void>; | ||
} | ||
//# sourceMappingURL=memoryScope.d.ts.map |
@@ -19,2 +19,3 @@ "use strict"; | ||
* Initializes a new instance of the [MemoryScope](xref:botbuilder-dialogs.MemoryScope) class. | ||
* | ||
* @param name Name of the scope. | ||
@@ -30,6 +31,7 @@ * @param includeInSnapshot Boolean value indicating whether this memory | ||
* Changes the backing object for the memory scope. | ||
* @param dc Current dialog context | ||
* @param memory memory to assign | ||
* | ||
* @param _dc Current dialog context | ||
* @param _memory memory to assign | ||
*/ | ||
setMemory(dc, memory) { | ||
setMemory(_dc, _memory) { | ||
throw new Error(`MemoryScope.setMemory: The '${this.name}' memory scope is read-only.`); | ||
@@ -39,5 +41,6 @@ } | ||
* Loads a scopes backing memory at the start of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
load(dc) { | ||
load(_dc) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -49,5 +52,6 @@ // No initialization by default. | ||
* Saves a scopes backing memory at the end of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
saveChanges(dc) { | ||
saveChanges(_dc) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -59,5 +63,6 @@ // No initialization by default. | ||
* Deletes the backing memory for a scope. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
delete(dc) { | ||
delete(_dc) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -64,0 +69,0 @@ throw new Error(`MemoryScope.delete: The '${this.name}' memory scope can't be deleted.`); |
@@ -29,2 +29,5 @@ /** | ||
getMemory(dc: DialogContext): Record<string, unknown>; | ||
/** | ||
* @param dc Current dialog context. | ||
*/ | ||
load(dc: DialogContext): Promise<void>; | ||
@@ -31,0 +34,0 @@ /** |
@@ -81,2 +81,5 @@ "use strict"; | ||
} | ||
/** | ||
* @param dc Current dialog context. | ||
*/ | ||
load(dc) { | ||
@@ -83,0 +86,0 @@ const _super = Object.create(null, { |
@@ -20,2 +20,3 @@ /** | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -27,2 +28,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -29,0 +31,0 @@ * @param memory Memory object to set for the scope. |
@@ -25,2 +25,3 @@ "use strict"; | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -34,2 +35,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -40,6 +42,6 @@ * @param memory Memory object to set for the scope. | ||
if (memory == undefined) { | ||
throw new Error(`ThisMemoryScope.setMemory: undefined memory object passed in.`); | ||
throw new Error('ThisMemoryScope.setMemory: undefined memory object passed in.'); | ||
} | ||
if (!dc.activeDialog) { | ||
throw new Error(`ThisMemoryScope.setMemory: no active dialog found.`); | ||
throw new Error('ThisMemoryScope.setMemory: no active dialog found.'); | ||
} | ||
@@ -46,0 +48,0 @@ dc.activeDialog.state = memory; |
@@ -20,2 +20,3 @@ /** | ||
* Get the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
@@ -27,2 +28,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
@@ -29,0 +31,0 @@ * @param memory Memory object to set for the scope. |
@@ -29,2 +29,3 @@ "use strict"; | ||
* Get the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
@@ -43,2 +44,3 @@ * @returns The memory for the scope. | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
@@ -49,3 +51,3 @@ * @param memory Memory object to set for the scope. | ||
if (memory == undefined) { | ||
throw new Error(`TurnMemoryScope.setMemory: undefined memory object passed in.`); | ||
throw new Error('TurnMemoryScope.setMemory: undefined memory object passed in.'); | ||
} | ||
@@ -52,0 +54,0 @@ dc.context.turnState.set(TURN_STATE, memory); |
@@ -24,2 +24,3 @@ /** | ||
* Creates a new ActivityPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -31,2 +32,3 @@ * @param validator Validator that will be called each time a new activity is received. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -44,2 +46,3 @@ * turn of the conversation. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -58,13 +61,15 @@ * turn of conversation. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
* of the conversation. | ||
* @param reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* @param _reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* the dialog resumed. | ||
* @param result Optional. Value returned from the previous dialog on the stack. | ||
* @param _result Optional. Value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -79,2 +84,3 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -91,11 +97,12 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, attempts to recognize the incoming [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: object, options: PromptOptions): Promise<PromptRecognizerResult<Activity>>; | ||
protected onRecognize(context: TurnContext, _state: object, _options: PromptOptions): Promise<PromptRecognizerResult<Activity>>; | ||
} | ||
//# sourceMappingURL=activityPrompt.d.ts.map |
@@ -33,2 +33,3 @@ "use strict"; | ||
* Creates a new ActivityPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -43,2 +44,3 @@ * @param validator Validator that will be called each time a new activity is received. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -74,2 +76,3 @@ * turn of the conversation. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -117,11 +120,12 @@ * turn of conversation. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
* of the conversation. | ||
* @param reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* @param _reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* the dialog resumed. | ||
* @param result Optional. Value returned from the previous dialog on the stack. | ||
* @param _result Optional. Value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc, reason, result) { | ||
resumeDialog(dc, _reason, _result) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -139,2 +143,3 @@ // Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -154,2 +159,3 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -175,10 +181,11 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, attempts to recognize the incoming [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
onRecognize(context, state, options) { | ||
onRecognize(context, _state, _options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -185,0 +192,0 @@ return { succeeded: true, value: context.activity }; |
@@ -19,2 +19,3 @@ /** | ||
* Creates a new `AttachmentPrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -26,2 +27,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -38,10 +40,11 @@ * @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A prompt options object constructed from the options initially provided | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A prompt options object constructed from the options initially provided | ||
* in the call to Prompt. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<Attachment[]>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<Attachment[]>>; | ||
} | ||
//# sourceMappingURL=attachmentPrompt.d.ts.map |
@@ -31,2 +31,3 @@ "use strict"; | ||
* Creates a new `AttachmentPrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -40,2 +41,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -61,9 +63,10 @@ * @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A prompt options object constructed from the options initially provided | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A prompt options object constructed from the options initially provided | ||
* in the call to Prompt. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
onRecognize(context, state, options) { | ||
onRecognize(context, _state, _options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -70,0 +73,0 @@ const value = context.activity.attachments; |
@@ -49,2 +49,3 @@ /** | ||
* Creates a new `ChoicePrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet`. | ||
@@ -59,2 +60,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. If the validator replies with a message no additional retry prompt will be sent. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -72,2 +74,3 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext) context for the current | ||
@@ -74,0 +77,0 @@ * turn of conversation with the user. |
@@ -26,2 +26,3 @@ "use strict"; | ||
* Creates a new `ChoicePrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet`. | ||
@@ -55,2 +56,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. If the validator replies with a message no additional retry prompt will be sent. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -88,2 +90,3 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext) context for the current | ||
@@ -90,0 +93,0 @@ * turn of conversation with the user. |
@@ -46,5 +46,7 @@ import { TurnContext } from 'botbuilder-core'; | ||
* Creates a new ConfirmPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
* @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`. | ||
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on [[PromptCultureModels.getSupportedCultures()]]. | ||
*/ | ||
@@ -54,2 +56,3 @@ constructor(dialogId: string, validator?: PromptValidator<boolean>, defaultLocale?: string, choiceDefaults?: ChoiceDefaultsConfirmPrompt); | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -67,10 +70,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<boolean>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<boolean>>; | ||
/** | ||
@@ -77,0 +81,0 @@ * @private |
@@ -34,5 +34,7 @@ "use strict"; | ||
* Creates a new ConfirmPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
* @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`. | ||
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on [[PromptCultureModels.getSupportedCultures()]]. | ||
*/ | ||
@@ -64,2 +66,3 @@ constructor(dialogId, validator, defaultLocale, choiceDefaults) { | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -94,10 +97,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
onRecognize(context, state, options) { | ||
onRecognize(context, _state, _options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -104,0 +108,0 @@ const result = { succeeded: false }; |
@@ -35,2 +35,3 @@ import { TurnContext } from 'botbuilder-core'; | ||
* Creates a new DateTimePrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -43,2 +44,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -56,11 +58,12 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<DateTimeResolution[]>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<DateTimeResolution[]>>; | ||
} | ||
//# sourceMappingURL=datetimePrompt.d.ts.map |
@@ -32,2 +32,3 @@ "use strict"; | ||
* Creates a new DateTimePrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -43,2 +44,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -65,10 +67,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
onRecognize(context, state, options) { | ||
onRecognize(context, _state, _options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -75,0 +78,0 @@ const result = { succeeded: false }; |
@@ -16,2 +16,3 @@ import { TurnContext } from 'botbuilder-core'; | ||
* Creates a new NumberPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -24,2 +25,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -37,10 +39,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: unknown, options: PromptOptions): Promise<PromptRecognizerResult<number>>; | ||
protected onRecognize(context: TurnContext, _state: unknown, _options: PromptOptions): Promise<PromptRecognizerResult<number>>; | ||
/** | ||
@@ -47,0 +50,0 @@ * @private |
@@ -36,2 +36,3 @@ "use strict"; | ||
* Creates a new NumberPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -47,2 +48,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -69,10 +71,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
onRecognize(context, state, options) { | ||
onRecognize(context, _state, _options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -97,3 +100,3 @@ const result = { succeeded: false }; | ||
} | ||
catch (err) { | ||
catch (_a) { | ||
numberParser = Globalize(this.getCultureFormattedForGlobalize(defaultLocale)).numberParser(); | ||
@@ -100,0 +103,0 @@ } |
@@ -124,2 +124,3 @@ /** | ||
* Creates a new OAuthPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -145,2 +146,3 @@ * @param settings Settings used to configure the prompt. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
@@ -158,4 +160,6 @@ * of the conversation. | ||
* Attempts to retrieve the stored token for the current user. | ||
* | ||
* @param context Context reference the user that's being looked up. | ||
* @param code (Optional) login code received from the user. | ||
* @returns The token response. | ||
*/ | ||
@@ -177,2 +181,3 @@ getUserToken(context: TurnContext, code?: string): Promise<TokenResponse | undefined>; | ||
* @param context Context referencing the user that's being signed out. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -179,0 +184,0 @@ signOutUser(context: TurnContext): Promise<void>; |
@@ -103,2 +103,3 @@ "use strict"; | ||
* Creates a new OAuthPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -156,2 +157,3 @@ * @param settings Settings used to configure the prompt. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
@@ -218,4 +220,6 @@ * of the conversation. | ||
* Attempts to retrieve the stored token for the current user. | ||
* | ||
* @param context Context reference the user that's being looked up. | ||
* @param code (Optional) login code received from the user. | ||
* @returns The token response. | ||
*/ | ||
@@ -241,2 +245,3 @@ getUserToken(context, code) { | ||
* @param context Context referencing the user that's being signed out. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -468,3 +473,3 @@ signOutUser(context) { | ||
static isTokenExchangeRequest(obj) { | ||
if (obj.hasOwnProperty('token')) { | ||
if (Object.prototype.hasOwnProperty.call(obj, 'token')) { | ||
return true; | ||
@@ -471,0 +476,0 @@ } |
@@ -70,2 +70,3 @@ /** | ||
* Result returned by a prompts recognizer function. | ||
* | ||
* @param T Type of value being recognized. | ||
@@ -105,2 +106,3 @@ */ | ||
* Contextual information passed to a custom `PromptValidator`. | ||
* | ||
* @param T Type of recognizer result being validated. | ||
@@ -147,2 +149,3 @@ */ | ||
* Base class for all prompts. | ||
* | ||
* @param T Type of value being returned by the prompts recognizer function. | ||
@@ -154,2 +157,3 @@ */ | ||
* Creates a new Prompt instance. | ||
* | ||
* @param dialogId Unique ID of the prompt within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -161,2 +165,3 @@ * @param validator (Optional) custom validator used to provide additional validation and re-prompting logic for the prompt. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -174,2 +179,3 @@ * turn of the conversation. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -186,2 +192,3 @@ * @returns A `Promise` representing the asynchronous operation. | ||
* Called before an event is bubbled to its parent. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -199,5 +206,6 @@ * @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The DialogContext for the current turn of the conversation. | ||
* @param reason An enum indicating why the dialog resumed. | ||
* @param result Optional, value returned from the previous dialog on the stack. | ||
* @param _reason An enum indicating why the dialog resumed. | ||
* @param _result Optional, value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
@@ -209,5 +217,6 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -222,2 +231,3 @@ * turn of conversation with the user. | ||
* Called anytime the derived class should send the user a prompt. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -242,2 +252,3 @@ * @param state Additional state being persisted for the prompt. | ||
* Helper function to compose an output activity containing a set of choices. | ||
* | ||
* @param prompt The prompt to append the users choices to. | ||
@@ -248,2 +259,3 @@ * @param channelId ID of the channel the prompt is being sent to. | ||
* @param options (Optional) options to configure the underlying ChoiceFactory call. | ||
* @returns The composed activity ready to send to the user. | ||
*/ | ||
@@ -250,0 +262,0 @@ protected appendChoices(prompt: string | Partial<Activity>, channelId: string, choices: (string | Choice)[], style: ListStyle, options?: ChoiceFactoryOptions): Partial<Activity>; |
@@ -56,2 +56,3 @@ "use strict"; | ||
* Base class for all prompts. | ||
* | ||
* @param T Type of value being returned by the prompts recognizer function. | ||
@@ -62,2 +63,3 @@ */ | ||
* Creates a new Prompt instance. | ||
* | ||
* @param dialogId Unique ID of the prompt within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -72,2 +74,3 @@ * @param validator (Optional) custom validator used to provide additional validation and re-prompting logic for the prompt. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -103,2 +106,3 @@ * turn of the conversation. | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -161,2 +165,3 @@ * @returns A `Promise` representing the asynchronous operation. | ||
* Called before an event is bubbled to its parent. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -184,5 +189,6 @@ * @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The DialogContext for the current turn of the conversation. | ||
* @param reason An enum indicating why the dialog resumed. | ||
* @param result Optional, value returned from the previous dialog on the stack. | ||
* @param _reason An enum indicating why the dialog resumed. | ||
* @param _result Optional, value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
@@ -194,3 +200,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc, reason, result) { | ||
resumeDialog(dc, _reason, _result) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -208,2 +214,3 @@ // Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -223,2 +230,3 @@ * turn of conversation with the user. | ||
* Helper function to compose an output activity containing a set of choices. | ||
* | ||
* @param prompt The prompt to append the users choices to. | ||
@@ -229,2 +237,3 @@ * @param channelId ID of the channel the prompt is being sent to. | ||
* @param options (Optional) options to configure the underlying ChoiceFactory call. | ||
* @returns The composed activity ready to send to the user. | ||
*/ | ||
@@ -231,0 +240,0 @@ appendChoices(prompt, channelId, choices, style, options) { |
export interface PromptCultureModel { | ||
/** | ||
* Culture Model's Locale. | ||
* | ||
* @example | ||
@@ -10,2 +11,3 @@ * "en-US" | ||
* Culture Model's InlineSeparator. | ||
* | ||
* @example | ||
@@ -17,2 +19,3 @@ * ", " | ||
* Culture Model's InlineOr. | ||
* | ||
* @example | ||
@@ -24,2 +27,3 @@ * " or " | ||
* Culture Model's InlineOrMore. | ||
* | ||
* @example | ||
@@ -31,2 +35,3 @@ * ", or " | ||
* Equivalent of "Yes" in Culture Model's Language. | ||
* | ||
* @example | ||
@@ -38,2 +43,3 @@ * "Yes" | ||
* Equivalent of "No" in Culture Model's Language. | ||
* | ||
* @example | ||
@@ -63,2 +69,3 @@ * "No" | ||
* Use Recognizers-Text to normalize various potential Locale strings to a standard. | ||
* | ||
* @remarks This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39 | ||
@@ -65,0 +72,0 @@ * This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts. |
@@ -17,2 +17,3 @@ "use strict"; | ||
* Use Recognizers-Text to normalize various potential Locale strings to a standard. | ||
* | ||
* @remarks This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39 | ||
@@ -19,0 +20,0 @@ * This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts. |
@@ -21,2 +21,3 @@ /** | ||
* Creates a new TextPrompt instance. | ||
* | ||
* @param dialogId (Optional) unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -28,2 +29,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -41,15 +43,17 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
protected onRecognize(context: TurnContext, state: any, options: PromptOptions): Promise<PromptRecognizerResult<string>>; | ||
protected onRecognize(context: TurnContext, _state: any, _options: PromptOptions): Promise<PromptRecognizerResult<string>>; | ||
/** | ||
* Called before an event is bubbled to its parent. | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* turn of conversation. | ||
* @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @param _event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
@@ -61,4 +65,4 @@ * @remarks | ||
*/ | ||
protected onPreBubbleEvent(dc: DialogContext, event: DialogEvent): Promise<boolean>; | ||
protected onPreBubbleEvent(_dc: DialogContext, _event: DialogEvent): Promise<boolean>; | ||
} | ||
//# sourceMappingURL=textPrompt.d.ts.map |
@@ -31,2 +31,3 @@ "use strict"; | ||
* Creates a new TextPrompt instance. | ||
* | ||
* @param dialogId (Optional) unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -40,2 +41,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -62,10 +64,11 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
onRecognize(context, state, options) { | ||
onRecognize(context, _state, _options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -78,5 +81,6 @@ const value = context.activity.text; | ||
* Called before an event is bubbled to its parent. | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* turn of conversation. | ||
* @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @param _event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
@@ -88,3 +92,3 @@ * @remarks | ||
*/ | ||
onPreBubbleEvent(dc, event) { | ||
onPreBubbleEvent(_dc, _event) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -91,0 +95,0 @@ return false; |
@@ -31,9 +31,8 @@ /** | ||
* | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {Partial<Activity>} activity Activity. | ||
* @param {Record<string, string>} telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
* @returns {Promise<RecognizerResult>} Recognized result. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @param {Partial<Activity>} _activity Activity. | ||
* @param {Record<string, string>} _telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} _telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
*/ | ||
recognize(dialogContext: DialogContext, activity: Partial<Activity>, telemetryProperties?: Record<string, string>, telemetryMetrics?: Record<string, number>): Promise<RecognizerResult>; | ||
recognize(_dialogContext: DialogContext, _activity: Partial<Activity>, _telemetryProperties?: Record<string, string>, _telemetryMetrics?: Record<string, number>): Promise<RecognizerResult>; | ||
/** | ||
@@ -51,6 +50,6 @@ * Creates choose intent result in the case that there are conflicting or ambiguous signals from the recognizers. | ||
* @param {Record<string, string>} telemetryProperties A list of properties to append or override the properties created using the RecognizerResult. | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @returns {Record<string, string>} A collection of properties that can be included when calling the TrackEvent method on the TelemetryClient. | ||
*/ | ||
protected fillRecognizerResultTelemetryProperties(recognizerResult: RecognizerResult, telemetryProperties: Record<string, string>, dialogContext?: DialogContext): Record<string, string>; | ||
protected fillRecognizerResultTelemetryProperties(recognizerResult: RecognizerResult, telemetryProperties: Record<string, string>, _dialogContext?: DialogContext): Record<string, string>; | ||
protected stringifyAdditionalPropertiesOfRecognizerResult(recognizerResult: RecognizerResult): string; | ||
@@ -57,0 +56,0 @@ /** |
@@ -12,5 +12,5 @@ "use strict"; | ||
const botbuilder_core_1 = require("botbuilder-core"); | ||
const lodash_1 = require("lodash"); | ||
const configurable_1 = require("./configurable"); | ||
const dialogTurnStateConstants_1 = require("./dialogTurnStateConstants"); | ||
const omit = require("lodash/omit"); | ||
/** | ||
@@ -31,9 +31,8 @@ * Recognizer base class. | ||
* | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {Partial<Activity>} activity Activity. | ||
* @param {Record<string, string>} telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
* @returns {Promise<RecognizerResult>} Recognized result. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @param {Partial<Activity>} _activity Activity. | ||
* @param {Record<string, string>} _telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} _telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
*/ | ||
recognize(dialogContext, activity, telemetryProperties, telemetryMetrics) { | ||
recognize(_dialogContext, _activity, _telemetryProperties, _telemetryMetrics) { | ||
throw new Error('Please implement recognize function.'); | ||
@@ -49,4 +48,6 @@ } | ||
let text; | ||
let sentiment = null; | ||
const candidates = Object.entries(recognizerResults).reduce((candidates, [key, result]) => { | ||
text = result.text; | ||
sentiment = result.sentiment; | ||
const { intent, score } = botbuilder_core_1.getTopScoringIntent(result); | ||
@@ -78,2 +79,3 @@ if (intent !== 'None') { | ||
entities: {}, | ||
sentiment: sentiment, | ||
}; | ||
@@ -87,6 +89,6 @@ return recognizerResult; | ||
* @param {Record<string, string>} telemetryProperties A list of properties to append or override the properties created using the RecognizerResult. | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @returns {Record<string, string>} A collection of properties that can be included when calling the TrackEvent method on the TelemetryClient. | ||
*/ | ||
fillRecognizerResultTelemetryProperties(recognizerResult, telemetryProperties, dialogContext) { | ||
fillRecognizerResultTelemetryProperties(recognizerResult, telemetryProperties, _dialogContext) { | ||
const { intent, score } = botbuilder_core_1.getTopScoringIntent(recognizerResult); | ||
@@ -101,3 +103,3 @@ const intents = Object.entries(recognizerResult.intents); | ||
Entities: recognizerResult.entities ? JSON.stringify(recognizerResult.entities) : undefined, | ||
AdditionalProperties: JSON.stringify(lodash_1.omit(recognizerResult, ['text', 'alteredText', 'intents', 'entities'])), | ||
AdditionalProperties: JSON.stringify(omit(recognizerResult, ['text', 'alteredText', 'intents', 'entities'])), | ||
}; | ||
@@ -104,0 +106,0 @@ // Additional Properties can override "stock" properties. |
@@ -15,2 +15,3 @@ /** | ||
* A specialized Dialog that can wrap remote calls to a skill. | ||
* | ||
* @remarks | ||
@@ -31,4 +32,4 @@ * The options parameter in beginDialog must be a BeginSkillDialogOptions instance | ||
* | ||
* @param dialogOptions | ||
* @param dialogId | ||
* @param dialogOptions The options to execute the skill dialog. | ||
* @param dialogId The id of the dialog. | ||
*/ | ||
@@ -38,2 +39,3 @@ constructor(dialogOptions: SkillDialogOptions, dialogId?: string); | ||
* Called when the skill dialog is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -49,2 +51,3 @@ * @param options Initial information to pass to the dialog. | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -60,2 +63,3 @@ * @returns A Promise representing the asynchronous operation. | ||
* Called when the skill dialog is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -69,2 +73,3 @@ * @param instance State information associated with the instance of this dialog on the dialog stack. | ||
* Called when the skill dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -77,9 +82,10 @@ * @param instance State information for this dialog. | ||
* Called when a child skill dialog completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
* @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* @param _reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>; | ||
resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>; | ||
/** | ||
@@ -92,5 +98,6 @@ * @protected | ||
* If this method returns false, the dialog will end the turn without processing the activity. | ||
* @param activity The Activity for the current turn of conversation. | ||
* @param _activity The Activity for the current turn of conversation. | ||
* @returns True if the activity is valid, false if not. | ||
*/ | ||
protected onValidateActivity(activity: Activity): boolean; | ||
protected onValidateActivity(_activity: Activity): boolean; | ||
/** | ||
@@ -97,0 +104,0 @@ * @private |
@@ -26,2 +26,3 @@ "use strict"; | ||
* A specialized Dialog that can wrap remote calls to a skill. | ||
* | ||
* @remarks | ||
@@ -39,4 +40,4 @@ * The options parameter in beginDialog must be a BeginSkillDialogOptions instance | ||
* | ||
* @param dialogOptions | ||
* @param dialogId | ||
* @param dialogOptions The options to execute the skill dialog. | ||
* @param dialogId The id of the dialog. | ||
*/ | ||
@@ -55,2 +56,3 @@ constructor(dialogOptions, dialogId) { | ||
* Called when the skill dialog is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -85,2 +87,3 @@ * @param options Initial information to pass to the dialog. | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -123,2 +126,3 @@ * @returns A Promise representing the asynchronous operation. | ||
* Called when the skill dialog is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -149,2 +153,3 @@ * @param instance State information associated with the instance of this dialog on the dialog stack. | ||
* Called when the skill dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -168,9 +173,10 @@ * @param instance State information for this dialog. | ||
* Called when a child skill dialog completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
* @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* @param _reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
resumeDialog(dc, reason, result) { | ||
resumeDialog(dc, _reason, _result) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -188,5 +194,6 @@ yield this.repromptDialog(dc.context, dc.activeDialog); | ||
* If this method returns false, the dialog will end the turn without processing the activity. | ||
* @param activity The Activity for the current turn of conversation. | ||
* @param _activity The Activity for the current turn of conversation. | ||
* @returns True if the activity is valid, false if not. | ||
*/ | ||
onValidateActivity(activity) { | ||
onValidateActivity(_activity) { | ||
return true; | ||
@@ -210,3 +217,3 @@ } | ||
if (!options.activity) { | ||
throw new TypeError(`"activity" is undefined or null in options.`); | ||
throw new TypeError('"activity" is undefined or null in options.'); | ||
} | ||
@@ -296,3 +303,3 @@ return options; | ||
} | ||
catch (err) { | ||
catch (_a) { | ||
// Failures in token exchange are not fatal. They simply mean that the user needs to be shown the skill's OAuthCard. | ||
@@ -299,0 +306,0 @@ return false; |
@@ -15,2 +15,3 @@ /** | ||
* Given the turn context bind to the data to create the object | ||
* | ||
* @param dialogContext DialogContext. | ||
@@ -17,0 +18,0 @@ * @param data Data to bind to. |
@@ -12,2 +12,3 @@ import { TurnContext } from 'botbuilder-core'; | ||
* ``` | ||
* | ||
* @param O (Optional) type of dialog options passed into the step. | ||
@@ -76,2 +77,3 @@ * @param WaterfallStep.step Contextual information for the current step being executed. | ||
* Gets the dialog version, composed of the ID and number of steps. | ||
* | ||
* @returns Dialog version, composed of the ID and number of steps. | ||
@@ -117,2 +119,3 @@ */ | ||
* @param step Asynchronous step function to call. | ||
* @returns Waterfall dialog for fluent calls to `addStep()`. | ||
*/ | ||
@@ -122,2 +125,3 @@ addStep(step: WaterfallStep<O>): this; | ||
* Called when the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -134,2 +138,3 @@ * @param options Optional, initial information to pass to the [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -145,2 +150,3 @@ * @returns A Promise representing the asynchronous operation. | ||
* Called when a child [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
@@ -168,2 +174,3 @@ * @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param step Context object for the waterfall step to execute. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -173,2 +180,3 @@ protected onStep(step: WaterfallStepContext<O>): Promise<DialogTurnResult>; | ||
* Executes a step of the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -191,2 +199,3 @@ * @param index The index of the current waterfall step to execute. | ||
* Identifies the step name by its position index. | ||
* | ||
* @param index Step position | ||
@@ -193,0 +202,0 @@ * @returns A string that identifies the step name. |
@@ -89,2 +89,3 @@ "use strict"; | ||
* Gets the dialog version, composed of the ID and number of steps. | ||
* | ||
* @returns Dialog version, composed of the ID and number of steps. | ||
@@ -134,2 +135,3 @@ */ | ||
* @param step Asynchronous step function to call. | ||
* @returns Waterfall dialog for fluent calls to `addStep()`. | ||
*/ | ||
@@ -142,2 +144,3 @@ addStep(step) { | ||
* Called when the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -173,2 +176,3 @@ * @param options Optional, initial information to pass to the [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -193,2 +197,3 @@ * @returns A Promise representing the asynchronous operation. | ||
* Called when a child [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
@@ -222,2 +227,3 @@ * @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param step Context object for the waterfall step to execute. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -240,2 +246,3 @@ onStep(step) { | ||
* Executes a step of the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -314,2 +321,3 @@ * @param index The index of the current waterfall step to execute. | ||
* Identifies the step name by its position index. | ||
* | ||
* @param index Step position | ||
@@ -316,0 +324,0 @@ * @returns A string that identifies the step name. |
@@ -37,2 +37,3 @@ /** | ||
* Called to skip to the next waterfall step. | ||
* | ||
* @param result (Optional) result to pass to the next step. | ||
@@ -44,2 +45,3 @@ */ | ||
* Context object passed in to a `WaterfallStep`. | ||
* | ||
* @param O (Optional) type of options passed to the steps waterfall dialog in the call to `DialogContext.beginDialog()`. | ||
@@ -51,2 +53,3 @@ */ | ||
* Creates a new WaterfallStepContext instance. | ||
* | ||
* @param dc The dialog context for the current turn of conversation. | ||
@@ -58,2 +61,4 @@ * @param info Values to initialize the step context with. | ||
* The index of the current waterfall step being executed. | ||
* | ||
* @returns The index of the current waterfall step being executed. | ||
*/ | ||
@@ -64,2 +69,4 @@ get index(): number; | ||
* `DialogContext.beginDialog()`. | ||
* | ||
* @returns Any options the waterfall dialog was called with. | ||
*/ | ||
@@ -69,2 +76,4 @@ get options(): O; | ||
* The reason the waterfall step is being executed. | ||
* | ||
* @returns The reason the waterfall step is being executed. | ||
*/ | ||
@@ -74,2 +83,4 @@ get reason(): DialogReason; | ||
* Results returned by a dialog or prompt that was called in the previous waterfall step. | ||
* | ||
* @returns The result from the previous waterfall step. | ||
*/ | ||
@@ -79,2 +90,4 @@ get result(): any; | ||
* A dictionary of values which will be persisted across all waterfall steps. | ||
* | ||
* @returns A dictionary of values which will be persisted across all waterfall steps. | ||
*/ | ||
@@ -91,2 +104,3 @@ get values(): object; | ||
* @param result (Optional) result to pass to the next step. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -93,0 +107,0 @@ next(result?: any): Promise<DialogTurnResult>; |
@@ -16,2 +16,3 @@ "use strict"; | ||
* Context object passed in to a `WaterfallStep`. | ||
* | ||
* @param O (Optional) type of options passed to the steps waterfall dialog in the call to `DialogContext.beginDialog()`. | ||
@@ -22,2 +23,3 @@ */ | ||
* Creates a new WaterfallStepContext instance. | ||
* | ||
* @param dc The dialog context for the current turn of conversation. | ||
@@ -33,2 +35,4 @@ * @param info Values to initialize the step context with. | ||
* The index of the current waterfall step being executed. | ||
* | ||
* @returns The index of the current waterfall step being executed. | ||
*/ | ||
@@ -41,2 +45,4 @@ get index() { | ||
* `DialogContext.beginDialog()`. | ||
* | ||
* @returns Any options the waterfall dialog was called with. | ||
*/ | ||
@@ -48,2 +54,4 @@ get options() { | ||
* The reason the waterfall step is being executed. | ||
* | ||
* @returns The reason the waterfall step is being executed. | ||
*/ | ||
@@ -55,2 +63,4 @@ get reason() { | ||
* Results returned by a dialog or prompt that was called in the previous waterfall step. | ||
* | ||
* @returns The result from the previous waterfall step. | ||
*/ | ||
@@ -62,2 +72,4 @@ get result() { | ||
* A dictionary of values which will be persisted across all waterfall steps. | ||
* | ||
* @returns A dictionary of values which will be persisted across all waterfall steps. | ||
*/ | ||
@@ -76,2 +88,3 @@ get values() { | ||
* @param result (Optional) result to pass to the next step. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -78,0 +91,0 @@ next(result) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A dialog stack based conversation manager for Microsoft BotBuilder.", | ||
"version": "4.16.0", | ||
"version": "4.17.0-blobs1", | ||
"license": "MIT", | ||
@@ -35,7 +35,8 @@ "keywords": [ | ||
"@microsoft/recognizers-text-suite": "1.1.4", | ||
"botbuilder-core": "4.16.0", | ||
"botbuilder-dialogs-adaptive-runtime-core": "4.16.0-preview", | ||
"botframework-connector": "4.16.0", | ||
"botbuilder-core": "4.17.0-blobs1", | ||
"botbuilder-dialogs-adaptive-runtime-core": "4.17.0-blobs1.preview", | ||
"botframework-connector": "4.17.0-blobs1", | ||
"globalize": "^1.4.2", | ||
"lodash": "^4.17.21", | ||
"uuid": "^8.3.2", | ||
"zod": "~1.11.17" | ||
@@ -42,0 +43,0 @@ }, |
@@ -77,5 +77,5 @@ /** | ||
* @private | ||
* @param channelId id of a channel | ||
* @param _channelId id of a channel | ||
*/ | ||
export function maxActionTitleLength(channelId: string): number { | ||
export function maxActionTitleLength(_channelId: string): number { | ||
return 20; | ||
@@ -82,0 +82,0 @@ } |
@@ -92,4 +92,5 @@ /** | ||
* @param options (Optional) formatting options to use when rendering as a list. | ||
* @returns The created message activity. | ||
*/ | ||
public static forChannel( | ||
static forChannel( | ||
channelOrContext: string | TurnContext, | ||
@@ -138,6 +139,5 @@ choices: (string | Choice)[], | ||
/** | ||
* Creates a message [Activity](xref:botframework-schema.Activity) that includes a [Choice](xref:botbuilder-dialogs.Choice) list that have been added as `HeroCard`'s. | ||
* | ||
* | ||
* @param choices Optional. The [Choice](xref:botbuilder-dialogs.Choice) list to add. | ||
@@ -148,3 +148,3 @@ * @param text Optional. Text of the message. | ||
*/ | ||
public static heroCard(choices: (string | Choice)[] = [], text = '', speak = ''): Activity { | ||
static heroCard(choices: (string | Choice)[] = [], text = '', speak = ''): Activity { | ||
const buttons: CardAction[] = ChoiceFactory.toChoices(choices).map( | ||
@@ -178,4 +178,5 @@ (choice) => | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
public static inline( | ||
static inline( | ||
choices: (string | Choice)[], | ||
@@ -229,4 +230,5 @@ text?: string, | ||
* @param options (Optional) formatting options to tweak rendering of list. | ||
* @returns The created message activity. | ||
*/ | ||
public static list( | ||
static list( | ||
choices: (string | Choice)[], | ||
@@ -271,4 +273,5 @@ text?: string, | ||
* @param speak (Optional) SSML to speak for the message. | ||
* @returns An activity with choices as suggested actions. | ||
*/ | ||
public static suggestedAction(choices: (string | Choice)[], text?: string, speak?: string): Partial<Activity> { | ||
static suggestedAction(choices: (string | Choice)[], text?: string, speak?: string): Partial<Activity> { | ||
// Map choices to actions | ||
@@ -300,4 +303,5 @@ const actions: CardAction[] = ChoiceFactory.toChoices(choices).map<CardAction>((choice: Choice) => { | ||
* @param choices List of choices to add. | ||
* @returns A list of choices. | ||
*/ | ||
public static toChoices(choices: (string | Choice)[] | undefined): Choice[] { | ||
static toChoices(choices: (string | Choice)[] | undefined): Choice[] { | ||
return (choices || []) | ||
@@ -304,0 +308,0 @@ .map((choice: Choice) => (typeof choice === 'string' ? { value: choice } : choice)) |
@@ -133,2 +133,3 @@ /** | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
@@ -135,0 +136,0 @@ export function findChoices( |
@@ -81,5 +81,7 @@ /** | ||
* the fuzzy search algorithm that drives choice recognition. | ||
* | ||
* @param utterance The text or user utterance to search over. | ||
* @param values List of values to search over. | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found values. | ||
*/ | ||
@@ -237,3 +239,3 @@ // tslint:disable-next-line:max-func-body-length | ||
// Apply filters | ||
let add = !foundIndexes.hasOwnProperty(match.resolution.index); | ||
let add = !Object.prototype.hasOwnProperty.call(foundIndexes, match.resolution.index); | ||
for (let i: number = match.start; i <= match.end; i++) { | ||
@@ -240,0 +242,0 @@ if (usedTokens[i]) { |
@@ -43,2 +43,3 @@ /** | ||
* @param options (Optional) options used to tweak the search that's performed. | ||
* @returns A list of found choices, sorted by most relevant first. | ||
*/ | ||
@@ -67,3 +68,3 @@ export function recognizeChoices( | ||
} | ||
} catch (e) { | ||
} catch { | ||
// noop | ||
@@ -70,0 +71,0 @@ // TODO: Should this log an error or do something? |
@@ -52,2 +52,5 @@ /** | ||
* | ||
* @param text The input text. | ||
* @param _locale Optional, identifies the locale of the input text. | ||
* @returns A list of tokens. | ||
* @remarks | ||
@@ -62,7 +65,7 @@ * The only normalization done is to lowercase the tokens. Developers can wrap this tokenizer with | ||
* function customTokenizer(text, locale) { | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* const tokens = defaultTokenizer(text, locale); | ||
* tokens.forEach((t) => { | ||
* t.normalized = stemmer(t.normalized); | ||
* }); | ||
* return tokens; | ||
* } | ||
@@ -75,3 +78,3 @@ * | ||
*/ | ||
export function defaultTokenizer(text: string, locale?: string): Token[] { | ||
export function defaultTokenizer(text: string, _locale?: string): Token[] { | ||
const tokens: Token[] = []; | ||
@@ -78,0 +81,0 @@ let token: Token | undefined; |
@@ -10,3 +10,3 @@ /** | ||
import { Dialog, DialogInstance, DialogReason, DialogTurnResult, DialogTurnStatus } from './dialog'; | ||
import { DialogContext, DialogState } from './dialogContext'; | ||
import { DialogContext } from './dialogContext'; | ||
import { DialogContainer } from './dialogContainer'; | ||
@@ -87,2 +87,3 @@ | ||
* Override this method in a derived class to implement interrupt logic. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -92,6 +93,6 @@ * @param options Optional, initial information to pass to the dialog. | ||
* @remarks | ||
* If the task is successful, the result indicates whether the dialog is still | ||
* If the task is successful, the result indicates whether the dialog is still | ||
* active after the turn has been processed by the dialog. | ||
*/ | ||
public async beginDialog(outerDC: DialogContext, options?: O): Promise<DialogTurnResult> { | ||
async beginDialog(outerDC: DialogContext, options?: O): Promise<DialogTurnResult> { | ||
await this.checkForVersionChange(outerDC); | ||
@@ -126,2 +127,3 @@ | ||
* If this method is *not* overridden, the dialog automatically ends when the user replies. | ||
* | ||
* @param outerDC The parent [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -134,3 +136,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
public async continueDialog(outerDC: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(outerDC: DialogContext): Promise<DialogTurnResult> { | ||
await this.checkForVersionChange(outerDC); | ||
@@ -155,5 +157,6 @@ | ||
* control to this dialog component. | ||
* @param outerDc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param reason Reason why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* | ||
* @param outerDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param _reason Reason why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
@@ -171,3 +174,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
public async resumeDialog(outerDC: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
async resumeDialog(outerDC: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult> { | ||
await this.checkForVersionChange(outerDC); | ||
@@ -187,2 +190,3 @@ | ||
* Called when the dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -192,3 +196,3 @@ * @param instance State information for this dialog. | ||
*/ | ||
public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
// Forward to inner dialogs | ||
@@ -204,2 +208,3 @@ const innerDC: DialogContext = this.createInnerDC(context, instance); | ||
* Called when the [Dialog](xref:botbuilder-dialogs.Dialog) is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -213,3 +218,3 @@ * @param instance State information associated with the instance of this component | ||
*/ | ||
public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
// Forward cancel to inner dialogs | ||
@@ -227,7 +232,9 @@ if (reason === DialogReason.cancelCalled) { | ||
* Adds a child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to the components internal [DialogSet](xref:botbuilder-dialogs.DialogSet). | ||
* | ||
* @param dialog The child [Dialog](xref:botbuilder-dialogs.Dialog) or prompt to add. | ||
* @returns The [ComponentDialog](xref:botbuilder-dialogs.ComponentDialog) after the operation is complete. | ||
* @remarks | ||
* The [Dialog.id](xref:botbuilder-dialogs.Dialog.id) of the first child added to the component will be assigned to the initialDialogId property. | ||
*/ | ||
public addDialog(dialog: Dialog): this { | ||
addDialog(dialog: Dialog): this { | ||
this.dialogs.add(dialog); | ||
@@ -243,5 +250,7 @@ if (this.initialDialogId === undefined) { | ||
* Creates the inner dialog context | ||
* | ||
* @param outerDC the outer dialog context | ||
* @returns The created Dialog Context. | ||
*/ | ||
public createChildContext(outerDC: DialogContext): DialogContext { | ||
createChildContext(outerDC: DialogContext): DialogContext { | ||
return this.createInnerDC(outerDC, outerDC.activeDialog); | ||
@@ -259,2 +268,3 @@ } | ||
* @param options (Optional) options that were passed to the component by its parent. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -272,2 +282,3 @@ protected onBeginDialog(innerDC: DialogContext, options?: O): Promise<DialogTurnResult> { | ||
* @param innerDC Dialog context for the components internal `DialogSet`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -284,7 +295,8 @@ protected onContinueDialog(innerDC: DialogContext): Promise<DialogTurnResult> { | ||
* will be cancelled before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The components instance data within its parents dialog stack. | ||
* @param reason The reason the component is ending. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The components instance data within its parents dialog stack. | ||
* @param _reason The reason the component is ending. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
protected onEndDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
protected onEndDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void> { | ||
return Promise.resolve(); | ||
@@ -298,6 +310,7 @@ } | ||
* The active child dialog will have already been asked to reprompt before this method is called. | ||
* @param context Context for the current turn of conversation. | ||
* @param instance The instance of the current dialog. | ||
* @param _context Context for the current turn of conversation. | ||
* @param _instance The instance of the current dialog. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
protected onRepromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
protected onRepromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void> { | ||
return Promise.resolve(); | ||
@@ -315,2 +328,3 @@ } | ||
* @param result Result returned by the last active child dialog. Can be a value of `undefined`. | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
@@ -317,0 +331,0 @@ protected endComponent(outerDC: DialogContext, result: any): Promise<DialogTurnResult> { |
@@ -17,5 +17,7 @@ /** | ||
* Fluent method for configuring the object. | ||
* | ||
* @param config Configuration settings to apply. | ||
* @returns The [Configurable](xref:botbuilder-dialogs.Configurable) after the operation is complete. | ||
*/ | ||
public configure(config: Record<string, unknown>): this { | ||
configure(config: Record<string, unknown>): this { | ||
for (const key in config) { | ||
@@ -50,5 +52,9 @@ if (Object.prototype.hasOwnProperty.call(config, key)) { | ||
public getConverter(_property: string): Converter | ConverterFactory { | ||
/** | ||
* @param _property The key of the conditional selector configuration. | ||
* @returns The converter for the selector configuration. | ||
*/ | ||
getConverter(_property: string): Converter | ConverterFactory { | ||
return undefined; | ||
} | ||
} |
@@ -12,3 +12,3 @@ /** | ||
* | ||
* @typeparam T Optional. The type that represents state information for the dialog. | ||
* @template T Optional. The type that represents state information for the dialog. | ||
* | ||
@@ -180,3 +180,3 @@ * @remarks | ||
* | ||
* @typeparam T Optional. The type that represents a result returned by the active dialog when it | ||
* @template T Optional. The type that represents a result returned by the active dialog when it | ||
* successfully completes. | ||
@@ -242,3 +242,3 @@ * | ||
*/ | ||
public static EndOfTurn: DialogTurnResult = { status: DialogTurnStatus.waiting }; | ||
static EndOfTurn: DialogTurnResult = { status: DialogTurnStatus.waiting }; | ||
@@ -256,3 +256,3 @@ /** | ||
*/ | ||
public constructor(dialogId?: string) { | ||
constructor(dialogId?: string) { | ||
super(); | ||
@@ -267,4 +267,5 @@ this.id = dialogId; | ||
* This will be automatically generated if not specified. | ||
* @returns The Id for the dialog. | ||
*/ | ||
public get id(): string { | ||
get id(): string { | ||
if (this._id === undefined) { | ||
@@ -279,3 +280,3 @@ this._id = this.onComputeId(); | ||
*/ | ||
public set id(value: string) { | ||
set id(value: string) { | ||
this._id = value; | ||
@@ -286,4 +287,6 @@ } | ||
* Gets the telemetry client for this dialog. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
public get telemetryClient(): BotTelemetryClient { | ||
get telemetryClient(): BotTelemetryClient { | ||
return this._telemetryClient; | ||
@@ -295,3 +298,3 @@ } | ||
*/ | ||
public set telemetryClient(client: BotTelemetryClient) { | ||
set telemetryClient(client: BotTelemetryClient) { | ||
this._telemetryClient = client ? client : new NullTelemetryClient(); | ||
@@ -310,4 +313,5 @@ } | ||
* Returning an empty string will disable version tracking for the component all together. | ||
* @returns Unique string which should only change when dialog has changed in a way that should restart the dialog. | ||
*/ | ||
public getVersion(): string { | ||
getVersion(): string { | ||
return this.id; | ||
@@ -336,3 +340,3 @@ } | ||
*/ | ||
public abstract beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult>; | ||
abstract beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult>; | ||
@@ -356,4 +360,5 @@ /** | ||
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
// By default just end the current dialog. | ||
@@ -387,4 +392,5 @@ return dc.endDialog(); | ||
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) | ||
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result. | ||
*/ | ||
public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
// By default just end the current dialog and return result to parent. | ||
@@ -397,4 +403,4 @@ return dc.endDialog(result); | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* | ||
@@ -412,3 +418,3 @@ * @remarks | ||
*/ | ||
public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
async repromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void> { | ||
// No-op by default | ||
@@ -420,5 +426,5 @@ } | ||
* | ||
* @param context The context object for the turn. | ||
* @param instance Current state information for this dialog. | ||
* @param reason The reason the dialog is ending. | ||
* @param _context The context object for the turn. | ||
* @param _instance Current state information for this dialog. | ||
* @param _reason The reason the dialog is ending. | ||
* | ||
@@ -437,3 +443,3 @@ * @remarks | ||
*/ | ||
public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
async endDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void> { | ||
// No-op by default | ||
@@ -449,3 +455,3 @@ } | ||
*/ | ||
public async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean> { | ||
async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean> { | ||
// Before bubble | ||
@@ -474,7 +480,7 @@ let handled = await this.onPreBubbleEvent(dc, e); | ||
* dialogs from performing their default processing. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
protected async onPreBubbleEvent(dc: DialogContext, e: DialogEvent): Promise<boolean> { | ||
protected async onPreBubbleEvent(_dc: DialogContext, _e: DialogEvent): Promise<boolean> { | ||
return false; | ||
@@ -489,7 +495,7 @@ } | ||
* prevent any processing of the event by child dialogs. | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param e The event being raised. | ||
* @param _dc The dialog context for the current turn of conversation. | ||
* @param _e The event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
*/ | ||
protected async onPostBubbleEvent(dc: DialogContext, e: DialogEvent): Promise<boolean> { | ||
protected async onPostBubbleEvent(_dc: DialogContext, _e: DialogEvent): Promise<boolean> { | ||
return false; | ||
@@ -506,4 +512,4 @@ } | ||
protected onComputeId(): string { | ||
throw new Error(`Dialog.onComputeId(): not implemented.`); | ||
throw new Error('Dialog.onComputeId(): not implemented.'); | ||
} | ||
} |
@@ -21,16 +21,19 @@ /** | ||
*/ | ||
public readonly dialogs = new DialogSet(undefined); | ||
readonly dialogs = new DialogSet(undefined); | ||
/** | ||
* Creates an inner dialog context for the containers active child. | ||
* | ||
* @param dc Parents dialog context. | ||
* @returns A new dialog context for the active child or `undefined` if there is no active child. | ||
*/ | ||
public abstract createChildContext(dc: DialogContext): DialogContext | undefined; | ||
abstract createChildContext(dc: DialogContext): DialogContext | undefined; | ||
/** | ||
* Finds a child dialog that was previously added to the container. | ||
* | ||
* @param dialogId ID of the dialog to lookup. | ||
* @returns The Dialog if found; otherwise null. | ||
*/ | ||
public findDialog(dialogId: string): Dialog | undefined { | ||
findDialog(dialogId: string): Dialog | undefined { | ||
return this.dialogs.find(dialogId); | ||
@@ -45,4 +48,5 @@ } | ||
* @param e The event being raised. | ||
* @returns True if the event is handled by the current dialog and bubbling should stop. | ||
*/ | ||
public async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean> { | ||
async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean> { | ||
const handled = await super.onDialogEvent(dc, e); | ||
@@ -100,3 +104,3 @@ if (!handled && e.name === DialogEvents.versionChanged) { | ||
*/ | ||
public set telemetryClient(client: BotTelemetryClient) { | ||
set telemetryClient(client: BotTelemetryClient) { | ||
this._telemetryClient = client ?? new NullTelemetryClient(); | ||
@@ -110,6 +114,8 @@ if (this.dialogs.telemetryClient !== this._telemetryClient) { | ||
* Get the current telemetry client. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
public get telemetryClient(): BotTelemetryClient { | ||
get telemetryClient(): BotTelemetryClient { | ||
return this._telemetryClient; | ||
} | ||
} |
@@ -22,2 +22,3 @@ /** | ||
* @param promise a promise to await inside a try-catch for error enrichment | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
@@ -79,2 +80,3 @@ const wrapErrors = async <T>(dialogContext: DialogContext, promise: Promise<T>): Promise<T> => { | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -86,6 +88,7 @@ * @param contextOrDC The [TurnContext](xref:botbuilder-core.TurnContext) object for the current turn of the bot. | ||
*/ | ||
public constructor(dialogs: DialogSet, contextOrDC: TurnContext, state: DialogState); | ||
constructor(dialogs: DialogSet, contextOrDC: TurnContext, state: DialogState); | ||
/** | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -97,6 +100,7 @@ * @param contextOrDC The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for the current turn of the bot. | ||
*/ | ||
public constructor(dialogs: DialogSet, contextOrDC: DialogContext, state: DialogState); | ||
constructor(dialogs: DialogSet, contextOrDC: DialogContext, state: DialogState); | ||
/** | ||
* Creates an new instance of the [DialogContext](xref:botbuilder-dialogs.DialogContext) class. | ||
* | ||
* @param dialogs The [DialogSet](xref:botbuilder-dialogs.DialogSet) for which to create the dialog context. | ||
@@ -107,3 +111,3 @@ * @param contextOrDC The [TurnContext](xref:botbuilder-core.TurnContext) or [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the bot. | ||
*/ | ||
public constructor(dialogs: DialogSet, contextOrDC: TurnContext | DialogContext, state: DialogState) { | ||
constructor(dialogs: DialogSet, contextOrDC: TurnContext | DialogContext, state: DialogState) { | ||
this.dialogs = dialogs; | ||
@@ -132,3 +136,3 @@ if (contextOrDC instanceof DialogContext) { | ||
*/ | ||
public dialogs: DialogSet; | ||
dialogs: DialogSet; | ||
@@ -138,3 +142,3 @@ /** | ||
*/ | ||
public context: TurnContext; | ||
context: TurnContext; | ||
@@ -144,3 +148,3 @@ /** | ||
*/ | ||
public stack: DialogInstance[]; | ||
stack: DialogInstance[]; | ||
@@ -155,8 +159,8 @@ /** | ||
*/ | ||
public parent: DialogContext | undefined; | ||
parent: DialogContext | undefined; | ||
/** | ||
* Returns dialog context for child if the active dialog is a container. | ||
* @returns Dialog context for child if the active dialog is a container. | ||
*/ | ||
public get child(): DialogContext | undefined { | ||
get child(): DialogContext | undefined { | ||
const instance = this.activeDialog; | ||
@@ -175,6 +179,6 @@ if (instance != undefined) { | ||
/** | ||
* Returns the state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* @returns The state information for the dialog on the top of the dialog stack, or `undefined` if | ||
* the stack is empty. | ||
*/ | ||
public get activeDialog(): DialogInstance | undefined { | ||
get activeDialog(): DialogInstance | undefined { | ||
return this.stack.length > 0 ? this.stack[this.stack.length - 1] : undefined; | ||
@@ -186,3 +190,3 @@ } | ||
*/ | ||
public state: DialogStateManager; | ||
state: DialogStateManager; | ||
@@ -192,10 +196,9 @@ /** | ||
*/ | ||
public services: TurnContextStateCollection = new TurnContextStateCollection(); | ||
services: TurnContextStateCollection = new TurnContextStateCollection(); | ||
/** | ||
* Returns the current dialog manager instance. This property is obsolete. | ||
* | ||
* @obsolete This property serves no function. | ||
* @deprecated This property serves no function. | ||
* @returns The current dialog manager instance. This property is deprecated. | ||
*/ | ||
public get dialogManager(): DialogManager { | ||
get dialogManager(): DialogManager { | ||
return this.context.turnState.get(DialogTurnStateConstants.dialogManager); | ||
@@ -206,5 +209,6 @@ } | ||
* Obtain the CultureInfo in DialogContext. | ||
* | ||
* @returns a locale string. | ||
*/ | ||
public getLocale(): string { | ||
getLocale(): string { | ||
const _turnLocaleProperty = 'turn.locale'; | ||
@@ -231,3 +235,3 @@ | ||
* @param options Optional. Arguments to pass into the dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -254,3 +258,3 @@ * If there's already an active dialog on the stack, that dialog will be paused until | ||
*/ | ||
public async beginDialog(dialogId: string, options?: object): Promise<DialogTurnResult> { | ||
async beginDialog(dialogId: string, options?: object): Promise<DialogTurnResult> { | ||
// Lookup dialog | ||
@@ -282,3 +286,3 @@ const dialog: Dialog<{}> = this.findDialog(dialogId); | ||
* @param eventValue Optional. Value to pass along with custom cancellation event. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -301,7 +305,3 @@ * This calls each dialog's [Dialog.endDialog](xref:botbuilder-dialogs.Dialog.endDialog) method before | ||
*/ | ||
public async cancelAllDialogs( | ||
cancelParents = false, | ||
eventName?: string, | ||
eventValue?: any | ||
): Promise<DialogTurnResult> { | ||
async cancelAllDialogs(cancelParents = false, eventName?: string, eventValue?: any): Promise<DialogTurnResult> { | ||
eventName = eventName || DialogEvents.cancelDialog; | ||
@@ -311,2 +311,3 @@ if (this.stack.length > 0 || this.parent != undefined) { | ||
let notify = false; | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
let dc: DialogContext = this; | ||
@@ -343,3 +344,3 @@ while (dc != undefined) { | ||
* @param dialogId ID of the dialog to search for. | ||
* | ||
* @returns The dialog for the provided ID. | ||
* @remarks | ||
@@ -353,3 +354,3 @@ * If the dialog to start is not found in the [DialogSet](xref:botbuilder-dialogs.DialogSet) associated | ||
*/ | ||
public findDialog(dialogId: string): Dialog | undefined { | ||
findDialog(dialogId: string): Dialog | undefined { | ||
let dialog = this.dialogs.find(dialogId); | ||
@@ -364,2 +365,3 @@ if (!dialog && this.parent) { | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -380,3 +382,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
*/ | ||
public async prompt( | ||
async prompt( | ||
dialogId: string, | ||
@@ -388,2 +390,3 @@ promptOrOptions: string | Partial<Activity> | PromptOptions | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -403,3 +406,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
*/ | ||
public async prompt( | ||
async prompt( | ||
dialogId: string, | ||
@@ -412,2 +415,3 @@ promptOrOptions: string | Partial<Activity> | PromptOptions, | ||
* Helper function to simplify formatting the options for calling a prompt dialog. | ||
* | ||
* @param dialogId ID of the prompt dialog to start. | ||
@@ -418,2 +422,3 @@ * @param promptOrOptions The text of the initial prompt to send the user, | ||
* for use with a [ChoicePrompt](xref:botbuilder-dialogs.ChoicePrompt). | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks This helper method formats the object to use as the `options` parameter, and then calls | ||
@@ -426,3 +431,3 @@ * beginDialog to start the specified prompt dialog. | ||
*/ | ||
public async prompt( | ||
async prompt( | ||
dialogId: string, | ||
@@ -453,2 +458,3 @@ promptOrOptions: string | Partial<Activity>, | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -472,3 +478,3 @@ * After the call completes, you can check the turn context's [responded](xref:botbuilder-core.TurnContext.responded) | ||
*/ | ||
public async continueDialog(): Promise<DialogTurnResult> { | ||
async continueDialog(): Promise<DialogTurnResult> { | ||
// if we are continuing and haven't emitted the activityReceived event, emit it | ||
@@ -509,3 +515,3 @@ // NOTE: This is backward compatible way for activity received to be fired even if you have legacy dialog loop | ||
* the bot's turn handler. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -535,3 +541,3 @@ * The _parent_ dialog is the next dialog on the dialog stack, if there is one. This method | ||
*/ | ||
public async endDialog(result?: any): Promise<DialogTurnResult> { | ||
async endDialog(result?: any): Promise<DialogTurnResult> { | ||
// End the active dialog | ||
@@ -565,3 +571,3 @@ await this.endActiveDialog(DialogReason.endCalled, result); | ||
* @param options Optional. Arguments to pass into the new dialog when it starts. | ||
* | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
* @remarks | ||
@@ -580,3 +586,3 @@ * This is particularly useful for creating a loop or redirecting to another dialog. | ||
*/ | ||
public async replaceDialog(dialogId: string, options?: object): Promise<DialogTurnResult> { | ||
async replaceDialog(dialogId: string, options?: object): Promise<DialogTurnResult> { | ||
// End the active dialog | ||
@@ -600,3 +606,3 @@ await this.endActiveDialog(DialogReason.replaceCalled); | ||
*/ | ||
public async repromptDialog(): Promise<void> { | ||
async repromptDialog(): Promise<void> { | ||
// Try raising event first | ||
@@ -625,2 +631,3 @@ const handled = await this.emitEvent(DialogEvents.repromptDialog, undefined, false, false); | ||
* Searches for a dialog with a given ID. | ||
* | ||
* @remarks | ||
@@ -634,3 +641,3 @@ * Emits a named event for the current dialog, or someone who started it, to handle. | ||
*/ | ||
public async emitEvent(name: string, value?: any, bubble = true, fromLeaf = false): Promise<boolean> { | ||
async emitEvent(name: string, value?: any, bubble = true, fromLeaf = false): Promise<boolean> { | ||
// Initialize event | ||
@@ -644,4 +651,6 @@ const dialogEvent: DialogEvent = { | ||
// Find starting dialog | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
let dc: DialogContext = this; | ||
if (fromLeaf) { | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
@@ -648,0 +657,0 @@ const childDc = dc.child; |
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
public readonly dialogContext: { | ||
readonly dialogContext: { | ||
activeDialog?: string; | ||
@@ -28,3 +28,3 @@ parent?: string; | ||
*/ | ||
public constructor(public readonly error: Error | string, dialogContext: DialogContext) { | ||
constructor(public readonly error: Error | string, dialogContext: DialogContext) { | ||
super(); | ||
@@ -31,0 +31,0 @@ |
@@ -58,3 +58,4 @@ /** | ||
const dialogSet = new DialogSet(accessor); | ||
dialogSet.telemetryClient = context.turnState.get<BotTelemetryClient>(BotTelemetryClientKey) ?? dialog.telemetryClient; | ||
dialogSet.telemetryClient = | ||
context.turnState.get<BotTelemetryClient>(BotTelemetryClientKey) ?? dialog.telemetryClient; | ||
@@ -68,2 +69,9 @@ dialogSet.add(dialog); | ||
/** | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param dialogId The dialog ID. | ||
* @param dialogContext The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
* @param dialogStateManagerConfiguration Configuration for the dialog state manager. | ||
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result. | ||
*/ | ||
export async function internalRun( | ||
@@ -179,4 +187,5 @@ context: TurnContext, | ||
* | ||
* @param context | ||
* @param turnResult | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for the turn. | ||
* @param turnResult The dialog turn result. | ||
* @returns True if should send EoC, otherwise false. | ||
*/ | ||
@@ -247,3 +256,4 @@ export function shouldSendEndOfConversationToParent(context: TurnContext, turnResult: DialogTurnResult): boolean { | ||
const claimIdentity = dialogContext.context.turnState.get<ClaimsIdentity>(adapter.BotIdentityKey); | ||
const traceLabel = claimIdentity && SkillValidation.isSkillClaim(claimIdentity.claims) ? 'Skill State' : 'Bot State'; | ||
const traceLabel = | ||
claimIdentity && SkillValidation.isSkillClaim(claimIdentity.claims) ? 'Skill State' : 'Bot State'; | ||
@@ -250,0 +260,0 @@ // Send trace of memory |
@@ -65,3 +65,3 @@ /** | ||
* | ||
* @obsolete This class will be deprecated. | ||
* @deprecated This class will be deprecated. | ||
*/ | ||
@@ -79,3 +79,3 @@ export class DialogManager extends Configurable { | ||
*/ | ||
public constructor(rootDialog?: Dialog, dialogStateProperty?: string) { | ||
constructor(rootDialog?: Dialog, dialogStateProperty?: string) { | ||
super(); | ||
@@ -92,3 +92,3 @@ if (rootDialog) { | ||
*/ | ||
public conversationState: ConversationState; | ||
conversationState: ConversationState; | ||
@@ -98,8 +98,10 @@ /** | ||
*/ | ||
public userState?: UserState; | ||
userState?: UserState; | ||
/** | ||
* Values that will be copied to the `TurnContext.turnState` at the beginning of each turn. | ||
* | ||
* @returns The turn state collection. | ||
*/ | ||
public get initialTurnState(): TurnContextStateCollection { | ||
get initialTurnState(): TurnContextStateCollection { | ||
return this._initialTurnState; | ||
@@ -111,3 +113,3 @@ } | ||
*/ | ||
public set rootDialog(value: Dialog) { | ||
set rootDialog(value: Dialog) { | ||
this.dialogs = new DialogSet(); | ||
@@ -129,3 +131,3 @@ if (value) { | ||
*/ | ||
public get rootDialog(): Dialog { | ||
get rootDialog(): Dialog { | ||
return this._rootDialogId ? this.dialogs.find(this._rootDialogId) : undefined; | ||
@@ -137,3 +139,3 @@ } | ||
*/ | ||
public dialogs: DialogSet = new DialogSet(); | ||
dialogs: DialogSet = new DialogSet(); | ||
@@ -143,3 +145,3 @@ /** | ||
*/ | ||
public stateConfiguration?: DialogStateManagerConfiguration; | ||
stateConfiguration?: DialogStateManagerConfiguration; | ||
@@ -149,3 +151,3 @@ /** | ||
*/ | ||
public expireAfter?: number; | ||
expireAfter?: number; | ||
@@ -158,3 +160,3 @@ /** | ||
*/ | ||
public configure(config: Partial<DialogManagerConfiguration>): this { | ||
configure(config: Partial<DialogManagerConfiguration>): this { | ||
return super.configure(config); | ||
@@ -169,6 +171,6 @@ } | ||
*/ | ||
public async onTurn(context: TurnContext): Promise<DialogManagerResult> { | ||
async onTurn(context: TurnContext): Promise<DialogManagerResult> { | ||
// Ensure properly configured | ||
if (!this._rootDialogId) { | ||
throw new Error(`DialogManager.onTurn: the bot's 'rootDialog' has not been configured.`); | ||
throw new Error("DialogManager.onTurn: the bot's 'rootDialog' has not been configured."); | ||
} | ||
@@ -190,3 +192,3 @@ | ||
if (!this.conversationState) { | ||
throw new Error(`DialogManager.onTurn: the bot's 'conversationState' has not been configured.`); | ||
throw new Error("DialogManager.onTurn: the bot's 'conversationState' has not been configured."); | ||
} | ||
@@ -193,0 +195,0 @@ botStateSet.add(this.conversationState); |
@@ -31,3 +31,10 @@ // Copyright (c) Microsoft Corporation. | ||
/** | ||
* Bot component for bot Dialogs. | ||
*/ | ||
export class DialogsBotComponent extends BotComponent { | ||
/** | ||
* @param services Services Collection to register. | ||
* @param configuration Configuration for the bot component. | ||
*/ | ||
configureServices(services: ServiceCollection, configuration: Configuration): void { | ||
@@ -34,0 +41,0 @@ services.composeFactory<MemoryScope[]>('memoryScopes', (memoryScopes) => { |
@@ -25,2 +25,5 @@ /** | ||
/** | ||
* Creates an instance of the [DialogsComponentRegistration](xref:botbuilder-dialogs.DialogsComponentRegistration) class. | ||
*/ | ||
constructor() { | ||
@@ -37,3 +40,3 @@ super(); | ||
*/ | ||
public getMemoryScopes(): MemoryScope[] { | ||
getMemoryScopes(): MemoryScope[] { | ||
return this.services.mustMakeInstance<MemoryScope[]>('memoryScopes'); | ||
@@ -47,5 +50,5 @@ } | ||
*/ | ||
public getPathResolvers(): PathResolver[] { | ||
getPathResolvers(): PathResolver[] { | ||
return this.services.mustMakeInstance<PathResolver[]>('pathResolvers'); | ||
} | ||
} |
@@ -91,3 +91,3 @@ /** | ||
*/ | ||
public constructor(dialogState?: StatePropertyAccessor<DialogState>) { | ||
constructor(dialogState?: StatePropertyAccessor<DialogState>) { | ||
this.dialogState = dialogState; | ||
@@ -99,6 +99,7 @@ } | ||
* | ||
* @returns A version that will change when any of the child dialogs version changes. | ||
* @remarks | ||
* This hash is persisted to state storage and used to detect changes to a dialog set. | ||
*/ | ||
public getVersion(): string { | ||
getVersion(): string { | ||
if (!this._version) { | ||
@@ -128,6 +129,7 @@ let versions = ''; | ||
* If a telemetryClient is present on the dialog set, it will be added to each dialog. | ||
* @returns The dialog set after the operation is complete. | ||
*/ | ||
public add<T extends Dialog>(dialog: T): this { | ||
add<T extends Dialog>(dialog: T): this { | ||
if (!(dialog instanceof Dialog)) { | ||
throw new Error(`DialogSet.add(): Invalid dialog being added.`); | ||
throw new Error('DialogSet.add(): Invalid dialog being added.'); | ||
} | ||
@@ -139,3 +141,3 @@ | ||
// Ensure dialogs ID is unique. | ||
if (this.dialogs.hasOwnProperty(dialog.id)) { | ||
if (Object.prototype.hasOwnProperty.call(this.dialogs, dialog.id)) { | ||
// If we are trying to add the same exact instance, it's not a name collision. | ||
@@ -150,5 +152,6 @@ // No operation required since the instance is already in the dialog set. | ||
let nextSuffix = 2; | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const suffixId = dialog.id + nextSuffix.toString(); | ||
if (!this.dialogs.hasOwnProperty(suffixId)) { | ||
if (!Object.prototype.hasOwnProperty.call(this.dialogs, suffixId)) { | ||
dialog.id = suffixId; | ||
@@ -182,8 +185,10 @@ break; | ||
* Creates a dialog context which can be used to work with the dialogs in the set. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
public async createContext(context: TurnContext): Promise<DialogContext> { | ||
async createContext(context: TurnContext): Promise<DialogContext> { | ||
if (!this.dialogState) { | ||
throw new Error( | ||
`DialogSet.createContext(): the dialog set was not bound to a stateProperty when constructed.` | ||
'DialogSet.createContext(): the dialog set was not bound to a stateProperty when constructed.' | ||
); | ||
@@ -206,5 +211,6 @@ } | ||
* @param dialogId ID of the dialog or prompt to lookup. | ||
* @returns The dialog if found; otherwise undefined. | ||
*/ | ||
public find(dialogId: string): Dialog | undefined { | ||
return this.dialogs.hasOwnProperty(dialogId) ? this.dialogs[dialogId] : undefined; | ||
find(dialogId: string): Dialog | undefined { | ||
return Object.prototype.hasOwnProperty.call(this.dialogs, dialogId) ? this.dialogs[dialogId] : undefined; | ||
} | ||
@@ -214,4 +220,6 @@ | ||
* Set the telemetry client for this dialog set and apply it to all current dialogs. | ||
* | ||
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging. | ||
*/ | ||
public get telemetryClient(): BotTelemetryClient { | ||
get telemetryClient(): BotTelemetryClient { | ||
return this._telemetryClient; | ||
@@ -224,3 +232,3 @@ } | ||
*/ | ||
public set telemetryClient(client: BotTelemetryClient) { | ||
set telemetryClient(client: BotTelemetryClient) { | ||
this._telemetryClient = client ?? new NullTelemetryClient(); | ||
@@ -235,5 +243,5 @@ Object.values(this.dialogs).forEach((dialog) => (dialog.telemetryClient = this._telemetryClient)); | ||
*/ | ||
public getDialogs(): Dialog[] { | ||
getDialogs(): Dialog[] { | ||
return Object.values(this.dialogs); | ||
} | ||
} |
@@ -14,24 +14,24 @@ /** | ||
/// Counter of emitted events. | ||
public static readonly eventCounter = 'dialog.eventCounter'; | ||
static readonly eventCounter = 'dialog.eventCounter'; | ||
/// Currently expected properties. | ||
public static readonly expectedProperties = 'dialog.expectedProperties'; | ||
static readonly expectedProperties = 'dialog.expectedProperties'; | ||
/// Default operation to use for entities where there is no identified operation entity. | ||
public static readonly defaultOperation = 'dialog.defaultOperation'; | ||
static readonly defaultOperation = 'dialog.defaultOperation'; | ||
/// Last surfaced entity ambiguity event. | ||
public static readonly lastEvent = 'dialog.lastEvent'; | ||
static readonly lastEvent = 'dialog.lastEvent'; | ||
/// Currently required properties. | ||
public static readonly requiredProperties = 'dialog.requiredProperties'; | ||
static readonly requiredProperties = 'dialog.requiredProperties'; | ||
/// Number of retries for the current Ask. | ||
public static readonly retries = 'dialog.retries'; | ||
static readonly retries = 'dialog.retries'; | ||
/// Last intent. | ||
public static readonly lastIntent = 'dialog.lastIntent'; | ||
static readonly lastIntent = 'dialog.lastIntent'; | ||
/// Last trigger event: defined in FormEvent, ask, clarifyEntity etc.. | ||
public static readonly lastTriggerEvent = 'dialog.lastTriggerEvent'; | ||
static readonly lastTriggerEvent = 'dialog.lastTriggerEvent'; | ||
} |
@@ -51,3 +51,3 @@ /** | ||
*/ | ||
public constructor(dc: DialogContext, configuration?: DialogStateManagerConfiguration) { | ||
constructor(dc: DialogContext, configuration?: DialogStateManagerConfiguration) { | ||
ComponentRegistration.add(new DialogsComponentRegistration()); | ||
@@ -96,3 +96,3 @@ | ||
*/ | ||
public configuration: DialogStateManagerConfiguration; | ||
configuration: DialogStateManagerConfiguration; | ||
@@ -104,3 +104,3 @@ /** | ||
* This always returns a CLONE of the memory, any modifications to the result will not affect memory. | ||
* @param T The value type to return. | ||
* @template T The value type to return. | ||
* @param pathExpression Path expression to use. | ||
@@ -110,3 +110,3 @@ * @param defaultValue (Optional) default value to use if the path isn't found. May be a function that returns the default value to use. | ||
*/ | ||
public getValue<T = any>(pathExpression: string, defaultValue?: T | (() => T)): T { | ||
getValue<T = any>(pathExpression: string, defaultValue?: T | (() => T)): T { | ||
function returnDefault(): T { | ||
@@ -137,6 +137,7 @@ return typeof defaultValue == 'function' ? (defaultValue as Function)() : defaultValue; | ||
* Set memory to value. | ||
* | ||
* @param pathExpression Path to memory. | ||
* @param value Value to set. | ||
*/ | ||
public setValue(pathExpression: string, value: any): void { | ||
setValue(pathExpression: string, value: any): void { | ||
// Get path segments | ||
@@ -146,3 +147,3 @@ const tpath = this.transformPath(pathExpression); | ||
if (segments.length < 1) { | ||
throw new Error(`DialogStateManager.setValue: path wasn't specified.`); | ||
throw new Error("DialogStateManager.setValue: path wasn't specified."); | ||
} | ||
@@ -205,5 +206,6 @@ | ||
* Delete property from memory | ||
* @param path The leaf property to remove. | ||
* | ||
* @param pathExpression The leaf property to remove. | ||
*/ | ||
public deleteValue(pathExpression: string): void { | ||
deleteValue(pathExpression: string): void { | ||
// Get path segments | ||
@@ -248,3 +250,3 @@ const tpath = this.transformPath(pathExpression); | ||
*/ | ||
public async loadAllScopes(): Promise<void> { | ||
async loadAllScopes(): Promise<void> { | ||
const scopes = this.configuration.memoryScopes; | ||
@@ -262,3 +264,3 @@ for (let i = 0; i < scopes.length; i++) { | ||
*/ | ||
public async saveAllChanges(): Promise<void> { | ||
async saveAllChanges(): Promise<void> { | ||
const scopes = this.configuration.memoryScopes; | ||
@@ -272,4 +274,6 @@ for (let i = 0; i < scopes.length; i++) { | ||
* Deletes all of the backing memory for a given scope. | ||
* | ||
* @param name Name of the scope. | ||
*/ | ||
public async deleteScopesMemory(name: string): Promise<void> { | ||
async deleteScopesMemory(name: string): Promise<void> { | ||
name = name.toLowerCase(); | ||
@@ -295,3 +299,3 @@ const scopes = this.configuration.memoryScopes; | ||
*/ | ||
public parsePath(pathExpression: string, allowNestedPaths = true): (string | number)[] { | ||
parsePath(pathExpression: string, allowNestedPaths = true): (string | number)[] { | ||
// Expand path segments | ||
@@ -411,6 +415,7 @@ let segment = ''; | ||
* Transform the path using the registered path transformers. | ||
* | ||
* @param pathExpression The path to transform. | ||
* @returns The transformed path. | ||
*/ | ||
public transformPath(pathExpression: string): string { | ||
transformPath(pathExpression: string): string { | ||
// Run path through registered resolvers. | ||
@@ -427,5 +432,6 @@ const resolvers = this.configuration.pathResolvers; | ||
* Gets all memory scopes suitable for logging. | ||
* | ||
* @returns Object which represents all memory scopes. | ||
*/ | ||
public getMemorySnapshot(): object { | ||
getMemorySnapshot(): object { | ||
const output = {}; | ||
@@ -443,6 +449,7 @@ this.configuration.memoryScopes.forEach((scope) => { | ||
* Track when specific paths are changed. | ||
* | ||
* @param paths Paths to track. | ||
* @returns Normalized paths to pass to [anyPathChanged()](#anypathchanged). | ||
*/ | ||
public trackPaths(paths: string[]): string[] { | ||
trackPaths(paths: string[]): string[] { | ||
const allPaths: string[] = []; | ||
@@ -467,2 +474,3 @@ paths.forEach((path) => { | ||
* Check to see if any path has changed since watermark. | ||
* | ||
* @param counter Time counter to compare to. | ||
@@ -472,3 +480,3 @@ * @param paths Paths from [trackPaths()](#trackpaths) to check. | ||
*/ | ||
public anyPathChanged(counter: number, paths: string[]): boolean { | ||
anyPathChanged(counter: number, paths: string[]): boolean { | ||
let found = false; | ||
@@ -628,5 +636,6 @@ if (paths) { | ||
* Gets the version number. | ||
* | ||
* @returns A string with the version number. | ||
*/ | ||
public version(): string { | ||
version(): string { | ||
return '0'; | ||
@@ -633,0 +642,0 @@ } |
@@ -20,2 +20,3 @@ /** | ||
* Initializes a new instance of the [AliasPathResolver](xref:botbuilder-dialogs.AliasPathResolver) class. | ||
* | ||
* @param alias Alias name. | ||
@@ -33,6 +34,7 @@ * @param prefix Prefix name. | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
* @returns The transformed path. | ||
*/ | ||
public transformPath(path: string): string { | ||
transformPath(path: string): string { | ||
const start = path.indexOf(this.alias); | ||
@@ -39,0 +41,0 @@ if (start == 0) { |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super('@', ''); | ||
@@ -27,6 +27,7 @@ } | ||
* Transforms the path. | ||
* | ||
* @param path Path to inspect. | ||
* @returns The transformed path. | ||
*/ | ||
public transformPath(path: string): string { | ||
transformPath(path: string): string { | ||
path = path.trim(); | ||
@@ -33,0 +34,0 @@ if (path.startsWith('@') && path.length > 1 && !path.startsWith('@@')) { |
@@ -12,2 +12,3 @@ /** | ||
* Transform the path | ||
* | ||
* @param path Path to inspect. | ||
@@ -14,0 +15,0 @@ * @returns Transformed path |
@@ -20,5 +20,6 @@ /** | ||
* Initializes a new instance of the [BotStateMemoryScope](xref:adaptive-expressions.BotStateMemoryScope) class. | ||
* | ||
* @param name name of the property. | ||
*/ | ||
public constructor(name: string) { | ||
constructor(name: string) { | ||
super(name, true); | ||
@@ -29,5 +30,7 @@ } | ||
* Get the backing memory for this scope. | ||
* @param dc current dialog context | ||
* | ||
* @param dc current dialog context. | ||
* @returns Memory for the scope. | ||
*/ | ||
public getMemory(dc: DialogContext): object { | ||
getMemory(dc: DialogContext): object { | ||
const botState: BotState = dc.context.turnState.get(this.stateKey); | ||
@@ -43,6 +46,7 @@ if (botState) { | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc current dialog context | ||
* @param memory memory | ||
* @param _memory memory | ||
*/ | ||
public setMemory(dc: DialogContext, memory: object): void { | ||
setMemory(dc: DialogContext, _memory: object): void { | ||
const botState = dc.context.turnState.get(this.stateKey); | ||
@@ -52,3 +56,3 @@ if (!botState) { | ||
} | ||
throw new Error(`You cannot replace the root BotState object.`); | ||
throw new Error('You cannot replace the root BotState object.'); | ||
} | ||
@@ -58,2 +62,3 @@ | ||
* Populates the state cache for this [BotState](xref:botbuilder-core.BotState) from the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -64,3 +69,3 @@ * @param force Optional, `true` to overwrite any existing state cache; | ||
*/ | ||
public async load(dc: DialogContext, force = false): Promise<void> { | ||
async load(dc: DialogContext, force = false): Promise<void> { | ||
const botState: BotState = dc.context.turnState.get(this.stateKey); | ||
@@ -74,2 +79,3 @@ if (botState) { | ||
* Writes the state cache for this [BotState](xref:botbuilder-core.BotState) to the storage layer. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
@@ -80,3 +86,3 @@ * @param force Optional, `true` to save the state cache to storage; | ||
*/ | ||
public async saveChanges(dc: DialogContext, force = false): Promise<void> { | ||
async saveChanges(dc: DialogContext, force = false): Promise<void> { | ||
const botState: BotState = dc.context.turnState.get(this.stateKey); | ||
@@ -90,8 +96,9 @@ if (botState) { | ||
* Deletes any state in storage and the cache for this [BotState](xref:botbuilder-core.BotState). | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns A Promise that represents the work queued to execute. | ||
*/ | ||
public async delete(dc: DialogContext): Promise<void> { | ||
async delete(_dc: DialogContext): Promise<void> { | ||
return Promise.resolve(); | ||
} | ||
} |
@@ -19,5 +19,6 @@ /** | ||
* Initializes a new instance of the [ClassMemoryScope](xref:botbuilder-dialogs.ClassMemoryScope) class. | ||
* | ||
* @param name Name of the scope class. | ||
*/ | ||
public constructor(name = ScopePath.class) { | ||
constructor(name = ScopePath.class) { | ||
super(name, false); | ||
@@ -28,6 +29,7 @@ } | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns The memory for the scope. | ||
*/ | ||
public getMemory(dc: DialogContext): object { | ||
getMemory(dc: DialogContext): object { | ||
// if active dialog is a container dialog then "dialog" binds to it | ||
@@ -41,3 +43,3 @@ if (dc.activeDialog) { | ||
const prop = dialog[key]; | ||
if (dialog.hasOwnProperty(key) && typeof prop != 'function') { | ||
if (Object.prototype.hasOwnProperty.call(dialog, key) && typeof prop != 'function') { | ||
if (isExpression(prop)) { | ||
@@ -63,3 +65,5 @@ const { value, error } = prop.tryGetValue(dc.state); | ||
* Override to find the dialog instance referenced by the scope. | ||
* | ||
* @param dc Current dialog context. | ||
* @returns The dialog instance referenced by the scope. | ||
*/ | ||
@@ -66,0 +70,0 @@ protected onFindDialog(dc: DialogContext): Dialog { |
@@ -19,5 +19,5 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super(ScopePath.conversation); | ||
} | ||
} |
@@ -28,3 +28,3 @@ /** | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @retuns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
* @returns The current [Dialog](xref:botbuilder-dialogs.Dialog). | ||
*/ | ||
@@ -31,0 +31,0 @@ protected onFindDialog(dc: DialogContext): Dialog { |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super(ScopePath.dialogContext, false); | ||
@@ -27,6 +27,7 @@ } | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The `DialogContext` object for this turn. | ||
* @returns Memory for the scope. | ||
*/ | ||
public getMemory(dc: DialogContext): Record<'stack' | 'activeDialog' | 'parent', unknown> { | ||
getMemory(dc: DialogContext): Record<'stack' | 'activeDialog' | 'parent', unknown> { | ||
const stack = []; | ||
@@ -33,0 +34,0 @@ let currentDc = dc; |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super(ScopePath.dialog); | ||
@@ -27,6 +27,7 @@ } | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns The memory for the scope. | ||
*/ | ||
public getMemory(dc: DialogContext): object { | ||
getMemory(dc: DialogContext): object { | ||
// If active dialog is a container dialog then "dialog" binds to it. | ||
@@ -46,8 +47,9 @@ // Otherwise the "dialog" will bind to the dialogs parent assuming it | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @param memory Memory object to set for the scope. | ||
*/ | ||
public setMemory(dc: DialogContext, memory: object): void { | ||
setMemory(dc: DialogContext, memory: object): void { | ||
if (memory == undefined) { | ||
throw new Error(`DialogMemoryScope.setMemory: undefined memory object passed in.`); | ||
throw new Error('DialogMemoryScope.setMemory: undefined memory object passed in.'); | ||
} | ||
@@ -65,3 +67,3 @@ | ||
if (!parent.activeDialog) { | ||
throw new Error(`DialogMemoryScope.setMemory: no active dialog found.`); | ||
throw new Error('DialogMemoryScope.setMemory: no active dialog found.'); | ||
} | ||
@@ -68,0 +70,0 @@ |
@@ -16,2 +16,3 @@ /** | ||
* Initializes a new instance of the [MemoryScope](xref:botbuilder-dialogs.MemoryScope) class. | ||
* | ||
* @param name Name of the scope. | ||
@@ -21,3 +22,3 @@ * @param includeInSnapshot Boolean value indicating whether this memory | ||
*/ | ||
public constructor(name: string, includeInSnapshot = true) { | ||
constructor(name: string, includeInSnapshot = true) { | ||
this.includeInSnapshot = includeInSnapshot; | ||
@@ -30,3 +31,3 @@ this.name = name; | ||
*/ | ||
public readonly name: string; | ||
readonly name: string; | ||
@@ -36,17 +37,19 @@ /** | ||
*/ | ||
public readonly includeInSnapshot: boolean; | ||
readonly includeInSnapshot: boolean; | ||
/** | ||
* Get the backing memory for this scope | ||
* | ||
* @param dc Current dialog context. | ||
* @returns memory for the scope | ||
*/ | ||
public abstract getMemory(dc: DialogContext): object; | ||
abstract getMemory(dc: DialogContext): object; | ||
/** | ||
* Changes the backing object for the memory scope. | ||
* @param dc Current dialog context | ||
* @param memory memory to assign | ||
* | ||
* @param _dc Current dialog context | ||
* @param _memory memory to assign | ||
*/ | ||
public setMemory(dc: DialogContext, memory: object): void { | ||
setMemory(_dc: DialogContext, _memory: object): void { | ||
throw new Error(`MemoryScope.setMemory: The '${this.name}' memory scope is read-only.`); | ||
@@ -57,5 +60,6 @@ } | ||
* Loads a scopes backing memory at the start of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
public async load(dc: DialogContext): Promise<void> { | ||
async load(_dc: DialogContext): Promise<void> { | ||
// No initialization by default. | ||
@@ -66,5 +70,6 @@ } | ||
* Saves a scopes backing memory at the end of a turn. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
public async saveChanges(dc: DialogContext): Promise<void> { | ||
async saveChanges(_dc: DialogContext): Promise<void> { | ||
// No initialization by default. | ||
@@ -75,7 +80,8 @@ } | ||
* Deletes the backing memory for a scope. | ||
* @param dc Current dialog context. | ||
* | ||
* @param _dc Current dialog context. | ||
*/ | ||
public async delete(dc: DialogContext): Promise<void> { | ||
async delete(_dc: DialogContext): Promise<void> { | ||
throw new Error(`MemoryScope.delete: The '${this.name}' memory scope can't be deleted.`); | ||
} | ||
} |
@@ -23,3 +23,3 @@ /** | ||
*/ | ||
public constructor(public value?: string) {} | ||
constructor(public value?: string) {} | ||
@@ -29,3 +29,3 @@ /** | ||
*/ | ||
public children: Node[] = []; | ||
children: Node[] = []; | ||
@@ -37,3 +37,3 @@ /** | ||
*/ | ||
public isLeaf(): boolean { | ||
isLeaf(): boolean { | ||
return this.children.length === 0; | ||
@@ -65,3 +65,3 @@ } | ||
*/ | ||
public constructor(private readonly initialSettings?: Record<string, unknown>) { | ||
constructor(private readonly initialSettings?: Record<string, unknown>) { | ||
super(ScopePath.settings, false); | ||
@@ -76,3 +76,3 @@ } | ||
*/ | ||
public getMemory(dc: DialogContext): Record<string, unknown> { | ||
getMemory(dc: DialogContext): Record<string, unknown> { | ||
if (dc.context.turnState.has(ScopePath.settings)) { | ||
@@ -95,3 +95,6 @@ return dc.context.turnState.get(ScopePath.settings) ?? {}; | ||
public async load(dc: DialogContext): Promise<void> { | ||
/** | ||
* @param dc Current dialog context. | ||
*/ | ||
async load(dc: DialogContext): Promise<void> { | ||
if (this.initialSettings) { | ||
@@ -98,0 +101,0 @@ // filter initialSettings |
@@ -19,3 +19,3 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super(ScopePath.this); | ||
@@ -26,6 +26,7 @@ } | ||
* Gets the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @returns The memory for the scope. | ||
*/ | ||
public getMemory(dc: DialogContext): object { | ||
getMemory(dc: DialogContext): object { | ||
return dc.activeDialog ? dc.activeDialog.state : undefined; | ||
@@ -36,12 +37,13 @@ } | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. | ||
* @param memory Memory object to set for the scope. | ||
*/ | ||
public setMemory(dc: DialogContext, memory: object): void { | ||
setMemory(dc: DialogContext, memory: object): void { | ||
if (memory == undefined) { | ||
throw new Error(`ThisMemoryScope.setMemory: undefined memory object passed in.`); | ||
throw new Error('ThisMemoryScope.setMemory: undefined memory object passed in.'); | ||
} | ||
if (!dc.activeDialog) { | ||
throw new Error(`ThisMemoryScope.setMemory: no active dialog found.`); | ||
throw new Error('ThisMemoryScope.setMemory: no active dialog found.'); | ||
} | ||
@@ -48,0 +50,0 @@ |
@@ -24,3 +24,3 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super(ScopePath.turn, true); | ||
@@ -31,6 +31,7 @@ } | ||
* Get the backing memory for this scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
* @returns The memory for the scope. | ||
*/ | ||
public getMemory(dc: DialogContext): object { | ||
getMemory(dc: DialogContext): object { | ||
let memory = dc.context.turnState.get(TURN_STATE); | ||
@@ -47,8 +48,9 @@ if (typeof memory != 'object') { | ||
* Changes the backing object for the memory scope. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for this turn. | ||
* @param memory Memory object to set for the scope. | ||
*/ | ||
public setMemory(dc: DialogContext, memory: object): void { | ||
setMemory(dc: DialogContext, memory: object): void { | ||
if (memory == undefined) { | ||
throw new Error(`TurnMemoryScope.setMemory: undefined memory object passed in.`); | ||
throw new Error('TurnMemoryScope.setMemory: undefined memory object passed in.'); | ||
} | ||
@@ -55,0 +57,0 @@ |
@@ -19,5 +19,5 @@ /** | ||
*/ | ||
public constructor() { | ||
constructor() { | ||
super(ScopePath.user); | ||
} | ||
} |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
public static readonly options = 'this.options'; | ||
static readonly options = 'this.options'; | ||
} |
@@ -14,36 +14,36 @@ /** | ||
/// The result from the last dialog that was called. | ||
public static readonly lastResult = 'turn.lastresult'; | ||
static readonly lastResult = 'turn.lastresult'; | ||
/// The current activity for the turn. | ||
public static readonly activity = 'turn.activity'; | ||
static readonly activity = 'turn.activity'; | ||
/// The recognized result for the current turn. | ||
public static readonly recognized = 'turn.recognized'; | ||
static readonly recognized = 'turn.recognized'; | ||
/// Path to the top intent. | ||
public static readonly topIntent = 'turn.recognized.intent'; | ||
static readonly topIntent = 'turn.recognized.intent'; | ||
/// Path to the top score. | ||
public static readonly topScore = 'turn.recognized.score'; | ||
static readonly topScore = 'turn.recognized.score'; | ||
/// Original text. | ||
public static readonly text = 'turn.recognized.text'; | ||
static readonly text = 'turn.recognized.text'; | ||
/// Original utterance split into unrecognized strings. | ||
public static readonly unrecognizedText = 'turn.unrecognizedText'; | ||
static readonly unrecognizedText = 'turn.unrecognizedText'; | ||
/// Entities that were recognized from text. | ||
public static readonly recognizedEntities = 'turn.recognizedEntities'; | ||
static readonly recognizedEntities = 'turn.recognizedEntities'; | ||
/// If true an interruption has occured. | ||
public static readonly interrupted = 'turn.interrupted'; | ||
static readonly interrupted = 'turn.interrupted'; | ||
/// The current dialog event (set during event processings). | ||
public static readonly dialogEvent = 'turn.dialogEvent'; | ||
static readonly dialogEvent = 'turn.dialogEvent'; | ||
/// Used to track that we don't end up in infinite loop of RepeatDialogs(). | ||
public static readonly repeatedIds = 'turn.repeatedIds'; | ||
static readonly repeatedIds = 'turn.repeatedIds'; | ||
/// This is a bool which if set means that the turncontext.activity has been consumed by some component in the system. | ||
public static readonly activityProcessed = 'turn.activityProcessed'; | ||
static readonly activityProcessed = 'turn.activityProcessed'; | ||
} |
@@ -24,2 +24,3 @@ /** | ||
* Creates a new ActivityPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -34,2 +35,3 @@ * @param validator Validator that will be called each time a new activity is received. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -40,7 +42,7 @@ * turn of the conversation. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
* @remarks | ||
* @remarks | ||
* If the promise is successful, the result indicates whether the prompt is still | ||
* active after the turn has been processed by the prompt. | ||
*/ | ||
public async beginDialog(dc: DialogContext, options: PromptOptions): Promise<DialogTurnResult> { | ||
async beginDialog(dc: DialogContext, options: PromptOptions): Promise<DialogTurnResult> { | ||
// Ensure prompts have input hint set | ||
@@ -68,2 +70,3 @@ const opt: Partial<PromptOptions> = { ...options }; | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -78,3 +81,3 @@ * turn of conversation. | ||
*/ | ||
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
// Perform base recognition | ||
@@ -118,11 +121,12 @@ const state: any = dc.activeDialog.state as ActivityPromptState; | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
* of the conversation. | ||
* @param reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* @param _reason [DialogReason](xref:botbuilder-dialogs.DialogReason), an enum indicating why | ||
* the dialog resumed. | ||
* @param result Optional. Value returned from the previous dialog on the stack. | ||
* @param _result Optional. Value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
* @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
async resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult> { | ||
// Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs | ||
@@ -140,2 +144,3 @@ // on top of the stack which will result in the prompt receiving an unexpected call to | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -147,9 +152,10 @@ * turn of conversation with the user. | ||
*/ | ||
public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
const state: ActivityPromptState = instance.state as ActivityPromptState; | ||
await this.onPrompt(context, state.state, state.options, false); | ||
} | ||
/** | ||
* When overridden in a derived class, prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -178,6 +184,7 @@ * turn of conversation with the user. | ||
* When overridden in a derived class, attempts to recognize the incoming [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
@@ -188,4 +195,4 @@ * @returns A `Promise` representing the asynchronous operation. | ||
context: TurnContext, | ||
state: object, | ||
options: PromptOptions | ||
_state: object, | ||
_options: PromptOptions | ||
): Promise<PromptRecognizerResult<Activity>> { | ||
@@ -192,0 +199,0 @@ return { succeeded: true, value: context.activity }; |
@@ -20,2 +20,3 @@ /** | ||
* Creates a new `AttachmentPrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -30,2 +31,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -54,5 +56,6 @@ * @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A prompt options object constructed from the options initially provided | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A prompt options object constructed from the options initially provided | ||
* in the call to Prompt. | ||
@@ -63,4 +66,4 @@ * @returns A Promise representing the asynchronous operation. | ||
context: TurnContext, | ||
state: any, | ||
options: PromptOptions | ||
_state: any, | ||
_options: PromptOptions | ||
): Promise<PromptRecognizerResult<Attachment[]>> { | ||
@@ -67,0 +70,0 @@ const value: Attachment[] = context.activity.attachments; |
@@ -35,3 +35,3 @@ /** | ||
*/ | ||
public defaultLocale: string | undefined; | ||
defaultLocale: string | undefined; | ||
@@ -44,3 +44,3 @@ /** | ||
*/ | ||
public style: ListStyle; | ||
style: ListStyle; | ||
@@ -51,3 +51,3 @@ /** | ||
*/ | ||
public choiceOptions: ChoiceFactoryOptions | undefined; | ||
choiceOptions: ChoiceFactoryOptions | undefined; | ||
@@ -57,6 +57,7 @@ /** | ||
*/ | ||
public recognizerOptions: FindChoicesOptions | undefined; | ||
recognizerOptions: FindChoicesOptions | undefined; | ||
/** | ||
* Creates a new `ChoicePrompt` instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet`. | ||
@@ -68,3 +69,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. If the validator replies with a message no additional retry prompt will be sent. | ||
*/ | ||
public constructor( | ||
constructor( | ||
dialogId: string, | ||
@@ -97,2 +98,3 @@ validator?: PromptValidator<FoundChoice>, | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -136,3 +138,4 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext) context for the current | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext) context for the current | ||
* turn of conversation with the user. | ||
@@ -139,0 +142,0 @@ * @param state Contains state for the current instance of the prompt on the dialog stack. |
@@ -36,3 +36,3 @@ /** | ||
*/ | ||
public defaultLocale: string | undefined; | ||
defaultLocale: string | undefined; | ||
@@ -45,3 +45,3 @@ /** | ||
*/ | ||
public style: ListStyle; | ||
style: ListStyle; | ||
@@ -52,3 +52,3 @@ /** | ||
*/ | ||
public choiceOptions: ChoiceFactoryOptions | undefined; | ||
choiceOptions: ChoiceFactoryOptions | undefined; | ||
@@ -58,11 +58,13 @@ /** | ||
*/ | ||
public confirmChoices: (string | Choice)[] | undefined; | ||
confirmChoices: (string | Choice)[] | undefined; | ||
/** | ||
* Creates a new ConfirmPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
* @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`. | ||
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on [[PromptCultureModels.getSupportedCultures()]]. | ||
*/ | ||
public constructor( | ||
constructor( | ||
dialogId: string, | ||
@@ -98,2 +100,3 @@ validator?: PromptValidator<boolean>, | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -132,6 +135,7 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
@@ -142,4 +146,4 @@ * @returns A `Promise` representing the asynchronous operation. | ||
context: TurnContext, | ||
state: any, | ||
options: PromptOptions | ||
_state, | ||
_options: PromptOptions | ||
): Promise<PromptRecognizerResult<boolean>> { | ||
@@ -146,0 +150,0 @@ const result: PromptRecognizerResult<boolean> = { succeeded: false }; |
@@ -44,6 +44,7 @@ /** | ||
*/ | ||
public defaultLocale: string | undefined; | ||
defaultLocale: string | undefined; | ||
/** | ||
* Creates a new DateTimePrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -60,2 +61,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -85,6 +87,7 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
@@ -95,4 +98,4 @@ * @returns A `Promise` representing the asynchronous operation. | ||
context: TurnContext, | ||
state: any, | ||
options: PromptOptions | ||
_state: any, | ||
_options: PromptOptions | ||
): Promise<PromptRecognizerResult<DateTimeResolution[]>> { | ||
@@ -99,0 +102,0 @@ const result: PromptRecognizerResult<DateTimeResolution[]> = { succeeded: false }; |
@@ -27,6 +27,7 @@ /** | ||
*/ | ||
public defaultLocale?: string; | ||
defaultLocale?: string; | ||
/** | ||
* Creates a new NumberPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -43,3 +44,4 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
@@ -68,6 +70,7 @@ * @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
@@ -78,4 +81,4 @@ * @returns A `Promise` representing the asynchronous operation. | ||
context: TurnContext, | ||
state: unknown, | ||
options: PromptOptions | ||
_state: unknown, | ||
_options: PromptOptions | ||
): Promise<PromptRecognizerResult<number>> { | ||
@@ -103,3 +106,3 @@ const result: PromptRecognizerResult<number> = { succeeded: false }; | ||
numberParser = parser.numberParser(); | ||
} catch (err) { | ||
} catch { | ||
numberParser = Globalize(this.getCultureFormattedForGlobalize(defaultLocale)).numberParser(); | ||
@@ -106,0 +109,0 @@ } |
@@ -166,2 +166,3 @@ /** | ||
* Creates a new OAuthPrompt instance. | ||
* | ||
* @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -191,3 +192,3 @@ * @param settings Settings used to configure the prompt. | ||
*/ | ||
public async beginDialog(dc: DialogContext, options?: PromptOptions): Promise<DialogTurnResult> { | ||
async beginDialog(dc: DialogContext, options?: PromptOptions): Promise<DialogTurnResult> { | ||
// Ensure prompts have input hint set | ||
@@ -224,2 +225,3 @@ const o: Partial<PromptOptions> = { ...options }; | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn | ||
@@ -234,3 +236,3 @@ * of the conversation. | ||
*/ | ||
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
// Check for timeout | ||
@@ -292,6 +294,8 @@ const state: OAuthPromptState = dc.activeDialog.state as OAuthPromptState; | ||
* Attempts to retrieve the stored token for the current user. | ||
* | ||
* @param context Context reference the user that's being looked up. | ||
* @param code (Optional) login code received from the user. | ||
* @returns The token response. | ||
*/ | ||
public async getUserToken(context: TurnContext, code?: string): Promise<TokenResponse | undefined> { | ||
async getUserToken(context: TurnContext, code?: string): Promise<TokenResponse | undefined> { | ||
return UserTokenAccess.getUserToken(context, this.settings, code); | ||
@@ -314,4 +318,5 @@ } | ||
* @param context Context referencing the user that's being signed out. | ||
* @returns A promise representing the asynchronous operation. | ||
*/ | ||
public async signOutUser(context: TurnContext): Promise<void> { | ||
async signOutUser(context: TurnContext): Promise<void> { | ||
return UserTokenAccess.signOutUser(context, this.settings); | ||
@@ -327,3 +332,3 @@ } | ||
*/ | ||
public static async sendOAuthCard( | ||
static async sendOAuthCard( | ||
settings: OAuthPromptSettings, | ||
@@ -410,3 +415,3 @@ turnContext: TurnContext, | ||
*/ | ||
public async recognizeToken(dc: DialogContext): Promise<PromptRecognizerResult<TokenResponse>> { | ||
async recognizeToken(dc: DialogContext): Promise<PromptRecognizerResult<TokenResponse>> { | ||
const context = dc.context; | ||
@@ -595,3 +600,3 @@ let token: TokenResponse | undefined; | ||
private static isTokenExchangeRequest(obj: unknown): obj is TokenExchangeInvokeRequest { | ||
if (obj.hasOwnProperty('token')) { | ||
if (Object.prototype.hasOwnProperty.call(obj, 'token')) { | ||
return true; | ||
@@ -598,0 +603,0 @@ } |
@@ -82,2 +82,3 @@ /** | ||
* Result returned by a prompts recognizer function. | ||
* | ||
* @param T Type of value being recognized. | ||
@@ -120,2 +121,3 @@ */ | ||
* Contextual information passed to a custom `PromptValidator`. | ||
* | ||
* @param T Type of recognizer result being validated. | ||
@@ -167,2 +169,3 @@ */ | ||
* Base class for all prompts. | ||
* | ||
* @param T Type of value being returned by the prompts recognizer function. | ||
@@ -173,2 +176,3 @@ */ | ||
* Creates a new Prompt instance. | ||
* | ||
* @param dialogId Unique ID of the prompt within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -183,2 +187,3 @@ * @param validator (Optional) custom validator used to provide additional validation and re-prompting logic for the prompt. | ||
* Called when a prompt dialog is pushed onto the dialog stack and is being activated. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
@@ -193,3 +198,3 @@ * turn of the conversation. | ||
*/ | ||
public async beginDialog(dc: DialogContext, options: PromptOptions): Promise<DialogTurnResult> { | ||
async beginDialog(dc: DialogContext, options: PromptOptions): Promise<DialogTurnResult> { | ||
// Ensure prompts have input hint set | ||
@@ -217,2 +222,3 @@ const opt: Partial<PromptOptions> = { ...options }; | ||
* Called when a prompt dialog is the active dialog and the user replied with a new activity. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -226,3 +232,3 @@ * @returns A `Promise` representing the asynchronous operation. | ||
*/ | ||
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
// Don't do anything for non-message activities | ||
@@ -278,2 +284,3 @@ if (dc.context.activity.type !== ActivityTypes.Message) { | ||
* Called before an event is bubbled to its parent. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -305,5 +312,6 @@ * @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* when the previous active dialog on the stack completes. | ||
* | ||
* @param dc The DialogContext for the current turn of the conversation. | ||
* @param reason An enum indicating why the dialog resumed. | ||
* @param result Optional, value returned from the previous dialog on the stack. | ||
* @param _reason An enum indicating why the dialog resumed. | ||
* @param _result Optional, value returned from the previous dialog on the stack. | ||
* The type of the value returned is dependent on the previous dialog. | ||
@@ -315,3 +323,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
async resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult> { | ||
// Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs | ||
@@ -329,2 +337,3 @@ // on top of the stack which will result in the prompt receiving an unexpected call to | ||
* Called when a prompt dialog has been requested to re-prompt the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -336,3 +345,3 @@ * turn of conversation with the user. | ||
*/ | ||
public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
const state: PromptState = instance.state as PromptState; | ||
@@ -344,2 +353,3 @@ await this.onPrompt(context, state.state, state.options, false); | ||
* Called anytime the derived class should send the user a prompt. | ||
* | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -375,2 +385,3 @@ * @param state Additional state being persisted for the prompt. | ||
* Helper function to compose an output activity containing a set of choices. | ||
* | ||
* @param prompt The prompt to append the users choices to. | ||
@@ -381,2 +392,3 @@ * @param channelId ID of the channel the prompt is being sent to. | ||
* @param options (Optional) options to configure the underlying ChoiceFactory call. | ||
* @returns The composed activity ready to send to the user. | ||
*/ | ||
@@ -383,0 +395,0 @@ protected appendChoices( |
@@ -6,2 +6,3 @@ import { Culture } from '@microsoft/recognizers-text-suite'; | ||
* Culture Model's Locale. | ||
* | ||
* @example | ||
@@ -13,2 +14,3 @@ * "en-US" | ||
* Culture Model's InlineSeparator. | ||
* | ||
* @example | ||
@@ -20,2 +22,3 @@ * ", " | ||
* Culture Model's InlineOr. | ||
* | ||
* @example | ||
@@ -27,2 +30,3 @@ * " or " | ||
* Culture Model's InlineOrMore. | ||
* | ||
* @example | ||
@@ -34,2 +38,3 @@ * ", or " | ||
* Equivalent of "Yes" in Culture Model's Language. | ||
* | ||
* @example | ||
@@ -41,2 +46,3 @@ * "Yes" | ||
* Equivalent of "No" in Culture Model's Language. | ||
* | ||
* @example | ||
@@ -52,3 +58,3 @@ * "No" | ||
export class PromptCultureModels { | ||
public static Chinese: PromptCultureModel = { | ||
static Chinese: PromptCultureModel = { | ||
locale: Culture.Chinese, | ||
@@ -62,3 +68,3 @@ separator: ', ', | ||
public static Dutch: PromptCultureModel = { | ||
static Dutch: PromptCultureModel = { | ||
locale: Culture.Dutch, | ||
@@ -72,3 +78,3 @@ separator: ', ', | ||
public static English: PromptCultureModel = { | ||
static English: PromptCultureModel = { | ||
locale: Culture.English, | ||
@@ -82,3 +88,3 @@ separator: ', ', | ||
public static French: PromptCultureModel = { | ||
static French: PromptCultureModel = { | ||
locale: Culture.French, | ||
@@ -92,3 +98,3 @@ separator: ', ', | ||
public static German: PromptCultureModel = { | ||
static German: PromptCultureModel = { | ||
locale: Culture.German, | ||
@@ -102,3 +108,3 @@ separator: ', ', | ||
public static Italian: PromptCultureModel = { | ||
static Italian: PromptCultureModel = { | ||
locale: Culture.Italian, | ||
@@ -112,3 +118,3 @@ separator: ', ', | ||
public static Japanese: PromptCultureModel = { | ||
static Japanese: PromptCultureModel = { | ||
locale: Culture.Japanese, | ||
@@ -122,3 +128,3 @@ separator: '、 ', | ||
public static Portuguese: PromptCultureModel = { | ||
static Portuguese: PromptCultureModel = { | ||
locale: Culture.Portuguese, | ||
@@ -132,3 +138,3 @@ separator: ', ', | ||
public static Spanish: PromptCultureModel = { | ||
static Spanish: PromptCultureModel = { | ||
locale: Culture.Spanish, | ||
@@ -151,2 +157,3 @@ separator: ', ', | ||
* Use Recognizers-Text to normalize various potential Locale strings to a standard. | ||
* | ||
* @remarks This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39 | ||
@@ -157,3 +164,3 @@ * This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts. | ||
*/ | ||
public static mapToNearestLanguage(cultureCode: string): string { | ||
static mapToNearestLanguage(cultureCode: string): string { | ||
if (cultureCode) { | ||
@@ -177,3 +184,3 @@ cultureCode = cultureCode.toLowerCase(); | ||
public static getSupportedCultures = (): PromptCultureModel[] => [ | ||
static getSupportedCultures = (): PromptCultureModel[] => [ | ||
PromptCultureModels.Chinese, | ||
@@ -180,0 +187,0 @@ PromptCultureModels.Dutch, |
@@ -22,2 +22,3 @@ /** | ||
* Creates a new TextPrompt instance. | ||
* | ||
* @param dialogId (Optional) unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. | ||
@@ -32,2 +33,3 @@ * @param validator (Optional) validator that will be called each time the user responds to the prompt. | ||
* Prompts the user for input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
@@ -57,6 +59,7 @@ * turn of conversation with the user. | ||
* Attempts to recognize the user's input. | ||
* | ||
* @param context [TurnContext](xref:botbuilder-core.TurnContext), context for the current | ||
* turn of conversation with the user. | ||
* @param state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* @param _state Contains state for the current instance of the prompt on the dialog stack. | ||
* @param _options A [PromptOptions](xref:botbuilder-dialogs.PromptOptions) object constructed | ||
* from the options initially provided in the call to Prompt. | ||
@@ -67,4 +70,4 @@ * @returns A `Promise` representing the asynchronous operation. | ||
context: TurnContext, | ||
state: any, | ||
options: PromptOptions | ||
_state: any, | ||
_options: PromptOptions | ||
): Promise<PromptRecognizerResult<string>> { | ||
@@ -78,5 +81,6 @@ const value: string = context.activity.text; | ||
* Called before an event is bubbled to its parent. | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* | ||
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current | ||
* turn of conversation. | ||
* @param event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @param _event [DialogEvent](xref:botbuilder-dialogs.DialogEvent), the event being raised. | ||
* @returns Whether the event is handled by the current dialog and further processing should stop. | ||
@@ -88,5 +92,5 @@ * @remarks | ||
*/ | ||
protected async onPreBubbleEvent(dc: DialogContext, event: DialogEvent): Promise<boolean> { | ||
protected async onPreBubbleEvent(_dc: DialogContext, _event: DialogEvent): Promise<boolean> { | ||
return false; | ||
} | ||
} |
@@ -16,6 +16,7 @@ /** | ||
} from 'botbuilder-core'; | ||
import { omit } from 'lodash'; | ||
import { Configurable } from './configurable'; | ||
import { DialogContext } from './dialogContext'; | ||
import { DialogTurnStateConstants } from './dialogTurnStateConstants'; | ||
import omit = require('lodash/omit'); | ||
@@ -34,3 +35,3 @@ export interface RecognizerConfiguration { | ||
*/ | ||
public id: string; | ||
id: string; | ||
@@ -41,3 +42,3 @@ /** | ||
*/ | ||
public telemetryClient: BotTelemetryClient = new NullTelemetryClient(); | ||
telemetryClient: BotTelemetryClient = new NullTelemetryClient(); | ||
@@ -47,13 +48,12 @@ /** | ||
* | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {Partial<Activity>} activity Activity. | ||
* @param {Record<string, string>} telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
* @returns {Promise<RecognizerResult>} Recognized result. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @param {Partial<Activity>} _activity Activity. | ||
* @param {Record<string, string>} _telemetryProperties Additional properties to be logged to telemetry with event. | ||
* @param {Record<string, number>} _telemetryMetrics Additional metrics to be logged to telemetry with event. | ||
*/ | ||
public recognize( | ||
dialogContext: DialogContext, | ||
activity: Partial<Activity>, | ||
telemetryProperties?: Record<string, string>, | ||
telemetryMetrics?: Record<string, number> | ||
recognize( | ||
_dialogContext: DialogContext, | ||
_activity: Partial<Activity>, | ||
_telemetryProperties?: Record<string, string>, | ||
_telemetryMetrics?: Record<string, number> | ||
): Promise<RecognizerResult> { | ||
@@ -71,5 +71,7 @@ throw new Error('Please implement recognize function.'); | ||
let text: string; | ||
let sentiment: Record<string, any> = null; | ||
type candidateType = { id: string; intent: string; score: number; result: RecognizerResult }; | ||
const candidates = Object.entries(recognizerResults).reduce((candidates: candidateType[], [key, result]) => { | ||
text = result.text; | ||
sentiment = result.sentiment; | ||
const { intent, score } = getTopScoringIntent(result); | ||
@@ -103,2 +105,3 @@ if (intent !== 'None') { | ||
entities: {}, | ||
sentiment: sentiment, | ||
}; | ||
@@ -110,6 +113,6 @@ return recognizerResult; | ||
* Uses the RecognizerResult to create a list of properties to be included when tracking the result in telemetry. | ||
* | ||
* | ||
* @param {RecognizerResult} recognizerResult Recognizer Result. | ||
* @param {Record<string, string>} telemetryProperties A list of properties to append or override the properties created using the RecognizerResult. | ||
* @param {DialogContext} dialogContext Dialog Context. | ||
* @param {DialogContext} _dialogContext Dialog Context. | ||
* @returns {Record<string, string>} A collection of properties that can be included when calling the TrackEvent method on the TelemetryClient. | ||
@@ -120,3 +123,3 @@ */ | ||
telemetryProperties: Record<string, string>, | ||
dialogContext?: DialogContext | ||
_dialogContext?: DialogContext | ||
): Record<string, string> { | ||
@@ -172,4 +175,5 @@ const { intent, score } = getTopScoringIntent(recognizerResult); | ||
if (this.telemetryClient instanceof NullTelemetryClient) { | ||
const turnStateTelemetryClient = dialogContext.context.turnState.get<BotTelemetryClient>(DialogTurnStateConstants.telemetryClient) | ||
?? dialogContext.context.turnState.get<BotTelemetryClient>(BotTelemetryClientKey); | ||
const turnStateTelemetryClient = | ||
dialogContext.context.turnState.get<BotTelemetryClient>(DialogTurnStateConstants.telemetryClient) ?? | ||
dialogContext.context.turnState.get<BotTelemetryClient>(BotTelemetryClientKey); | ||
this.telemetryClient = turnStateTelemetryClient ?? this.telemetryClient; | ||
@@ -176,0 +180,0 @@ } |
@@ -36,2 +36,3 @@ /** | ||
* A specialized Dialog that can wrap remote calls to a skill. | ||
* | ||
* @remarks | ||
@@ -55,6 +56,6 @@ * The options parameter in beginDialog must be a BeginSkillDialogOptions instance | ||
* | ||
* @param dialogOptions | ||
* @param dialogId | ||
* @param dialogOptions The options to execute the skill dialog. | ||
* @param dialogId The id of the dialog. | ||
*/ | ||
public constructor(dialogOptions: SkillDialogOptions, dialogId?: string) { | ||
constructor(dialogOptions: SkillDialogOptions, dialogId?: string) { | ||
super(dialogId); | ||
@@ -69,2 +70,3 @@ if (!dialogOptions) { | ||
* Called when the skill dialog is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -76,3 +78,3 @@ * @param options Initial information to pass to the dialog. | ||
*/ | ||
public async beginDialog(dc: DialogContext, options: BeginSkillDialogOptions): Promise<DialogTurnResult> { | ||
async beginDialog(dc: DialogContext, options: BeginSkillDialogOptions): Promise<DialogTurnResult> { | ||
const dialogArgs = this.validateBeginDialogArgs(options); | ||
@@ -108,2 +110,3 @@ | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -116,3 +119,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
// with adaptive dialogs, ResumeDialog is not called directly. Instead the Interrupted flag is set, which | ||
@@ -153,2 +156,3 @@ // acts as the signal to the SkillDialog to resume the skill. | ||
* Called when the skill dialog is ending. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -159,3 +163,3 @@ * @param instance State information associated with the instance of this dialog on the dialog stack. | ||
*/ | ||
public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
// Send of of conversation to the skill if the dialog has been cancelled. | ||
@@ -183,2 +187,3 @@ if (reason == DialogReason.cancelCalled || reason == DialogReason.replaceCalled) { | ||
* Called when the skill dialog should re-prompt the user for input. | ||
* | ||
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. | ||
@@ -188,3 +193,3 @@ * @param instance State information for this dialog. | ||
*/ | ||
public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> { | ||
// Create and send an envent to the skill so it can resume the dialog. | ||
@@ -205,9 +210,10 @@ const repromptEvent = { type: ActivityTypes.Event, name: DialogEvents.repromptDialog }; | ||
* Called when a child skill dialog completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
* @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param result Optional, value returned from the dialog that was called. The type | ||
* @param _reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
* @param _result Optional, value returned from the dialog that was called. The type | ||
* of the value returned is dependent on the child dialog. | ||
* @returns A Promise representing the asynchronous operation. | ||
*/ | ||
public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
async resumeDialog(dc: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult> { | ||
await this.repromptDialog(dc.context, dc.activeDialog); | ||
@@ -224,5 +230,6 @@ return Dialog.EndOfTurn; | ||
* If this method returns false, the dialog will end the turn without processing the activity. | ||
* @param activity The Activity for the current turn of conversation. | ||
* @param _activity The Activity for the current turn of conversation. | ||
* @returns True if the activity is valid, false if not. | ||
*/ | ||
protected onValidateActivity(activity: Activity): boolean { | ||
protected onValidateActivity(_activity: Activity): boolean { | ||
return true; | ||
@@ -249,3 +256,3 @@ } | ||
if (!options.activity) { | ||
throw new TypeError(`"activity" is undefined or null in options.`); | ||
throw new TypeError('"activity" is undefined or null in options.'); | ||
} | ||
@@ -374,3 +381,3 @@ | ||
} | ||
} catch (err) { | ||
} catch { | ||
// Failures in token exchange are not fatal. They simply mean that the user needs to be shown the skill's OAuthCard. | ||
@@ -377,0 +384,0 @@ return false; |
@@ -17,2 +17,3 @@ /** | ||
* Given the turn context bind to the data to create the object | ||
* | ||
* @param dialogContext DialogContext. | ||
@@ -19,0 +20,0 @@ * @param data Data to bind to. |
@@ -22,2 +22,3 @@ /** | ||
* ``` | ||
* | ||
* @param O (Optional) type of dialog options passed into the step. | ||
@@ -95,8 +96,9 @@ * @param WaterfallStep.step Contextual information for the current step being executed. | ||
* Gets the dialog version, composed of the ID and number of steps. | ||
* | ||
* @returns Dialog version, composed of the ID and number of steps. | ||
*/ | ||
public getVersion(): string { | ||
getVersion(): string { | ||
// Simply return the id + number of steps to help detect when new steps have | ||
// been added to a given waterfall. | ||
return `${ this.id }:${ this.steps.length }`; | ||
return `${this.id}:${this.steps.length}`; | ||
} | ||
@@ -141,4 +143,5 @@ | ||
* @param step Asynchronous step function to call. | ||
* @returns Waterfall dialog for fluent calls to `addStep()`. | ||
*/ | ||
public addStep(step: WaterfallStep<O>): this { | ||
addStep(step: WaterfallStep<O>): this { | ||
this.steps.push(step); | ||
@@ -151,2 +154,3 @@ | ||
* Called when the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is started and pushed onto the dialog stack. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -159,3 +163,3 @@ * @param options Optional, initial information to pass to the [Dialog](xref:botbuilder-dialogs.Dialog). | ||
*/ | ||
public async beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult> { | ||
async beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult> { | ||
// Initialize waterfall state | ||
@@ -185,2 +189,3 @@ const state: WaterfallDialogState = dc.activeDialog.state as WaterfallDialogState; | ||
* user replies with a new [Activity](xref:botframework-schema.Activity). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -193,3 +198,3 @@ * @returns A Promise representing the asynchronous operation. | ||
*/ | ||
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> { | ||
// Don't do anything for non-message activities | ||
@@ -206,2 +211,3 @@ if (dc.context.activity.type !== ActivityTypes.Message) { | ||
* Called when a child [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) completed its turn, returning control to this dialog. | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. | ||
@@ -213,3 +219,3 @@ * @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog resumed. | ||
*/ | ||
public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> { | ||
// Increment step index and run step | ||
@@ -236,2 +242,3 @@ const state: WaterfallDialogState = dc.activeDialog.state as WaterfallDialogState; | ||
* @param step Context object for the waterfall step to execute. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
@@ -255,2 +262,3 @@ protected async onStep(step: WaterfallStepContext<O>): Promise<DialogTurnResult> { | ||
* Executes a step of the [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog). | ||
* | ||
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. | ||
@@ -307,3 +315,3 @@ * @param index The index of the current waterfall step to execute. | ||
*/ | ||
public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> { | ||
const state: WaterfallDialogState = instance.state as WaterfallDialogState; | ||
@@ -335,2 +343,3 @@ const instanceId = state.values['instanceId']; | ||
* Identifies the step name by its position index. | ||
* | ||
* @param index Step position | ||
@@ -337,0 +346,0 @@ * @returns A string that identifies the step name. |
@@ -43,2 +43,3 @@ /** | ||
* Called to skip to the next waterfall step. | ||
* | ||
* @param result (Optional) result to pass to the next step. | ||
@@ -51,2 +52,3 @@ */ | ||
* Context object passed in to a `WaterfallStep`. | ||
* | ||
* @param O (Optional) type of options passed to the steps waterfall dialog in the call to `DialogContext.beginDialog()`. | ||
@@ -59,6 +61,7 @@ */ | ||
* Creates a new WaterfallStepContext instance. | ||
* | ||
* @param dc The dialog context for the current turn of conversation. | ||
* @param info Values to initialize the step context with. | ||
*/ | ||
public constructor(dc: DialogContext, info: WaterfallStepInfo<O>) { | ||
constructor(dc: DialogContext, info: WaterfallStepInfo<O>) { | ||
super(dc.dialogs, dc, { dialogStack: dc.stack }); | ||
@@ -71,4 +74,6 @@ this._info = info; | ||
* The index of the current waterfall step being executed. | ||
* | ||
* @returns The index of the current waterfall step being executed. | ||
*/ | ||
public get index(): number { | ||
get index(): number { | ||
return this._info.index; | ||
@@ -80,4 +85,6 @@ } | ||
* `DialogContext.beginDialog()`. | ||
* | ||
* @returns Any options the waterfall dialog was called with. | ||
*/ | ||
public get options(): O { | ||
get options(): O { | ||
return this._info.options; | ||
@@ -88,4 +95,6 @@ } | ||
* The reason the waterfall step is being executed. | ||
* | ||
* @returns The reason the waterfall step is being executed. | ||
*/ | ||
public get reason(): DialogReason { | ||
get reason(): DialogReason { | ||
return this._info.reason; | ||
@@ -96,4 +105,6 @@ } | ||
* Results returned by a dialog or prompt that was called in the previous waterfall step. | ||
* | ||
* @returns The result from the previous waterfall step. | ||
*/ | ||
public get result(): any { | ||
get result(): any { | ||
return this._info.result; | ||
@@ -104,4 +115,6 @@ } | ||
* A dictionary of values which will be persisted across all waterfall steps. | ||
* | ||
* @returns A dictionary of values which will be persisted across all waterfall steps. | ||
*/ | ||
public get values(): object { | ||
get values(): object { | ||
return this._info.values; | ||
@@ -119,6 +132,7 @@ } | ||
* @param result (Optional) result to pass to the next step. | ||
* @returns A promise with the DialogTurnResult. | ||
*/ | ||
public async next(result?: any): Promise<DialogTurnResult> { | ||
async next(result?: any): Promise<DialogTurnResult> { | ||
return await this._info.onNext(result); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1386924
1.8%29285
2.79%11
10%2
100%