botbuilder-dialogs
Version:
A dialog stack based conversation manager for Microsoft BotBuilder.
76 lines (73 loc) • 3.19 kB
TypeScript
/**
* @module botbuilder-dialogs
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { BotTelemetryClient } from 'botbuilder-core';
import { Dialog, DialogEvent } from './dialog';
import { DialogSet } from './dialogSet';
import { DialogContext } from './dialogContext';
/**
* A container for a set of Dialogs.
*/
export declare abstract class DialogContainer<O extends object = {}> extends Dialog<O> {
/**
* The containers dialog set.
*/
readonly dialogs: DialogSet;
/**
* 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.
*/
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.
*/
findDialog(dialogId: string): Dialog | undefined;
/**
* Called when an event has been raised, using `DialogContext.emitEvent()`,
* by either the current dialog or a dialog that the current dialog started.
*
* @param dc The dialog context for the current turn of conversation.
* @param e The event being raised.
* @returns True if the event is handled by the current dialog and bubbling should stop.
*/
onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>;
/**
* Returns internal version identifier for this container.
*
* @remarks
* DialogContainers detect changes of all sub-components in the container and map that to a `versionChanged` event.
* Because they do this, DialogContainers "hide" the internal changes and just have the .id. This isolates changes
* to the container level unless a container doesn't handle it. To support this DialogContainers define a
* protected method getInternalVersion() which computes if this dialog or child dialogs have changed
* which is then examined via calls to checkForVersionChange().
* @returns Version which represents the change of the internals of this container.
*/
protected getInternalVersion(): string;
/**
* Checks to see if a containers child dialogs have changed since the current dialog instance
* was started.
*
* @remarks
* This should be called at the start of `beginDialog()`, `continueDialog()`, and `resumeDialog()`.
* @param dc Current dialog context.
*/
protected checkForVersionChange(dc: DialogContext): Promise<void>;
/*
* Get the current telemetry client.
*
* @returns The [BotTelemetryClient](xref:botbuilder.BotTelemetryClient) to use for logging.
* Set the telemetry client, and also apply it to all child dialogs.
* Future dialogs added to the component will also inherit this client.
*/
telemetryClient: BotTelemetryClient;
}
//# sourceMappingURL=dialogContainer.d.ts.map