Skip to content

Commit

Permalink
More test:compat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tracy Boehrer committed Jul 13, 2022
1 parent 3b20e3c commit 93b366b
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 54 deletions.
20 changes: 10 additions & 10 deletions libraries/botbuilder-dialogs/src/componentDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ export class ComponentDialog<O extends object = {}> extends DialogContainer<O> {
* 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 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.
* @returns A Promise representing the asynchronous operation.
* @remarks
Expand All @@ -165,7 +165,7 @@ export class ComponentDialog<O extends object = {}> extends DialogContainer<O> {
* If this method is *not* overridden, the dialog automatically calls its
* RepromptDialog(ITurnContext, DialogInstance) when the user replies.
*/
async resumeDialog(outerDC: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult> {
async resumeDialog(outerDC: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> {
await this.checkForVersionChange(outerDC);

// Containers are typically leaf nodes on the stack but the dev is free to push other dialogs
Expand Down Expand Up @@ -277,12 +277,12 @@ export class ComponentDialog<O extends object = {}> extends DialogContainer<O> {
* @remarks
* If the `reason` code is equal to `DialogReason.cancelCalled`, then any active child dialogs
* 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();
}

Expand All @@ -291,11 +291,11 @@ export class ComponentDialog<O extends object = {}> extends DialogContainer<O> {
*
* @remarks
* 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();
}

Expand Down
26 changes: 13 additions & 13 deletions libraries/botbuilder-dialogs/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ export abstract class Dialog<O extends object = {}> extends Configurable {
/**
* When overridden in a derived class, reprompts the user for input.
*
* @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.
*
* @remarks
* Derived dialogs that support validation and re-prompt logic should override this method.
Expand All @@ -402,16 +402,16 @@ export abstract class Dialog<O extends object = {}> extends Configurable {
* - [DialogContext.repromptDialog](xref:botbuilder-dialogs.DialogContext.repromptDialog)
* - [Prompt](xref:botbuilder-dialogs.Prompt)
*/
async repromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void> {
async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> {
// No-op by default
}

/**
* 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.
*
* @remarks
* Derived dialogs that need to perform logging or cleanup before ending should override this method.
Expand All @@ -425,7 +425,7 @@ export abstract class Dialog<O extends object = {}> extends Configurable {
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
* - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog)
*/
async endDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void> {
async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> {
// No-op by default
}

Expand Down Expand Up @@ -460,11 +460,11 @@ export abstract class Dialog<O extends object = {}> extends Configurable {
* This is a good place to perform interception of an event as returning `true` will prevent
* any further bubbling of the event to the dialogs parents and will also prevent any child
* 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;
}

Expand All @@ -474,11 +474,11 @@ export abstract class Dialog<O extends object = {}> extends Configurable {
* @remarks
* This is a good place to perform default processing logic for an event. Returning `true` will
* 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export class BotStateMemoryScope extends MemoryScope {
* 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 {
const botState = dc.context.turnState.get(this.stateKey);
if (!botState) {
throw new Error(`${this.stateKey} is not available.`);
Expand Down Expand Up @@ -86,10 +86,10 @@ export class BotStateMemoryScope extends MemoryScope {
/**
* 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.
*/
async delete(_dc: DialogContext): Promise<void> {
async delete(dc: DialogContext): Promise<void> {
return Promise.resolve();
}
}
18 changes: 9 additions & 9 deletions libraries/botbuilder-dialogs/src/memory/scopes/memoryScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,37 @@ export abstract class MemoryScope {
/**
* 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 {
throw new Error(`MemoryScope.setMemory: The '${this.name}' memory scope is read-only.`);
}

/**
* Loads a scopes backing memory at the start of a turn.
*
* @param _dc Current dialog context.
* @param dc Current dialog context.
*/
async load(_dc: DialogContext): Promise<void> {
async load(dc: DialogContext): Promise<void> {
// 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.
*/
async saveChanges(_dc: DialogContext): Promise<void> {
async saveChanges(dc: DialogContext): Promise<void> {
// No initialization by default.
}

/**
* Deletes the backing memory for a scope.
*
* @param _dc Current dialog context.
* @param dc Current dialog context.
*/
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.`);
}
}
6 changes: 3 additions & 3 deletions libraries/botbuilder-dialogs/src/prompts/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ export abstract class Prompt<T> extends Dialog {
* 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.
* @returns A Promise representing the asynchronous operation.
* @remarks
* If the task is successful, the result indicates whether the dialog is still
* active after the turn has been processed by the dialog.
*/
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
// on top of the stack which will result in the prompt receiving an unexpected call to
// resumeDialog() when the pushed on dialog ends.
Expand Down
20 changes: 10 additions & 10 deletions libraries/botbuilder-dialogs/src/recognizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export class Recognizer extends Configurable implements RecognizerConfiguration
/**
* To recognize intents and entities in a users utterance.
*
* @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.
* @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>
dialogContext: DialogContext,
activity: Partial<Activity>,
telemetryProperties?: Record<string, string>,
telemetryMetrics?: Record<string, number>
): Promise<RecognizerResult> {
throw new Error('Please implement recognize function.');
}
Expand Down Expand Up @@ -104,13 +104,13 @@ export class Recognizer extends Configurable implements RecognizerConfiguration
*
* @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.
*/
protected fillRecognizerResultTelemetryProperties(
recognizerResult: RecognizerResult,
telemetryProperties: Record<string, string>,
_dialogContext?: DialogContext
dialogContext?: DialogContext
): Record<string, string> {
const { intent, score } = getTopScoringIntent(recognizerResult);
const intents = Object.entries(recognizerResult.intents);
Expand Down
10 changes: 5 additions & 5 deletions libraries/botbuilder-dialogs/src/skillDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ export class SkillDialog extends Dialog<Partial<BeginSkillDialogOptions>> {
* 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.
*/
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);
return Dialog.EndOfTurn;
}
Expand All @@ -216,10 +216,10 @@ export class SkillDialog extends Dialog<Partial<BeginSkillDialogOptions>> {
* Override this method to implement a custom validator for the activity being sent during the continueDialog.
* This method can be used to ignore activities of a certain type if needed.
* 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;
}

Expand Down

0 comments on commit 93b366b

Please sign in to comment.