Skip to content

Commit

Permalink
Declare return types in waterfallDialog.ts (#1578)
Browse files Browse the repository at this point in the history
* Declare return types in waterfallDialog.ts

* Fix waterfall-cancel-telemetry-step-name bug

* Roll back bug fix
  • Loading branch information
Kyle Delaney authored Jan 27, 2020
1 parent 2274c21 commit 15f0b42
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libraries/botbuilder-dialogs/src/waterfallDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ export class WaterfallDialog<O extends object = {}> extends Dialog<O> {
* @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) {

public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> {
const state: WaterfallDialogState = instance.state as WaterfallDialogState;
const instanceId = state.values['instanceId'];
if (reason === DialogReason.endCalled) {
Expand All @@ -256,7 +255,7 @@ export class WaterfallDialog<O extends object = {}> extends Dialog<O> {
}
}

private waterfallStepName(index) {
private waterfallStepName(index: number): string {
// Log Waterfall Step event. Each event has a distinct name to hook up
// to the Application Insights funnel.
var stepName = '';
Expand Down Expand Up @@ -288,8 +287,8 @@ interface WaterfallDialogState {
* instances of a given waterfall dialog.
* Source: https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
*/
function generate_guid() {
function s4() {
function generate_guid(): string {
function s4(): string {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
Expand Down

0 comments on commit 15f0b42

Please sign in to comment.