From 9e8239e056c11e495777cb04d057fd1bd2f6c00b Mon Sep 17 00:00:00 2001 From: sw-joelmut Date: Wed, 27 Apr 2022 11:39:52 -0300 Subject: [PATCH] Remove 'public' access modifier from botbuilder-dialogs folder --- .../src/choices/choiceFactory.ts | 14 +++--- .../botbuilder-dialogs/src/componentDialog.ts | 16 +++---- .../botbuilder-dialogs/src/configurable.ts | 4 +- libraries/botbuilder-dialogs/src/dialog.ts | 26 +++++----- .../botbuilder-dialogs/src/dialogContainer.ts | 12 ++--- .../botbuilder-dialogs/src/dialogContext.ts | 48 +++++++++---------- .../src/dialogContextError.ts | 4 +- .../botbuilder-dialogs/src/dialogManager.ts | 22 ++++----- libraries/botbuilder-dialogs/src/dialogSet.ts | 16 +++---- .../src/dialogsComponentRegistration.ts | 4 +- .../src/memory/dialogPath.ts | 16 +++---- .../src/memory/dialogStateManager.ts | 28 +++++------ .../memory/pathResolvers/aliasPathResolver.ts | 2 +- .../memory/pathResolvers/atPathResolver.ts | 4 +- .../src/memory/scopes/botStateMemoryScope.ts | 12 ++--- .../src/memory/scopes/classMemoryScope.ts | 4 +- .../memory/scopes/conversationMemoryScope.ts | 2 +- .../memory/scopes/dialogContextMemoryScope.ts | 4 +- .../src/memory/scopes/dialogMemoryScope.ts | 6 +-- .../src/memory/scopes/memoryScope.ts | 16 +++---- .../src/memory/scopes/settingsMemoryScope.ts | 12 ++--- .../src/memory/scopes/thisMemoryScope.ts | 6 +-- .../src/memory/scopes/turnMemoryScope.ts | 6 +-- .../src/memory/scopes/userMemoryScope.ts | 2 +- .../botbuilder-dialogs/src/memory/thisPath.ts | 2 +- .../botbuilder-dialogs/src/memory/turnPath.ts | 24 +++++----- .../src/prompts/activityPrompt.ts | 12 ++--- .../src/prompts/choicePrompt.ts | 12 ++--- .../src/prompts/confirmPrompt.ts | 10 ++-- .../src/prompts/datetimePrompt.ts | 2 +- .../src/prompts/numberPrompt.ts | 4 +- .../src/prompts/oauthPrompt.ts | 12 ++--- .../botbuilder-dialogs/src/prompts/prompt.ts | 8 ++-- .../src/prompts/promptCultureModels.ts | 22 ++++----- .../botbuilder-dialogs/src/recognizer.ts | 8 ++-- .../botbuilder-dialogs/src/skillDialog.ts | 12 ++--- .../botbuilder-dialogs/src/waterfallDialog.ts | 12 ++--- .../src/waterfallStepContext.ts | 14 +++--- 38 files changed, 220 insertions(+), 220 deletions(-) diff --git a/libraries/botbuilder-dialogs/src/choices/choiceFactory.ts b/libraries/botbuilder-dialogs/src/choices/choiceFactory.ts index e69c9404e1..4e638af754 100644 --- a/libraries/botbuilder-dialogs/src/choices/choiceFactory.ts +++ b/libraries/botbuilder-dialogs/src/choices/choiceFactory.ts @@ -90,7 +90,7 @@ export class ChoiceFactory { * @param speak (Optional) SSML to speak for the message. * @param options (Optional) formatting options to use when rendering as a list. */ - public static forChannel( + static forChannel( channelOrContext: string | TurnContext, choices: (string | Choice)[], text?: string, @@ -137,13 +137,13 @@ export class ChoiceFactory { /** * 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. * @param text Optional. Text of the message. * @param speak Optional. SSML text to be spoken by the bot on a speech-enabled channel. * @returns An [Activity](xref:botframework-schema.Activity) with choices as `HeroCard` with buttons. */ - public static heroCard(choices: (string | Choice)[] = [], text = '', speak = ''): Activity { + static heroCard(choices: (string | Choice)[] = [], text = '', speak = ''): Activity { const buttons: CardAction[] = ChoiceFactory.toChoices(choices).map( (choice) => ({ @@ -173,7 +173,7 @@ export class ChoiceFactory { * @param speak (Optional) SSML to speak for the message. * @param options (Optional) formatting options to tweak rendering of list. */ - public static inline( + static inline( choices: (string | Choice)[], text?: string, speak?: string, @@ -223,7 +223,7 @@ export class ChoiceFactory { * @param speak (Optional) SSML to speak for the message. * @param options (Optional) formatting options to tweak rendering of list. */ - public static list( + static list( choices: (string | Choice)[], text?: string, speak?: string, @@ -264,7 +264,7 @@ export class ChoiceFactory { * @param text (Optional) text of the message. * @param speak (Optional) SSML to speak for the message. */ - public static suggestedAction(choices: (string | Choice)[], text?: string, speak?: string): Partial { + static suggestedAction(choices: (string | Choice)[], text?: string, speak?: string): Partial { // Map choices to actions const actions: CardAction[] = ChoiceFactory.toChoices(choices).map((choice: Choice) => { if (choice.action) { @@ -292,7 +292,7 @@ export class ChoiceFactory { * ``` * @param choices List of choices to add. */ - public static toChoices(choices: (string | Choice)[] | undefined): Choice[] { + static toChoices(choices: (string | Choice)[] | undefined): Choice[] { return (choices || []) .map((choice: Choice) => (typeof choice === 'string' ? { value: choice } : choice)) .map((choice: Choice) => { diff --git a/libraries/botbuilder-dialogs/src/componentDialog.ts b/libraries/botbuilder-dialogs/src/componentDialog.ts index 66e5f1cf74..25c711cd40 100644 --- a/libraries/botbuilder-dialogs/src/componentDialog.ts +++ b/libraries/botbuilder-dialogs/src/componentDialog.ts @@ -87,10 +87,10 @@ export class ComponentDialog extends DialogContainer { * @param options Optional, initial information to pass to the dialog. * @returns A Promise representing the asynchronous operation. * @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 { + async beginDialog(outerDC: DialogContext, options?: O): Promise { await this.checkForVersionChange(outerDC); telemetryTrackDialogView(this.telemetryClient, this.id); @@ -127,7 +127,7 @@ export class ComponentDialog extends DialogContainer { * active after the turn has been processed by the dialog. The result may also contain a * return value. */ - public async continueDialog(outerDC: DialogContext): Promise { + async continueDialog(outerDC: DialogContext): Promise { await this.checkForVersionChange(outerDC); // Continue execution of inner dialog. @@ -162,7 +162,7 @@ export class ComponentDialog extends DialogContainer { * If this method is *not* overridden, the dialog automatically calls its * RepromptDialog(ITurnContext, DialogInstance) when the user replies. */ - public async resumeDialog(outerDC: DialogContext, reason: DialogReason, result?: any): Promise { + async resumeDialog(outerDC: DialogContext, reason: DialogReason, result?: any): Promise { await this.checkForVersionChange(outerDC); // Containers are typically leaf nodes on the stack but the dev is free to push other dialogs @@ -181,7 +181,7 @@ export class ComponentDialog extends DialogContainer { * @param instance State information for this dialog. * @returns A Promise representing the asynchronous operation. */ - public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { + async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { // Forward to inner dialogs const innerDC: DialogContext = this.createInnerDC(context, instance); await innerDC.repromptDialog(); @@ -200,7 +200,7 @@ export class ComponentDialog extends DialogContainer { * @remarks When this method is called from the parent dialog's context, the component [Dialog](xref:botbuilder-dialogs.Dialog) * cancels all of the dialogs on its inner dialog stack before ending. */ - public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { + async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { // Forward cancel to inner dialogs if (reason === DialogReason.cancelCalled) { const innerDC: DialogContext = this.createInnerDC(context, instance); @@ -217,7 +217,7 @@ export class ComponentDialog extends DialogContainer { * @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); if (this.initialDialogId === undefined) { this.initialDialogId = dialog.id; @@ -230,7 +230,7 @@ export class ComponentDialog extends DialogContainer { * Creates the inner dialog context * @param outerDC the outer dialog context */ - public createChildContext(outerDC: DialogContext): DialogContext { + createChildContext(outerDC: DialogContext): DialogContext { return this.createInnerDC(outerDC, outerDC.activeDialog); } diff --git a/libraries/botbuilder-dialogs/src/configurable.ts b/libraries/botbuilder-dialogs/src/configurable.ts index 07d9d8c1bf..9401ca061f 100644 --- a/libraries/botbuilder-dialogs/src/configurable.ts +++ b/libraries/botbuilder-dialogs/src/configurable.ts @@ -16,7 +16,7 @@ export abstract class Configurable { * Fluent method for configuring the object. * @param config Configuration settings to apply. */ - public configure(config: Record): this { + configure(config: Record): this { for (const key in config) { if (Object.prototype.hasOwnProperty.call(config, key)) { const setting = config[`${key}`]; @@ -46,7 +46,7 @@ export abstract class Configurable { return this; } - public getConverter(_property: string): Converter | ConverterFactory { + getConverter(_property: string): Converter | ConverterFactory { return undefined; } } diff --git a/libraries/botbuilder-dialogs/src/dialog.ts b/libraries/botbuilder-dialogs/src/dialog.ts index d9e40a8a2d..382d8d3b99 100644 --- a/libraries/botbuilder-dialogs/src/dialog.ts +++ b/libraries/botbuilder-dialogs/src/dialog.ts @@ -237,7 +237,7 @@ export abstract class Dialog extends Configurable { * This result indicates that a dialog (or a logical step within a dialog) has completed * processing for the current turn, is still active, and is waiting for more input. */ - public static EndOfTurn: DialogTurnResult = { status: DialogTurnStatus.waiting }; + static EndOfTurn: DialogTurnResult = { status: DialogTurnStatus.waiting }; /** * The telemetry client for logging events. @@ -250,7 +250,7 @@ export abstract class Dialog extends Configurable { * * @param dialogId Optional. unique ID of the dialog. */ - public constructor(dialogId?: string) { + constructor(dialogId?: string) { super(); this.id = dialogId; } @@ -261,7 +261,7 @@ export abstract class Dialog extends Configurable { * @remarks * This will be automatically generated if not specified. */ - public get id(): string { + get id(): string { if (this._id === undefined) { this._id = this.onComputeId(); } @@ -271,21 +271,21 @@ export abstract class Dialog extends Configurable { /** * Sets the unique ID of the dialog. */ - public set id(value: string) { + set id(value: string) { this._id = value; } /** * Gets the telemetry client for this dialog. */ - public get telemetryClient(): BotTelemetryClient { + get telemetryClient(): BotTelemetryClient { return this._telemetryClient; } /** * Sets the telemetry client for this dialog. */ - public set telemetryClient(client: BotTelemetryClient) { + set telemetryClient(client: BotTelemetryClient) { this._telemetryClient = client ? client : new NullTelemetryClient(); } @@ -300,7 +300,7 @@ export abstract class Dialog extends Configurable { * * Returning an empty string will disable version tracking for the component all together. */ - public getVersion(): string { + getVersion(): string { return this.id; } @@ -324,7 +324,7 @@ export abstract class Dialog extends Configurable { * - [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog) * - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog) */ - public abstract beginDialog(dc: DialogContext, options?: O): Promise; + abstract beginDialog(dc: DialogContext, options?: O): Promise; /** * When overridden in a derived class, continues the dialog. @@ -344,7 +344,7 @@ export abstract class Dialog extends Configurable { * **See also** * - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog) */ - public async continueDialog(dc: DialogContext): Promise { + async continueDialog(dc: DialogContext): Promise { // By default just end the current dialog. return dc.endDialog(); } @@ -374,7 +374,7 @@ export abstract class Dialog extends Configurable { * **See also** * - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) */ - public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { + async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { // By default just end the current dialog and return result to parent. return dc.endDialog(result); } @@ -396,7 +396,7 @@ export abstract class Dialog extends Configurable { * - [DialogContext.repromptDialog](xref:botbuilder-dialogs.DialogContext.repromptDialog) * - [Prompt](xref:botbuilder-dialogs.Prompt) */ - public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { + async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { // No-op by default } @@ -419,7 +419,7 @@ export abstract class Dialog extends Configurable { * - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) * - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog) */ - public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { + async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { // No-op by default } @@ -430,7 +430,7 @@ export abstract class Dialog extends Configurable { * @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 { + async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise { // Before bubble let handled = await this.onPreBubbleEvent(dc, e); diff --git a/libraries/botbuilder-dialogs/src/dialogContainer.ts b/libraries/botbuilder-dialogs/src/dialogContainer.ts index 60150bdc7d..2686f07a96 100644 --- a/libraries/botbuilder-dialogs/src/dialogContainer.ts +++ b/libraries/botbuilder-dialogs/src/dialogContainer.ts @@ -18,20 +18,20 @@ export abstract class DialogContainer extends Dialog { /** * The containers dialog set. */ - 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. */ - public findDialog(dialogId: string): Dialog | undefined { + findDialog(dialogId: string): Dialog | undefined { return this.dialogs.find(dialogId); } @@ -42,7 +42,7 @@ export abstract class DialogContainer extends Dialog { * @param dc The dialog context for the current turn of conversation. * @param e The event being raised. */ - public async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise { + async onDialogEvent(dc: DialogContext, e: DialogEvent): Promise { const handled = await super.onDialogEvent(dc, e); if (!handled && e.name === DialogEvents.versionChanged) { const traceMessage = `Unhandled dialog event: ${e.name}. Active Dialog: ${dc.activeDialog.id}`; @@ -95,7 +95,7 @@ export abstract class DialogContainer extends Dialog { * Set the telemetry client, and also apply it to all child dialogs. * Future dialogs added to the component will also inherit this client. */ - public set telemetryClient(client: BotTelemetryClient) { + set telemetryClient(client: BotTelemetryClient) { this._telemetryClient = client ?? new NullTelemetryClient(); if (this.dialogs.telemetryClient !== this._telemetryClient) { this.dialogs.telemetryClient = this._telemetryClient; @@ -105,7 +105,7 @@ export abstract class DialogContainer extends Dialog { /** * Get the current telemetry client. */ - public get telemetryClient(): BotTelemetryClient { + get telemetryClient(): BotTelemetryClient { return this._telemetryClient; } } diff --git a/libraries/botbuilder-dialogs/src/dialogContext.ts b/libraries/botbuilder-dialogs/src/dialogContext.ts index 76356a9673..4783a252be 100644 --- a/libraries/botbuilder-dialogs/src/dialogContext.ts +++ b/libraries/botbuilder-dialogs/src/dialogContext.ts @@ -81,7 +81,7 @@ export class DialogContext { * @remarks * Passing in a [DialogContext](xref:botbuilder-dialogs.DialogContext) instance will clone the dialog context. */ - 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. @@ -91,7 +91,7 @@ export class DialogContext { * @remarks * Passing in a [DialogContext](xref:botbuilder-dialogs.DialogContext) instance will clone the dialog context. */ - 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. @@ -100,7 +100,7 @@ export class DialogContext { * @param state The state object to use to read and write [DialogState](xref:botbuilder-dialogs.DialogState) to storage. * @remarks Passing in a [DialogContext](xref:botbuilder-dialogs.DialogContext) instance will clone the dialog context. */ - public constructor(dialogs: DialogSet, contextOrDC: TurnContext | DialogContext, state: DialogState) { + constructor(dialogs: DialogSet, contextOrDC: TurnContext | DialogContext, state: DialogState) { this.dialogs = dialogs; if (contextOrDC instanceof DialogContext) { this.context = contextOrDC.context; @@ -124,17 +124,17 @@ export class DialogContext { /** * Gets the dialogs that can be called directly from this context. */ - public dialogs: DialogSet; + dialogs: DialogSet; /** * Gets the context object for the turn. */ - public context: TurnContext; + context: TurnContext; /** * Gets the current dialog stack. */ - public stack: DialogInstance[]; + stack: DialogInstance[]; /** * The parent dialog context for this dialog context, or `undefined` if this context doesn't have a parent. @@ -144,12 +144,12 @@ export class DialogContext { * in its [dialogs](xref:botbuilder-dialogs.DialogContext.dialogs). If the dialog to start is not found * in this dialog context, it searches in its parent dialog context, and so on. */ - public parent: DialogContext | undefined; + parent: DialogContext | undefined; /** * 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; if (instance != undefined) { // Is active dialog a container? @@ -166,26 +166,26 @@ export class DialogContext { * 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; } /** * Gets the DialogStateManager which manages view of all memory scopes. */ - public state: DialogStateManager; + state: DialogStateManager; /** * Gets the services collection which is contextual to this dialog context. */ - 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. */ - public get dialogManager(): DialogManager { + get dialogManager(): DialogManager { return this.context.turnState.get(DialogTurnStateConstants.dialogManager); } @@ -193,7 +193,7 @@ export class DialogContext { * Obtain the CultureInfo in DialogContext. * @returns a locale string. */ - public getLocale(): string { + getLocale(): string { const _turnLocaleProperty = 'turn.locale'; const turnLocaleValue = this.state.getValue(_turnLocaleProperty); @@ -237,7 +237,7 @@ export class DialogContext { * - [replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog) * - [Dialog.beginDialog](xref:botbuilder-dialogs.Dialog.beginDialog) */ - public async beginDialog(dialogId: string, options?: object): Promise { + async beginDialog(dialogId: string, options?: object): Promise { // Lookup dialog const dialog: Dialog<{}> = this.findDialog(dialogId); if (!dialog) { @@ -282,7 +282,7 @@ export class DialogContext { * **See also** * - [endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) */ - public async cancelAllDialogs( + async cancelAllDialogs( cancelParents = false, eventName?: string, eventValue?: any @@ -331,7 +331,7 @@ export class DialogContext { * - [dialogs](xref:botbuilder-dialogs.DialogContext.dialogs) * - [parent](xref:botbuilder-dialogs.DialogContext.parent) */ - public findDialog(dialogId: string): Dialog | undefined { + findDialog(dialogId: string): Dialog | undefined { let dialog = this.dialogs.find(dialogId); if (!dialog && this.parent) { dialog = this.parent.findDialog(dialogId); @@ -356,7 +356,7 @@ export class DialogContext { * return await dc.prompt('confirmPrompt', `Are you sure you'd like to quit?`); * ``` */ - public async prompt( + async prompt( dialogId: string, promptOrOptions: string | Partial | PromptOptions ): Promise; @@ -377,7 +377,7 @@ export class DialogContext { * return await dc.prompt('confirmPrompt', `Are you sure you'd like to quit?`); * ``` */ - public async prompt( + async prompt( dialogId: string, promptOrOptions: string | Partial | PromptOptions, choices: (string | Choice)[] @@ -397,7 +397,7 @@ export class DialogContext { * return await dc.prompt('confirmPrompt', `Are you sure you'd like to quit?`); * ``` */ - public async prompt( + async prompt( dialogId: string, promptOrOptions: string | Partial, choices?: (string | Choice)[] @@ -441,7 +441,7 @@ export class DialogContext { * } * ``` */ - public async continueDialog(): Promise { + async continueDialog(): Promise { // if we are continuing and haven't emitted the activityReceived event, emit it // NOTE: This is backward compatible way for activity received to be fired even if you have legacy dialog loop if (!this.context.turnState.has(ACTIVITY_RECEIVED_EMITTED)) { @@ -502,7 +502,7 @@ export class DialogContext { * - [replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog) * - [Dialog.endDialog](xref:botbuilder-dialogs.Dialog.endDialog) */ - public async endDialog(result?: any): Promise { + async endDialog(result?: any): Promise { // End the active dialog await this.endActiveDialog(DialogReason.endCalled, result); @@ -545,7 +545,7 @@ export class DialogContext { * - [beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog) * - [endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) */ - public async replaceDialog(dialogId: string, options?: object): Promise { + async replaceDialog(dialogId: string, options?: object): Promise { // End the active dialog await this.endActiveDialog(DialogReason.replaceCalled); @@ -564,7 +564,7 @@ export class DialogContext { * await dc.repromptDialog(); * ``` */ - public async repromptDialog(): Promise { + async repromptDialog(): Promise { // Try raising event first const handled = await this.emitEvent(DialogEvents.repromptDialog, undefined, false, false); if (!handled) { @@ -596,7 +596,7 @@ export class DialogContext { * @param fromLeaf Optional. Whether the event is emitted from a leaf node. * @returns `true` if the event was handled. */ - public async emitEvent(name: string, value?: any, bubble = true, fromLeaf = false): Promise { + async emitEvent(name: string, value?: any, bubble = true, fromLeaf = false): Promise { // Initialize event const dialogEvent: DialogEvent = { bubble: bubble, diff --git a/libraries/botbuilder-dialogs/src/dialogContextError.ts b/libraries/botbuilder-dialogs/src/dialogContextError.ts index e36e3fb376..279f6bafff 100644 --- a/libraries/botbuilder-dialogs/src/dialogContextError.ts +++ b/libraries/botbuilder-dialogs/src/dialogContextError.ts @@ -12,7 +12,7 @@ export class DialogContextError extends Error { /** * Represents the state of a dialog when an error occurred. */ - public readonly dialogContext: { + readonly dialogContext: { activeDialog?: string; parent?: string; stack: DialogInstance[]; @@ -24,7 +24,7 @@ export class DialogContextError extends Error { * @param {Error | string} error Source error or error message. * @param {DialogContext} dialogContext Dialog context that is the source of the error. */ - public constructor(public readonly error: Error | string, dialogContext: DialogContext) { + constructor(public readonly error: Error | string, dialogContext: DialogContext) { super(); if (!(error instanceof Error) && typeof error !== 'string') { diff --git a/libraries/botbuilder-dialogs/src/dialogManager.ts b/libraries/botbuilder-dialogs/src/dialogManager.ts index 6a5885442e..e4d635bc1e 100644 --- a/libraries/botbuilder-dialogs/src/dialogManager.ts +++ b/libraries/botbuilder-dialogs/src/dialogManager.ts @@ -75,7 +75,7 @@ export class DialogManager extends Configurable { * @param rootDialog Optional, root [Dialog](xref:botbuilder-dialogs.Dialog) to use. * @param dialogStateProperty Optional, alternate name for the dialogState property. (Default is "DialogStateProperty") */ - public constructor(rootDialog?: Dialog, dialogStateProperty?: string) { + constructor(rootDialog?: Dialog, dialogStateProperty?: string) { super(); if (rootDialog) { this.rootDialog = rootDialog; @@ -87,24 +87,24 @@ export class DialogManager extends Configurable { /** * Bots persisted conversation state. */ - public conversationState: ConversationState; + conversationState: ConversationState; /** * Optional. Bots persisted user state. */ - public userState?: UserState; + userState?: UserState; /** * Values that will be copied to the `TurnContext.turnState` at the beginning of each turn. */ - public get initialTurnState(): TurnContextStateCollection { + get initialTurnState(): TurnContextStateCollection { return this._initialTurnState; } /** * Root dialog to start from [onTurn()](#onturn) method. */ - public set rootDialog(value: Dialog) { + set rootDialog(value: Dialog) { this.dialogs = new DialogSet(); if (value) { this._rootDialogId = value.id; @@ -121,24 +121,24 @@ export class DialogManager extends Configurable { * * @returns The root [Dialog](xref:botbuilder-dialogs.Dialog) ID. */ - public get rootDialog(): Dialog { + get rootDialog(): Dialog { return this._rootDialogId ? this.dialogs.find(this._rootDialogId) : undefined; } /** * Global dialogs that you want to have be callable. */ - public dialogs: DialogSet = new DialogSet(); + dialogs: DialogSet = new DialogSet(); /** * Optional. Path resolvers and memory scopes used for conversations with the bot. */ - public stateConfiguration?: DialogStateManagerConfiguration; + stateConfiguration?: DialogStateManagerConfiguration; /** * Optional. Number of milliseconds to expire the bots conversation state after. */ - public expireAfter?: number; + expireAfter?: number; /** * Set configuration settings. @@ -146,7 +146,7 @@ export class DialogManager extends Configurable { * @param config Configuration settings to apply. * @returns The cofigured [DialogManager](xref:botbuilder-dialogs.DialogManager) context. */ - public configure(config: Partial): this { + configure(config: Partial): this { return super.configure(config); } @@ -156,7 +156,7 @@ export class DialogManager extends Configurable { * @param context [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation with the user. * @returns Result of running the logic against the activity. */ - public async onTurn(context: TurnContext): Promise { + async onTurn(context: TurnContext): Promise { // Ensure properly configured if (!this._rootDialogId) { throw new Error(`DialogManager.onTurn: the bot's 'rootDialog' has not been configured.`); diff --git a/libraries/botbuilder-dialogs/src/dialogSet.ts b/libraries/botbuilder-dialogs/src/dialogSet.ts index 20e96d205e..5451719b76 100644 --- a/libraries/botbuilder-dialogs/src/dialogSet.ts +++ b/libraries/botbuilder-dialogs/src/dialogSet.ts @@ -88,7 +88,7 @@ export class DialogSet { * ``` * @param dialogState (Optional) state property used to persist the sets dialog stack. */ - public constructor(dialogState?: StatePropertyAccessor) { + constructor(dialogState?: StatePropertyAccessor) { this.dialogState = dialogState; } @@ -98,7 +98,7 @@ export class DialogSet { * @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) { let versions = ''; for (const id in this.dialogs) { @@ -124,7 +124,7 @@ export class DialogSet { * @param dialog The dialog or prompt to add. * If a telemetryClient is present on the dialog set, it will be added to each dialog. */ - public add(dialog: T): this { + add(dialog: T): this { if (!(dialog instanceof Dialog)) { throw new Error(`DialogSet.add(): Invalid dialog being added.`); } @@ -176,7 +176,7 @@ export class DialogSet { * 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. */ - public async createContext(context: TurnContext): Promise { + async createContext(context: TurnContext): Promise { if (!this.dialogState) { throw new Error( `DialogSet.createContext(): the dialog set was not bound to a stateProperty when constructed.` @@ -198,14 +198,14 @@ export class DialogSet { * ``` * @param dialogId ID of the dialog or prompt to lookup. */ - public find(dialogId: string): Dialog | undefined { + find(dialogId: string): Dialog | undefined { return this.dialogs.hasOwnProperty(dialogId) ? this.dialogs[dialogId] : undefined; } /** * Set the telemetry client for this dialog set and apply it to all current dialogs. */ - public get telemetryClient(): BotTelemetryClient { + get telemetryClient(): BotTelemetryClient { return this._telemetryClient; } @@ -213,7 +213,7 @@ export class DialogSet { * Set the telemetry client for this dialog set and apply it to all current dialogs. * Future dialogs added to the set will also inherit this client. */ - public set telemetryClient(client: BotTelemetryClient) { + set telemetryClient(client: BotTelemetryClient) { this._telemetryClient = client ?? new NullTelemetryClient(); Object.values(this.dialogs).forEach((dialog) => (dialog.telemetryClient = this._telemetryClient)); } @@ -223,7 +223,7 @@ export class DialogSet { * * @returns {Dialog} An array of [Dialog](xref:botbuilder-dialogs.Dialog). */ - public getDialogs(): Dialog[] { + getDialogs(): Dialog[] { return Object.values(this.dialogs); } } diff --git a/libraries/botbuilder-dialogs/src/dialogsComponentRegistration.ts b/libraries/botbuilder-dialogs/src/dialogsComponentRegistration.ts index 9d7a077f23..c1d6f87c15 100644 --- a/libraries/botbuilder-dialogs/src/dialogsComponentRegistration.ts +++ b/libraries/botbuilder-dialogs/src/dialogsComponentRegistration.ts @@ -33,7 +33,7 @@ export class DialogsComponentRegistration * * @returns {MemoryScope[]} A list of [MemoryScope](xref:botbuilder-dialogs.MemoryScope). */ - public getMemoryScopes(): MemoryScope[] { + getMemoryScopes(): MemoryScope[] { return this.services.mustMakeInstance('memoryScopes'); } @@ -42,7 +42,7 @@ export class DialogsComponentRegistration * * @returns {PathResolver[]} A list of [PathResolver](xref:botbuilder-dialogs.PathResolver). */ - public getPathResolvers(): PathResolver[] { + getPathResolvers(): PathResolver[] { return this.services.mustMakeInstance('pathResolvers'); } } diff --git a/libraries/botbuilder-dialogs/src/memory/dialogPath.ts b/libraries/botbuilder-dialogs/src/memory/dialogPath.ts index 1c29fad7da..4e9b1482ce 100644 --- a/libraries/botbuilder-dialogs/src/memory/dialogPath.ts +++ b/libraries/botbuilder-dialogs/src/memory/dialogPath.ts @@ -11,26 +11,26 @@ */ export class DialogPath { /// 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'; } diff --git a/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts b/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts index d9ed99b303..7d7f49604a 100644 --- a/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts +++ b/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts @@ -48,7 +48,7 @@ export class DialogStateManager { * @param dc The dialog context for the current turn of the conversation. * @param configuration Configuration for the dialog state manager. */ - public constructor(dc: DialogContext, configuration?: DialogStateManagerConfiguration) { + constructor(dc: DialogContext, configuration?: DialogStateManagerConfiguration) { ComponentRegistration.add(new DialogsComponentRegistration()); this.dialogContext = dc; @@ -92,7 +92,7 @@ export class DialogStateManager { * Assigning a new configuration to any DialogStateManager within the chain will update the * configuration for the entire chain. */ - public configuration: DialogStateManagerConfiguration; + configuration: DialogStateManagerConfiguration; /** * Get the value from memory using path expression. @@ -104,7 +104,7 @@ export class DialogStateManager { * @param defaultValue (Optional) default value to use if the path isn't found. May be a function that returns the default value to use. * @returns The found value or undefined if not found and no `defaultValue` specified. */ - public getValue(pathExpression: string, defaultValue?: T | (() => T)): T { + getValue(pathExpression: string, defaultValue?: T | (() => T)): T { function returnDefault(): T { return typeof defaultValue == 'function' ? (defaultValue as Function)() : defaultValue; } @@ -133,7 +133,7 @@ export class DialogStateManager { * @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 const tpath = this.transformPath(pathExpression); const segments = this.parsePath(tpath); @@ -198,7 +198,7 @@ export class DialogStateManager { * Delete property from memory * @param path The leaf property to remove. */ - public deleteValue(pathExpression: string): void { + deleteValue(pathExpression: string): void { // Get path segments const tpath = this.transformPath(pathExpression); const segments = this.parsePath(tpath); @@ -238,7 +238,7 @@ export class DialogStateManager { * @remarks * This should be called at the beginning of the turn. */ - public async loadAllScopes(): Promise { + async loadAllScopes(): Promise { const scopes = this.configuration.memoryScopes; for (let i = 0; i < scopes.length; i++) { await scopes[i].load(this.dialogContext); @@ -251,7 +251,7 @@ export class DialogStateManager { * @remarks * This should be called at the end of the turn. */ - public async saveAllChanges(): Promise { + async saveAllChanges(): Promise { const scopes = this.configuration.memoryScopes; for (let i = 0; i < scopes.length; i++) { await scopes[i].saveChanges(this.dialogContext); @@ -261,7 +261,7 @@ export class DialogStateManager { /** * Deletes all of the backing memory for a given scope. */ - public async deleteScopesMemory(name: string): Promise { + async deleteScopesMemory(name: string): Promise { name = name.toLowerCase(); const scopes = this.configuration.memoryScopes; for (let i = 0; i < scopes.length; i++) { @@ -282,7 +282,7 @@ export class DialogStateManager { * @param allowNestedPaths Optional. If `false` then detection of a nested path will cause an empty path to be returned. Defaults to 'true'. * @returns The normalized path. */ - public parsePath(pathExpression: string, allowNestedPaths = true): (string | number)[] { + parsePath(pathExpression: string, allowNestedPaths = true): (string | number)[] { // Expand path segments let segment = ''; let depth = 0; @@ -400,7 +400,7 @@ export class DialogStateManager { * @param pathExpression The path to transform. * @returns The transformed path. */ - public transformPath(pathExpression: string): string { + transformPath(pathExpression: string): string { // Run path through registered resolvers. const resolvers = this.configuration.pathResolvers; for (let i = 0; i < resolvers.length; i++) { @@ -414,7 +414,7 @@ export class DialogStateManager { * Gets all memory scopes suitable for logging. * @returns Object which represents all memory scopes. */ - public getMemorySnapshot(): object { + getMemorySnapshot(): object { const output = {}; this.configuration.memoryScopes.forEach((scope) => { if (scope.includeInSnapshot) { @@ -430,7 +430,7 @@ export class DialogStateManager { * @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[] = []; paths.forEach((path) => { const tpath = this.transformPath(path); @@ -454,7 +454,7 @@ export class DialogStateManager { * @param paths Paths from [trackPaths()](#trackpaths) to check. * @returns True if any path has changed since counter. */ - public anyPathChanged(counter: number, paths: string[]): boolean { + anyPathChanged(counter: number, paths: string[]): boolean { let found = false; if (paths) { for (let i = 0; i < paths.length; i++) { @@ -611,7 +611,7 @@ export class DialogStateManager { * Gets the version number. * @returns A string with the version number. */ - public version(): string { + version(): string { return '0'; } } diff --git a/libraries/botbuilder-dialogs/src/memory/pathResolvers/aliasPathResolver.ts b/libraries/botbuilder-dialogs/src/memory/pathResolvers/aliasPathResolver.ts index 19aa22b5e2..9d64247f18 100644 --- a/libraries/botbuilder-dialogs/src/memory/pathResolvers/aliasPathResolver.ts +++ b/libraries/botbuilder-dialogs/src/memory/pathResolvers/aliasPathResolver.ts @@ -32,7 +32,7 @@ export class AliasPathResolver implements PathResolver { * @param path Path to inspect. * @returns The transformed path. */ - public transformPath(path: string): string { + transformPath(path: string): string { const start = path.indexOf(this.alias); if (start == 0) { // here we only deals with trailing alias, alias in middle be handled in further breakdown diff --git a/libraries/botbuilder-dialogs/src/memory/pathResolvers/atPathResolver.ts b/libraries/botbuilder-dialogs/src/memory/pathResolvers/atPathResolver.ts index 5362b12b15..99f3fd8d59 100644 --- a/libraries/botbuilder-dialogs/src/memory/pathResolvers/atPathResolver.ts +++ b/libraries/botbuilder-dialogs/src/memory/pathResolvers/atPathResolver.ts @@ -17,7 +17,7 @@ export class AtPathResolver extends AliasPathResolver { /** * Initializes a new instance of the [AtPathResolver](xref:botbuilder-dialogs.AtPathResolver) class. */ - public constructor() { + constructor() { super('@', ''); } @@ -26,7 +26,7 @@ export class AtPathResolver extends AliasPathResolver { * @param path Path to inspect. * @returns The transformed path. */ - public transformPath(path: string): string { + transformPath(path: string): string { path = path.trim(); if (path.startsWith('@') && path.length > 1 && !path.startsWith('@@')) { let end = -1; diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/botStateMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/botStateMemoryScope.ts index d2dd938ba5..a798df60a7 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/botStateMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/botStateMemoryScope.ts @@ -19,7 +19,7 @@ export class BotStateMemoryScope extends MemoryScope { * 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); } @@ -27,7 +27,7 @@ export class BotStateMemoryScope extends MemoryScope { * Get the backing memory for this scope. * @param dc current dialog context */ - public getMemory(dc: DialogContext): object { + getMemory(dc: DialogContext): object { const botState: BotState = dc.context.turnState.get(this.stateKey); if (botState) { return botState.get(dc.context); @@ -41,7 +41,7 @@ export class BotStateMemoryScope extends MemoryScope { * @param dc current dialog context * @param memory memory */ - public setMemory(dc: DialogContext, memory: object): void { + setMemory(dc: DialogContext, memory: object): void { const botState = dc.context.turnState.get(this.stateKey); if (!botState) { throw new Error(`${this.stateKey} is not available.`); @@ -56,7 +56,7 @@ export class BotStateMemoryScope extends MemoryScope { * or `false` to load state from storage only if the cache doesn't already exist. * @returns A Promise that represents the work queued to execute. */ - public async load(dc: DialogContext, force = false): Promise { + async load(dc: DialogContext, force = false): Promise { const botState: BotState = dc.context.turnState.get(this.stateKey); if (botState) { await botState.load(dc.context, force); @@ -70,7 +70,7 @@ export class BotStateMemoryScope extends MemoryScope { * or `false` to save state to storage only if a property in the cache has changed. * @returns A Promise that represents the work queued to execute. */ - public async saveChanges(dc: DialogContext, force = false): Promise { + async saveChanges(dc: DialogContext, force = false): Promise { const botState: BotState = dc.context.turnState.get(this.stateKey); if (botState) { await botState.saveChanges(dc.context, force); @@ -82,7 +82,7 @@ export class BotStateMemoryScope extends MemoryScope { * @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 { + async delete(dc: DialogContext): Promise { return Promise.resolve(); } } diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/classMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/classMemoryScope.ts index 2c2178933a..350ec3213a 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/classMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/classMemoryScope.ts @@ -18,7 +18,7 @@ export class ClassMemoryScope extends MemoryScope { * 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); } @@ -27,7 +27,7 @@ export class ClassMemoryScope extends MemoryScope { * @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 if (dc.activeDialog) { const dialog = this.onFindDialog(dc); diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/conversationMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/conversationMemoryScope.ts index 26c5f863ac..295045a172 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/conversationMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/conversationMemoryScope.ts @@ -16,7 +16,7 @@ export class ConversationMemoryScope extends BotStateMemoryScope { /** * Initializes a new instance of the [ConversationMemoryScope](xref:botbuilder-dialogs.ConversationMemoryScope) class. */ - public constructor() { + constructor() { super(ScopePath.conversation); } } diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/dialogContextMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/dialogContextMemoryScope.ts index 93f339b3b0..bc39e395f4 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/dialogContextMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/dialogContextMemoryScope.ts @@ -17,7 +17,7 @@ export class DialogContextMemoryScope extends MemoryScope { /** * Initializes a new instance of the `DialogContextMemoryScope` class. */ - public constructor() { + constructor() { super(ScopePath.dialogContext, false); } @@ -26,7 +26,7 @@ export class DialogContextMemoryScope extends MemoryScope { * @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 = []; let currentDc = dc; diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/dialogMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/dialogMemoryScope.ts index b3bc19ad11..5b4d01a649 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/dialogMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/dialogMemoryScope.ts @@ -17,7 +17,7 @@ export class DialogMemoryScope extends MemoryScope { /** * Initializes a new instance of the [DialogMemoryScope](xref:botbuilder-dialogs.DialogMemoryScope) class. */ - public constructor() { + constructor() { super(ScopePath.dialog); } @@ -26,7 +26,7 @@ export class DialogMemoryScope extends MemoryScope { * @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. // Otherwise the "dialog" will bind to the dialogs parent assuming it // is a container. @@ -44,7 +44,7 @@ export class DialogMemoryScope extends MemoryScope { * @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.`); } diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/memoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/memoryScope.ts index 7de0f70126..f119727baa 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/memoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/memoryScope.ts @@ -17,7 +17,7 @@ export abstract class MemoryScope { * @param includeInSnapshot Boolean value indicating whether this memory * should be included in snapshot. Default value is true. */ - public constructor(name: string, includeInSnapshot = true) { + constructor(name: string, includeInSnapshot = true) { this.includeInSnapshot = includeInSnapshot; this.name = name; } @@ -25,26 +25,26 @@ export abstract class MemoryScope { /** * Gets or sets name of the scope */ - public readonly name: string; + readonly name: string; /** * Gets a value indicating whether this memory should be included in snapshot. */ - 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 */ - 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.`); } @@ -52,7 +52,7 @@ export abstract class MemoryScope { * Loads a scopes backing memory at the start of a turn. * @param dc Current dialog context. */ - public async load(dc: DialogContext): Promise { + async load(dc: DialogContext): Promise { // No initialization by default. } @@ -60,7 +60,7 @@ export abstract class MemoryScope { * Saves a scopes backing memory at the end of a turn. * @param dc Current dialog context. */ - public async saveChanges(dc: DialogContext): Promise { + async saveChanges(dc: DialogContext): Promise { // No initialization by default. } @@ -68,7 +68,7 @@ export abstract class MemoryScope { * Deletes the backing memory for a scope. * @param dc Current dialog context. */ - public async delete(dc: DialogContext): Promise { + async delete(dc: DialogContext): Promise { throw new Error(`MemoryScope.delete: The '${this.name}' memory scope can't be deleted.`); } } diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/settingsMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/settingsMemoryScope.ts index 63aa198b87..a03b533d60 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/settingsMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/settingsMemoryScope.ts @@ -20,19 +20,19 @@ class Node { * * @param {string} value Value of the node. If the node is not leaf, value represents the current path. */ - public constructor(public value?: string) {} + constructor(public value?: string) {} /** * The child nodes of the node. */ - public children: Node[] = []; + children: Node[] = []; /** * Indicates if the node is leaf node. * * @returns {boolean} If the node is leaf node or not. */ - public isLeaf(): boolean { + isLeaf(): boolean { return this.children.length === 0; } } @@ -59,7 +59,7 @@ export class SettingsMemoryScope extends MemoryScope { * * @param initialSettings initial set of settings to supply */ - public constructor(private readonly initialSettings?: Record) { + constructor(private readonly initialSettings?: Record) { super(ScopePath.settings, false); } @@ -69,7 +69,7 @@ export class SettingsMemoryScope extends MemoryScope { * @param {DialogContext} dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) object for this turn. * @returns {Record} The memory for the scope. */ - public getMemory(dc: DialogContext): Record { + getMemory(dc: DialogContext): Record { if (dc.context.turnState.has(ScopePath.settings)) { return dc.context.turnState.get(ScopePath.settings) ?? {}; } @@ -87,7 +87,7 @@ export class SettingsMemoryScope extends MemoryScope { return settings; } - public async load(dc: DialogContext): Promise { + async load(dc: DialogContext): Promise { if (this.initialSettings) { // filter initialSettings const filteredSettings = SettingsMemoryScope.filterSettings(this.initialSettings); diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/thisMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/thisMemoryScope.ts index 94dd38cadd..003882a191 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/thisMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/thisMemoryScope.ts @@ -16,7 +16,7 @@ export class ThisMemoryScope extends MemoryScope { /** * Initializes a new instance of the [ThisMemoryScope](xref:botbuilder-dialogs.ThisMemoryScope) class. */ - public constructor() { + constructor() { super(ScopePath.this); } @@ -25,7 +25,7 @@ export class ThisMemoryScope extends MemoryScope { * @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; } @@ -34,7 +34,7 @@ export class ThisMemoryScope extends MemoryScope { * @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.`); } diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/turnMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/turnMemoryScope.ts index 417d26aeac..2783ab9801 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/turnMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/turnMemoryScope.ts @@ -21,7 +21,7 @@ export class TurnMemoryScope extends MemoryScope { /** * Initializes a new instance of the [TurnMemoryScope](xref:botbuilder-dialogs.TurnMemoryScope) class. */ - public constructor() { + constructor() { super(ScopePath.turn, true); } @@ -30,7 +30,7 @@ export class TurnMemoryScope extends MemoryScope { * @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); if (typeof memory != 'object') { memory = {}; @@ -45,7 +45,7 @@ export class TurnMemoryScope extends MemoryScope { * @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.`); } diff --git a/libraries/botbuilder-dialogs/src/memory/scopes/userMemoryScope.ts b/libraries/botbuilder-dialogs/src/memory/scopes/userMemoryScope.ts index 350483aa09..1c0b9588a0 100644 --- a/libraries/botbuilder-dialogs/src/memory/scopes/userMemoryScope.ts +++ b/libraries/botbuilder-dialogs/src/memory/scopes/userMemoryScope.ts @@ -16,7 +16,7 @@ export class UserMemoryScope extends BotStateMemoryScope { /** * Initializes a new instance of the [UserMemoryScope](xref:botbuilder-dialogs.UserMemoryScope) class. */ - public constructor() { + constructor() { super(ScopePath.user); } } diff --git a/libraries/botbuilder-dialogs/src/memory/thisPath.ts b/libraries/botbuilder-dialogs/src/memory/thisPath.ts index 0f782fd65b..83bf0e3c88 100644 --- a/libraries/botbuilder-dialogs/src/memory/thisPath.ts +++ b/libraries/botbuilder-dialogs/src/memory/thisPath.ts @@ -13,5 +13,5 @@ export class ThisPath { /** * The options that were passed to the active dialog via options argument of BeginDialog. */ - public static readonly options = 'this.options'; + static readonly options = 'this.options'; } diff --git a/libraries/botbuilder-dialogs/src/memory/turnPath.ts b/libraries/botbuilder-dialogs/src/memory/turnPath.ts index bf7eaf40f3..497618c48a 100644 --- a/libraries/botbuilder-dialogs/src/memory/turnPath.ts +++ b/libraries/botbuilder-dialogs/src/memory/turnPath.ts @@ -11,38 +11,38 @@ */ export class TurnPath { /// 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'; } diff --git a/libraries/botbuilder-dialogs/src/prompts/activityPrompt.ts b/libraries/botbuilder-dialogs/src/prompts/activityPrompt.ts index 74d804a3f2..10715027eb 100644 --- a/libraries/botbuilder-dialogs/src/prompts/activityPrompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/activityPrompt.ts @@ -35,11 +35,11 @@ export class ActivityPrompt extends Dialog { * @param options [PromptOptions](xref:botbuilder-dialogs.PromptOptions), additional * information to pass to the prompt being started. * @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 { + async beginDialog(dc: DialogContext, options: PromptOptions): Promise { // Ensure prompts have input hint set const opt: Partial = { ...options }; if (opt.prompt && typeof opt.prompt === 'object' && typeof opt.prompt.inputHint !== 'string') { @@ -71,7 +71,7 @@ export class ActivityPrompt extends Dialog { * The prompt generally continues to receive the user's replies until it accepts the * user's reply as valid input for the prompt. */ - public async continueDialog(dc: DialogContext): Promise { + async continueDialog(dc: DialogContext): Promise { // Perform base recognition const state: any = dc.activeDialog.state as ActivityPromptState; const recognized: PromptRecognizerResult = await this.onRecognize( @@ -118,7 +118,7 @@ export class ActivityPrompt extends Dialog { * 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 { + async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { // Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs // on top of the stack which will result in the prompt receiving an unexpected call to // resumeDialog() when the pushed on dialog ends. @@ -137,11 +137,11 @@ export class ActivityPrompt extends Dialog { * of the dialog on the stack. * @returns A `Promise` representing the asynchronous operation. */ - public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { + async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { 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 diff --git a/libraries/botbuilder-dialogs/src/prompts/choicePrompt.ts b/libraries/botbuilder-dialogs/src/prompts/choicePrompt.ts index 5d7f9b09ee..93874ea927 100644 --- a/libraries/botbuilder-dialogs/src/prompts/choicePrompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/choicePrompt.ts @@ -32,7 +32,7 @@ export class ChoicePrompt extends Prompt { /** * The prompts default locale that should be recognized. */ - public defaultLocale: string | undefined; + defaultLocale: string | undefined; /** * Style of the "yes" and "no" choices rendered to the user when prompting. @@ -40,18 +40,18 @@ export class ChoicePrompt extends Prompt { * @remarks * Defaults to `ListStyle.auto`. */ - public style: ListStyle; + style: ListStyle; /** * Additional options passed to the `ChoiceFactory` and used to tweak the style of choices * rendered to the user. */ - public choiceOptions: ChoiceFactoryOptions | undefined; + choiceOptions: ChoiceFactoryOptions | undefined; /** * Additional options passed to the underlying `recognizeChoices()` function. */ - public recognizerOptions: FindChoicesOptions | undefined; + recognizerOptions: FindChoicesOptions | undefined; /** * Creates a new `ChoicePrompt` instance. @@ -61,7 +61,7 @@ export class ChoicePrompt extends Prompt { * @param choiceDefaults (Optional) Overrides the dictionary of Bot Framework SDK-supported _choiceDefaults (for prompt localization). * Must be passed in to each ConfirmPrompt that needs the custom choice defaults. */ - public constructor( + constructor( dialogId: string, validator?: PromptValidator, defaultLocale?: string, @@ -127,7 +127,7 @@ export class ChoicePrompt extends Prompt { /** * 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. * @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 diff --git a/libraries/botbuilder-dialogs/src/prompts/confirmPrompt.ts b/libraries/botbuilder-dialogs/src/prompts/confirmPrompt.ts index 6d12d67363..e1a4ddc79e 100644 --- a/libraries/botbuilder-dialogs/src/prompts/confirmPrompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/confirmPrompt.ts @@ -33,7 +33,7 @@ export class ConfirmPrompt extends Prompt { /** * The prompts default locale that should be recognized. */ - public defaultLocale: string | undefined; + defaultLocale: string | undefined; /** * Style of the "yes" and "no" choices rendered to the user when prompting. @@ -41,18 +41,18 @@ export class ConfirmPrompt extends Prompt { * @remarks * Defaults to `ListStyle.auto`. */ - public style: ListStyle; + style: ListStyle; /** * Additional options passed to the `ChoiceFactory` and used to tweak the style of choices * rendered to the user. */ - public choiceOptions: ChoiceFactoryOptions | undefined; + choiceOptions: ChoiceFactoryOptions | undefined; /** * Custom list of choices to send for the prompt. */ - public confirmChoices: (string | Choice)[] | undefined; + confirmChoices: (string | Choice)[] | undefined; /** * Creates a new ConfirmPrompt instance. @@ -60,7 +60,7 @@ export class ConfirmPrompt extends Prompt { * @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`. */ - public constructor( + constructor( dialogId: string, validator?: PromptValidator, defaultLocale?: string, diff --git a/libraries/botbuilder-dialogs/src/prompts/datetimePrompt.ts b/libraries/botbuilder-dialogs/src/prompts/datetimePrompt.ts index 888dc94e55..626451c361 100644 --- a/libraries/botbuilder-dialogs/src/prompts/datetimePrompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/datetimePrompt.ts @@ -41,7 +41,7 @@ export class DateTimePrompt extends Prompt { /** * The prompts default locale that should be recognized. */ - public defaultLocale: string | undefined; + defaultLocale: string | undefined; /** * Creates a new DateTimePrompt instance. diff --git a/libraries/botbuilder-dialogs/src/prompts/numberPrompt.ts b/libraries/botbuilder-dialogs/src/prompts/numberPrompt.ts index 3f1e206930..c09dcb2948 100644 --- a/libraries/botbuilder-dialogs/src/prompts/numberPrompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/numberPrompt.ts @@ -24,7 +24,7 @@ export class NumberPrompt extends Prompt { /** * The prompts default locale that should be recognized. */ - public defaultLocale?: string; + defaultLocale?: string; /** * Creates a new NumberPrompt instance. @@ -39,7 +39,7 @@ export class NumberPrompt extends 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. * @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 diff --git a/libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts b/libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts index 6ef545e736..d5504e6b36 100644 --- a/libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts @@ -187,7 +187,7 @@ export class OAuthPrompt extends Dialog { * If the task 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 { + async beginDialog(dc: DialogContext, options?: PromptOptions): Promise { // Ensure prompts have input hint set const o: Partial = { ...options }; if (o.prompt && typeof o.prompt === 'object' && typeof o.prompt.inputHint !== 'string') { @@ -228,7 +228,7 @@ export class OAuthPrompt extends Dialog { * The prompt generally continues to receive the user's replies until it accepts the * user's reply as valid input for the prompt. */ - public async continueDialog(dc: DialogContext): Promise { + async continueDialog(dc: DialogContext): Promise { // Check for timeout const state: OAuthPromptState = dc.activeDialog.state as OAuthPromptState; const isMessage: boolean = dc.context.activity.type === ActivityTypes.Message; @@ -288,7 +288,7 @@ export class OAuthPrompt extends Dialog { * @param context Context reference the user that's being looked up. * @param code (Optional) login code received from the user. */ - public async getUserToken(context: TurnContext, code?: string): Promise { + async getUserToken(context: TurnContext, code?: string): Promise { return UserTokenAccess.getUserToken(context, this.settings, code); } @@ -307,7 +307,7 @@ export class OAuthPrompt extends Dialog { * ``` * @param context Context referencing the user that's being signed out. */ - public async signOutUser(context: TurnContext): Promise { + async signOutUser(context: TurnContext): Promise { return UserTokenAccess.signOutUser(context, this.settings); } @@ -318,7 +318,7 @@ export class OAuthPrompt extends Dialog { * @param {TurnContext} turnContext Turn context. * @param {string | Partial} prompt Message activity. */ - public static async sendOAuthCard( + static async sendOAuthCard( settings: OAuthPromptSettings, turnContext: TurnContext, prompt?: string | Partial @@ -400,7 +400,7 @@ export class OAuthPrompt extends Dialog { * @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of the conversation. * @returns A Promise that resolves to the result */ - public async recognizeToken(dc: DialogContext): Promise> { + async recognizeToken(dc: DialogContext): Promise> { const context = dc.context; let token: TokenResponse | undefined; diff --git a/libraries/botbuilder-dialogs/src/prompts/prompt.ts b/libraries/botbuilder-dialogs/src/prompts/prompt.ts index 1c982a91e8..5f86f1d514 100644 --- a/libraries/botbuilder-dialogs/src/prompts/prompt.ts +++ b/libraries/botbuilder-dialogs/src/prompts/prompt.ts @@ -185,7 +185,7 @@ export abstract class Prompt extends Dialog { * If the task 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 { + async beginDialog(dc: DialogContext, options: PromptOptions): Promise { // Ensure prompts have input hint set const opt: Partial = { ...options }; if (opt.prompt && typeof opt.prompt === 'object' && typeof opt.prompt.inputHint !== 'string') { @@ -216,7 +216,7 @@ export abstract class Prompt extends Dialog { * The prompt generally continues to receive the user's replies until it accepts the * user's reply as valid input for the prompt. */ - public async continueDialog(dc: DialogContext): Promise { + async continueDialog(dc: DialogContext): Promise { // Don't do anything for non-message activities if (dc.context.activity.type !== ActivityTypes.Message) { return Dialog.EndOfTurn; @@ -302,7 +302,7 @@ export abstract class Prompt extends Dialog { * 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 resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { + async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { // Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs // on top of the stack which will result in the prompt receiving an unexpected call to // resumeDialog() when the pushed on dialog ends. @@ -321,7 +321,7 @@ export abstract class Prompt extends Dialog { * of the dialog on the stack. * @returns A `Promise` representing the asynchronous operation. */ - public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { + async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { const state: PromptState = instance.state as PromptState; await this.onPrompt(context, state.state, state.options, false); } diff --git a/libraries/botbuilder-dialogs/src/prompts/promptCultureModels.ts b/libraries/botbuilder-dialogs/src/prompts/promptCultureModels.ts index 412a9bb1eb..295238fc85 100644 --- a/libraries/botbuilder-dialogs/src/prompts/promptCultureModels.ts +++ b/libraries/botbuilder-dialogs/src/prompts/promptCultureModels.ts @@ -43,7 +43,7 @@ export interface PromptCultureModel { * Class container for currently-supported Culture Models in Confirm and Choice Prompt. */ export class PromptCultureModels { - public static Chinese: PromptCultureModel = { + static Chinese: PromptCultureModel = { locale: Culture.Chinese, separator: ', ', inlineOr: ' 要么 ', @@ -52,7 +52,7 @@ export class PromptCultureModels { noInLanguage: '不', }; - public static Dutch: PromptCultureModel = { + static Dutch: PromptCultureModel = { locale: Culture.Dutch, separator: ', ', inlineOr: ' of ', @@ -61,7 +61,7 @@ export class PromptCultureModels { noInLanguage: 'Nee', }; - public static English: PromptCultureModel = { + static English: PromptCultureModel = { locale: Culture.English, separator: ', ', inlineOr: ' or ', @@ -70,7 +70,7 @@ export class PromptCultureModels { noInLanguage: 'No', }; - public static French: PromptCultureModel = { + static French: PromptCultureModel = { locale: Culture.French, separator: ', ', inlineOr: ' ou ', @@ -79,7 +79,7 @@ export class PromptCultureModels { noInLanguage: 'Non', }; - public static German: PromptCultureModel = { + static German: PromptCultureModel = { locale: Culture.German, separator: ', ', inlineOr: ' oder ', @@ -88,7 +88,7 @@ export class PromptCultureModels { noInLanguage: 'Nein', }; - public static Italian: PromptCultureModel = { + static Italian: PromptCultureModel = { locale: Culture.Italian, separator: ', ', inlineOr: ' o ', @@ -97,7 +97,7 @@ export class PromptCultureModels { noInLanguage: 'No', }; - public static Japanese: PromptCultureModel = { + static Japanese: PromptCultureModel = { locale: Culture.Japanese, separator: '、 ', inlineOr: ' または ', @@ -106,7 +106,7 @@ export class PromptCultureModels { noInLanguage: 'いいえ', }; - public static Portuguese: PromptCultureModel = { + static Portuguese: PromptCultureModel = { locale: Culture.Portuguese, separator: ', ', inlineOr: ' ou ', @@ -115,7 +115,7 @@ export class PromptCultureModels { noInLanguage: 'Não', }; - public static Spanish: PromptCultureModel = { + static Spanish: PromptCultureModel = { locale: Culture.Spanish, separator: ', ', inlineOr: ' o ', @@ -138,7 +138,7 @@ export class PromptCultureModels { * @param cultureCode Represents locale. Examples: "en-US, en-us, EN". * @returns Normalized locale. */ - public static mapToNearestLanguage(cultureCode: string): string { + static mapToNearestLanguage(cultureCode: string): string { if (cultureCode) { cultureCode = cultureCode.toLowerCase(); const supportedCultureCodes = this.getSupportedCultureCodes(); @@ -157,7 +157,7 @@ export class PromptCultureModels { return cultureCode; } - public static getSupportedCultures = (): PromptCultureModel[] => [ + static getSupportedCultures = (): PromptCultureModel[] => [ PromptCultureModels.Chinese, PromptCultureModels.Dutch, PromptCultureModels.English, diff --git a/libraries/botbuilder-dialogs/src/recognizer.ts b/libraries/botbuilder-dialogs/src/recognizer.ts index 534c899cbc..8023904e22 100644 --- a/libraries/botbuilder-dialogs/src/recognizer.ts +++ b/libraries/botbuilder-dialogs/src/recognizer.ts @@ -30,13 +30,13 @@ export class Recognizer extends Configurable implements RecognizerConfiguration /** * Recognizers unique ID. */ - public id: string; + id: string; /** * The telemetry client for logging events. * Default this to the NullTelemetryClient, which does nothing. */ - public telemetryClient: BotTelemetryClient = new NullTelemetryClient(); + telemetryClient: BotTelemetryClient = new NullTelemetryClient(); /** * To recognize intents and entities in a users utterance. @@ -47,7 +47,7 @@ export class Recognizer extends Configurable implements RecognizerConfiguration * @param {Record} telemetryMetrics Additional metrics to be logged to telemetry with event. * @returns {Promise} Recognized result. */ - public recognize( + recognize( dialogContext: DialogContext, activity: Partial, telemetryProperties?: Record, @@ -101,7 +101,7 @@ export class Recognizer extends Configurable implements RecognizerConfiguration /** * 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} telemetryProperties A list of properties to append or override the properties created using the RecognizerResult. * @param {DialogContext} dialogContext Dialog Context. diff --git a/libraries/botbuilder-dialogs/src/skillDialog.ts b/libraries/botbuilder-dialogs/src/skillDialog.ts index cb6543a067..2e1c2c1356 100644 --- a/libraries/botbuilder-dialogs/src/skillDialog.ts +++ b/libraries/botbuilder-dialogs/src/skillDialog.ts @@ -54,7 +54,7 @@ export class SkillDialog extends Dialog> { * @param dialogOptions * @param dialogId */ - public constructor(dialogOptions: SkillDialogOptions, dialogId?: string) { + constructor(dialogOptions: SkillDialogOptions, dialogId?: string) { super(dialogId); if (!dialogOptions) { throw new TypeError('Missing dialogOptions parameter'); @@ -70,7 +70,7 @@ export class SkillDialog extends Dialog> { * @remarks * 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(dc: DialogContext, options: BeginSkillDialogOptions): Promise { + async beginDialog(dc: DialogContext, options: BeginSkillDialogOptions): Promise { const dialogArgs = this.validateBeginDialogArgs(options); // Create deep clone of the original activity to avoid altering it before forwarding it. @@ -108,7 +108,7 @@ export class SkillDialog extends Dialog> { * active after the turn has been processed by the dialog. The result may also contain a * return value. */ - public async continueDialog(dc: DialogContext): Promise { + async continueDialog(dc: DialogContext): Promise { // with adaptive dialogs, ResumeDialog is not called directly. Instead the Interrupted flag is set, which // acts as the signal to the SkillDialog to resume the skill. if (dc.state.getValue(TurnPath.interrupted)) { @@ -149,7 +149,7 @@ export class SkillDialog extends Dialog> { * @param reason [Reason](xref:botbuilder-dialogs.DialogReason) why the dialog ended. * @returns A Promise representing the asynchronous operation. */ - public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { + async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { // Send of of conversation to the skill if the dialog has been cancelled. if (reason == DialogReason.cancelCalled || reason == DialogReason.replaceCalled) { const reference = TurnContext.getConversationReference(context.activity); @@ -176,7 +176,7 @@ export class SkillDialog extends Dialog> { * @param instance State information for this dialog. * @returns A Promise representing the asynchronous operation. */ - public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { + async repromptDialog(context: TurnContext, instance: DialogInstance): Promise { // Create and send an envent to the skill so it can resume the dialog. const repromptEvent = { type: ActivityTypes.Event, name: DialogEvents.repromptDialog }; @@ -198,7 +198,7 @@ export class SkillDialog extends Dialog> { * 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 { + async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { await this.repromptDialog(dc.context, dc.activeDialog); return Dialog.EndOfTurn; } diff --git a/libraries/botbuilder-dialogs/src/waterfallDialog.ts b/libraries/botbuilder-dialogs/src/waterfallDialog.ts index 581166b8c1..bbefc7f95b 100644 --- a/libraries/botbuilder-dialogs/src/waterfallDialog.ts +++ b/libraries/botbuilder-dialogs/src/waterfallDialog.ts @@ -93,7 +93,7 @@ export class WaterfallDialog extends Dialog { * 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 }`; @@ -137,7 +137,7 @@ export class WaterfallDialog extends Dialog { * ``` * @param step Asynchronous step function to call. */ - public addStep(step: WaterfallStep): this { + addStep(step: WaterfallStep): this { this.steps.push(step); return this; @@ -152,7 +152,7 @@ export class WaterfallDialog extends Dialog { * If the task is successful, the result indicates whether the [Dialog](xref:botbuilder-dialogs.Dialog) is still * active after the turn has been processed by the dialog. */ - public async beginDialog(dc: DialogContext, options?: O): Promise { + async beginDialog(dc: DialogContext, options?: O): Promise { // Initialize waterfall state const state: WaterfallDialogState = dc.activeDialog.state as WaterfallDialogState; state.options = options || {}; @@ -184,7 +184,7 @@ export class WaterfallDialog extends Dialog { * active after the turn has been processed by the dialog. The result may also contain a * return value. */ - public async continueDialog(dc: DialogContext): Promise { + async continueDialog(dc: DialogContext): Promise { // Don't do anything for non-message activities if (dc.context.activity.type !== ActivityTypes.Message) { return Dialog.EndOfTurn; @@ -202,7 +202,7 @@ export class WaterfallDialog extends Dialog { * 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 { + async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise { // Increment step index and run step const state: WaterfallDialogState = dc.activeDialog.state as WaterfallDialogState; @@ -293,7 +293,7 @@ export class WaterfallDialog extends Dialog { * @param instance The instance of the current dialog. * @param reason The reason the dialog is ending. */ - public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { + async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise { const state: WaterfallDialogState = instance.state as WaterfallDialogState; const instanceId = state.values['instanceId']; if (reason === DialogReason.endCalled) { diff --git a/libraries/botbuilder-dialogs/src/waterfallStepContext.ts b/libraries/botbuilder-dialogs/src/waterfallStepContext.ts index 983cb72ef5..56879992a0 100644 --- a/libraries/botbuilder-dialogs/src/waterfallStepContext.ts +++ b/libraries/botbuilder-dialogs/src/waterfallStepContext.ts @@ -57,7 +57,7 @@ export class WaterfallStepContext extends DialogContext { * @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) { + constructor(dc: DialogContext, info: WaterfallStepInfo) { super(dc.dialogs, dc, { dialogStack: dc.stack }); this._info = info; this.parent = dc.parent; @@ -66,7 +66,7 @@ export class WaterfallStepContext extends DialogContext { /** * The index of the current waterfall step being executed. */ - public get index(): number { + get index(): number { return this._info.index; } @@ -74,28 +74,28 @@ export class WaterfallStepContext extends DialogContext { * Any options passed to the steps waterfall dialog when it was started with * `DialogContext.beginDialog()`. */ - public get options(): O { + get options(): O { return this._info.options; } /** * The reason the waterfall step is being executed. */ - public get reason(): DialogReason { + get reason(): DialogReason { return this._info.reason; } /** * Results returned by a dialog or prompt that was called in the previous waterfall step. */ - public get result(): any { + get result(): any { return this._info.result; } /** * A dictionary of values which will be persisted across all waterfall steps. */ - public get values(): object { + get values(): object { return this._info.values; } @@ -109,7 +109,7 @@ export class WaterfallStepContext extends DialogContext { * ``` * @param result (Optional) result to pass to the next step. */ - public async next(result?: any): Promise { + async next(result?: any): Promise { return await this._info.onNext(result); } }