diff --git a/libraries/botbuilder-core/src/activityFactory.ts b/libraries/botbuilder-core/src/activityFactory.ts index 3d54bf83a7..fec329ee2a 100644 --- a/libraries/botbuilder-core/src/activityFactory.ts +++ b/libraries/botbuilder-core/src/activityFactory.ts @@ -117,7 +117,7 @@ export class ActivityFactory { * Generate the activity. * @param lgResult string result from languageGenerator. */ - public static fromObject(lgResult: any): Partial { + static fromObject(lgResult: any): Partial { if (lgResult == null) { return { type: ActivityTypes.Message }; } diff --git a/libraries/botbuilder-core/src/activityHandler.ts b/libraries/botbuilder-core/src/activityHandler.ts index 41ed3efeac..417932b932 100644 --- a/libraries/botbuilder-core/src/activityHandler.ts +++ b/libraries/botbuilder-core/src/activityHandler.ts @@ -102,7 +102,7 @@ export class ActivityHandler extends ActivityHandlerBase { * @remarks * Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. */ - public onTurn(handler: BotHandler): this { + onTurn(handler: BotHandler): this { return this.on('Turn', handler); } @@ -119,7 +119,7 @@ export class ActivityHandler extends ActivityHandlerBase { * Not all message activities contain text, the activity's [text](xref:botframework-schema.Activity.text) * property can be `null` or `undefined`. */ - public onMessage(handler: BotHandler): this { + onMessage(handler: BotHandler): this { return this.on('Message', handler); } @@ -139,7 +139,7 @@ export class ActivityHandler extends ActivityHandlerBase { * [onMembersAdded](xref:botbuilder-core.ActivityHandler.onMembersAdded) and * [onMembersRemoved](xref:botbuilder-core.ActivityHandler.onMembersRemoved) sub-type event handlers. */ - public onConversationUpdate(handler: BotHandler): this { + onConversationUpdate(handler: BotHandler): this { return this.on('ConversationUpdate', handler); } @@ -158,7 +158,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle conversation update events in general, use the * [onConversationUpdate](xref:botbuilder-core.ActivityHandler.onConversationUpdate) type-specific event handler. */ - public onMembersAdded(handler: BotHandler): this { + onMembersAdded(handler: BotHandler): this { return this.on('MembersAdded', handler); } @@ -177,7 +177,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle conversation update events in general, use the * [onConversationUpdate](xref:botbuilder-core.ActivityHandler.onConversationUpdate) type-specific event handler. */ - public onMembersRemoved(handler: BotHandler): this { + onMembersRemoved(handler: BotHandler): this { return this.on('MembersRemoved', handler); } @@ -200,7 +200,7 @@ export class ActivityHandler extends ActivityHandlerBase { * [onReactionsAdded](xref:botbuilder-core.ActivityHandler.onReactionsAdded) and * [onReactionsRemoved](xref:botbuilder-core.ActivityHandler.onReactionsRemoved) sub-type event handlers. */ - public onMessageReaction(handler: BotHandler): this { + onMessageReaction(handler: BotHandler): this { return this.on('MessageReaction', handler); } @@ -219,7 +219,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle message reaction events in general, use the * [onMessageReaction](xref:botbuilder-core.ActivityHandler.onMessageReaction) type-specific event handler. */ - public onReactionsAdded(handler: BotHandler): this { + onReactionsAdded(handler: BotHandler): this { return this.on('ReactionsAdded', handler); } @@ -238,7 +238,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle message reaction events in general, use the * [onMessageReaction](xref:botbuilder-core.ActivityHandler.onMessageReaction) type-specific event handler. */ - public onReactionsRemoved(handler: BotHandler): this { + onReactionsRemoved(handler: BotHandler): this { return this.on('ReactionsRemoved', handler); } @@ -261,7 +261,7 @@ export class ActivityHandler extends ActivityHandlerBase { * [onTokenResponseEvent](xref:botbuilder-core.ActivityHandler.onTokenResponseEvent) sub-type * event handler. To handle other named events, add logic to this handler. */ - public onEvent(handler: BotHandler): this { + onEvent(handler: BotHandler): this { return this.on('Event', handler); } @@ -278,7 +278,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle an End of Conversation, use the * [onEndOfConversation](xref:botbuilder-core.ActivityHandler.onEndOfConversation) type-specific event handler. */ - public onEndOfConversation(handler: BotHandler): this { + onEndOfConversation(handler: BotHandler): this { return this.on('EndOfConversation', handler); } @@ -293,7 +293,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle a Typing event, use the * [onTyping](xref:botbuilder-core.ActivityHandler.onTyping) type-specific event handler. */ - public onTyping(handler: BotHandler): this { + onTyping(handler: BotHandler): this { return this.on('Typing', handler); } @@ -308,7 +308,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle a InstallationUpdate event, use the * [onInstallationUpdate](xref:botbuilder-core.ActivityHandler.onInstallationUpdate) type-specific event handler. */ - public onInstallationUpdate(handler: BotHandler): this { + onInstallationUpdate(handler: BotHandler): this { return this.on('InstallationUpdate', handler); } @@ -323,7 +323,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle a InstallationUpdateAdd event, use the * [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd) type-specific event handler. */ - public onInstallationUpdateAdd(handler: BotHandler): this { + onInstallationUpdateAdd(handler: BotHandler): this { return this.on('InstallationUpdateAdd', handler); } @@ -338,7 +338,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle a InstallationUpdateRemove event, use the * [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove) type-specific event handler. */ - public onInstallationUpdateRemove(handler: BotHandler): this { + onInstallationUpdateRemove(handler: BotHandler): this { return this.on('InstallationUpdateRemove', handler); } @@ -359,7 +359,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle other named events and event events in general, use the * [onEvent](xref:botbuilder-core.ActivityHandler.onEvent) type-specific event handler. */ - public onTokenResponseEvent(handler: BotHandler): this { + onTokenResponseEvent(handler: BotHandler): this { return this.on('TokenResponseEvent', handler); } @@ -374,7 +374,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle a Command event, use the * [onCommand](xref:botbuilder-core.ActivityHandler.onCommand) type-specific event handler. */ - public onCommand(handler: BotHandler): this { + onCommand(handler: BotHandler): this { return this.on('Command', handler); } @@ -389,7 +389,7 @@ export class ActivityHandler extends ActivityHandlerBase { * To handle a CommandResult event, use the * [onCommandResult](xref:botbuilder-core.ActivityHandler.onCommandResult) type-specific event handler. */ - public onCommandResult(handler: BotHandler): this { + onCommandResult(handler: BotHandler): this { return this.on('CommandResult', handler); } @@ -410,7 +410,7 @@ export class ActivityHandler extends ActivityHandlerBase { * * The activity's [type](xref:botframework-schema.Activity.type) property contains the activity type. */ - public onUnrecognizedActivityType(handler: BotHandler): this { + onUnrecognizedActivityType(handler: BotHandler): this { return this.on('UnrecognizedActivityType', handler); } @@ -423,7 +423,7 @@ export class ActivityHandler extends ActivityHandlerBase { * Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * */ - public onDialog(handler: BotHandler): this { + onDialog(handler: BotHandler): this { return this.on('Dialog', handler); } @@ -450,7 +450,7 @@ export class ActivityHandler extends ActivityHandlerBase { * **See also** * - [BotFrameworkAdapter.processActivity](xref:botbuilder.BotFrameworkAdapter.processActivity) */ - public async run(context: TurnContext): Promise { + async run(context: TurnContext): Promise { await super.run(context); } diff --git a/libraries/botbuilder-core/src/activityHandlerBase.ts b/libraries/botbuilder-core/src/activityHandlerBase.ts index 5565208904..89ebb0b2a7 100644 --- a/libraries/botbuilder-core/src/activityHandlerBase.ts +++ b/libraries/botbuilder-core/src/activityHandlerBase.ts @@ -388,7 +388,7 @@ export class ActivityHandlerBase { * **See also** * - [BotFrameworkAdapter.processActivity](xref:botbuilder.BotFrameworkAdapter.processActivity) */ - public async run(context: TurnContext): Promise { + async run(context: TurnContext): Promise { if (!context) { throw new Error(`Missing TurnContext parameter`); } diff --git a/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts b/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts index b2e055cdfe..56db84bb4e 100644 --- a/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts +++ b/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts @@ -47,7 +47,7 @@ export class AutoSaveStateMiddleware implements Middleware { /** * Set of `BotState` plugins being automatically saved. */ - public botStateSet: BotStateSet; + botStateSet: BotStateSet; /** * Creates a new AutoSaveStateMiddleware instance. * @param botStates One or more BotState plugins to automatically save at the end of the turn. @@ -62,7 +62,7 @@ export class AutoSaveStateMiddleware implements Middleware { * @param context The context object for this turn. * @param next {function} The next delegate function. */ - public async onTurn(context: TurnContext, next: () => Promise): Promise { + async onTurn(context: TurnContext, next: () => Promise): Promise { await next(); await this.botStateSet.saveAllChanges(context, false); } @@ -71,7 +71,7 @@ export class AutoSaveStateMiddleware implements Middleware { * Adds additional `BotState` plugins to be saved. * @param botStates One or more BotState plugins to add. */ - public add(...botStates: BotState[]): this { + add(...botStates: BotState[]): this { BotStateSet.prototype.add.apply(this.botStateSet, botStates); return this; diff --git a/libraries/botbuilder-core/src/botAdapter.ts b/libraries/botbuilder-core/src/botAdapter.ts index 8e9c4a9da9..40a7ef9f94 100644 --- a/libraries/botbuilder-core/src/botAdapter.ts +++ b/libraries/botbuilder-core/src/botAdapter.ts @@ -32,9 +32,9 @@ export abstract class BotAdapter { private turnError: (context: TurnContext, error: Error) => Promise; - public readonly BotIdentityKey = Symbol('BotIdentity'); - public readonly ConnectorClientKey = Symbol('ConnectorClient'); - public readonly OAuthScopeKey = Symbol('OAuthScope'); + readonly BotIdentityKey = Symbol('BotIdentity'); + readonly ConnectorClientKey = Symbol('ConnectorClient'); + readonly OAuthScopeKey = Symbol('OAuthScope'); /** * Asynchronously sends a set of outgoing activities to a channel server. @@ -53,7 +53,7 @@ export abstract class BotAdapter { * response object will be returned for each sent activity. For `message` activities this will * contain the ID of the delivered message. */ - public abstract sendActivities(context: TurnContext, activities: Partial[]): Promise; + abstract sendActivities(context: TurnContext, activities: Partial[]): Promise; /** * Asynchronously replaces a previous activity with an updated version. @@ -68,7 +68,7 @@ export abstract class BotAdapter { * @remarks * Not all channels support this operation. For channels that don't, this call may throw an exception. */ - public abstract updateActivity(context: TurnContext, activity: Partial): Promise; + abstract updateActivity(context: TurnContext, activity: Partial): Promise; /** * Asynchronously deletes an existing activity. @@ -83,7 +83,7 @@ export abstract class BotAdapter { * @remarks * Not all channels support this operation. For channels that don't, this call may throw an exception. */ - public abstract deleteActivity(context: TurnContext, reference: Partial): Promise; + abstract deleteActivity(context: TurnContext, reference: Partial): Promise; /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. @@ -96,7 +96,7 @@ export abstract class BotAdapter { * send a message to a conversation or user without waiting for an incoming message. * For example, a bot can use this method to send notifications or coupons to a user. */ - public abstract continueConversation( + abstract continueConversation( reference: Partial, logic: (revocableContext: TurnContext) => Promise ): Promise; @@ -201,7 +201,7 @@ export abstract class BotAdapter { * | `context` | [TurnContext](xref:botbuilder-core.TurnContext) | The context object for the turn. | * | `error` | `Error` | The Node.js error thrown. | */ - public get onTurnError(): (context: TurnContext, error: Error) => Promise { + get onTurnError(): (context: TurnContext, error: Error) => Promise { return this.turnError; } @@ -216,7 +216,7 @@ export abstract class BotAdapter { * | `context` | [TurnContext](xref:botbuilder-core.TurnContext) | The context object for the turn. | * | `error` | `Error` | The Node.js error thrown. | */ - public set onTurnError(value: (context: TurnContext, error: Error) => Promise) { + set onTurnError(value: (context: TurnContext, error: Error) => Promise) { this.turnError = value; } @@ -229,7 +229,7 @@ export abstract class BotAdapter { * Middleware is added to the adapter at initialization time. * Each turn, the adapter calls its middleware in the order in which you added it. */ - public use(...middlewares: (MiddlewareHandler | Middleware)[]): this { + use(...middlewares: (MiddlewareHandler | Middleware)[]): this { this.middleware.use(...middlewares); return this; diff --git a/libraries/botbuilder-core/src/botState.ts b/libraries/botbuilder-core/src/botState.ts index 20906eddf5..efbc9a8270 100644 --- a/libraries/botbuilder-core/src/botState.ts +++ b/libraries/botbuilder-core/src/botState.ts @@ -52,7 +52,7 @@ export class BotState implements PropertyManager { * @param T (Optional) type of property to create. Defaults to `any` type. * @param name Name of the property to add. */ - public createProperty(name: string): StatePropertyAccessor { + createProperty(name: string): StatePropertyAccessor { const prop: BotStatePropertyAccessor = new BotStatePropertyAccessor(this, name); return prop; } @@ -72,7 +72,7 @@ export class BotState implements PropertyManager { * @param context Context for current turn of conversation with the user. * @param force (Optional) If `true` the cache will be bypassed and the state will always be read in directly from storage. Defaults to `false`. */ - public load(context: TurnContext, force = false): Promise { + load(context: TurnContext, force = false): Promise { const cached: CachedBotState = context.turnState.get(this.stateKey); if (force || !cached || !cached.state) { return Promise.resolve(this.storageKey(context)).then((key: string) => { @@ -103,7 +103,7 @@ export class BotState implements PropertyManager { * @param context Context for current turn of conversation with the user. * @param force (Optional) if `true` the state will always be written out regardless of its change state. Defaults to `false`. */ - public saveChanges(context: TurnContext, force = false): Promise { + saveChanges(context: TurnContext, force = false): Promise { let cached: CachedBotState = context.turnState.get(this.stateKey); if (force || (cached && cached.hash !== calculateChangeHash(cached.state))) { return Promise.resolve(this.storageKey(context)).then((key: string) => { @@ -138,7 +138,7 @@ export class BotState implements PropertyManager { * ``` * @param context Context for current turn of conversation with the user. */ - public clear(context: TurnContext): Promise { + clear(context: TurnContext): Promise { // Just overwrite cached value with a new object and empty hash. The empty hash will force the // changes to be saved. context.turnState.set(this.stateKey, { state: {}, hash: '' }); @@ -157,7 +157,7 @@ export class BotState implements PropertyManager { * ``` * @param context Context for current turn of conversation with the user. */ - public delete(context: TurnContext): Promise { + delete(context: TurnContext): Promise { if (context.turnState.has(this.stateKey)) { context.turnState.delete(this.stateKey); } @@ -176,7 +176,7 @@ export class BotState implements PropertyManager { * ``` * @param context Context for current turn of conversation with the user. */ - public get(context: TurnContext): any | undefined { + get(context: TurnContext): any | undefined { const cached: CachedBotState = context.turnState.get(this.stateKey); return typeof cached === 'object' && typeof cached.state === 'object' ? cached.state : undefined; diff --git a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts index 98b2cb20ed..ab9d79af44 100644 --- a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts +++ b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts @@ -93,7 +93,7 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< * Deletes the persisted property from its backing storage object. * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. */ - public async delete(context: TurnContext): Promise { + async delete(context: TurnContext): Promise { const obj: any = await this.state.load(context); if (obj.hasOwnProperty(this.name)) { delete obj[this.name]; @@ -105,15 +105,15 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @returns A JSON representation of the cached state. */ - public async get(context: TurnContext): Promise; - public async get(context: TurnContext, defaultValue: T): Promise; + async get(context: TurnContext): Promise; + async get(context: TurnContext, defaultValue: T): Promise; /** * Reads a persisted property from its backing storage object. * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param defaultValue Optional. Default value for the property. * @returns A JSON representation of the cached state. */ - public async get(context: TurnContext, defaultValue?: T): Promise { + async get(context: TurnContext, defaultValue?: T): Promise { const obj: any = await this.state.load(context); if (!obj.hasOwnProperty(this.name) && defaultValue !== undefined) { const clone: any = @@ -131,7 +131,7 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param value Value to set on the property. */ - public async set(context: TurnContext, value: T): Promise { + async set(context: TurnContext, value: T): Promise { const obj: any = await this.state.load(context); obj[this.name] = value; } diff --git a/libraries/botbuilder-core/src/botStateSet.ts b/libraries/botbuilder-core/src/botStateSet.ts index d8670f326d..285af6a704 100644 --- a/libraries/botbuilder-core/src/botStateSet.ts +++ b/libraries/botbuilder-core/src/botStateSet.ts @@ -16,13 +16,13 @@ export class BotStateSet { /** * Array of the sets `BotState` plugins. */ - public readonly botStates: BotState[] = []; + readonly botStates: BotState[] = []; /** * Creates a new BotStateSet instance. * @param botStates One or more BotState plugins to register. */ - public constructor(...botStates: BotState[]) { + constructor(...botStates: BotState[]) { BotStateSet.prototype.add.apply(this, botStates); } @@ -30,7 +30,7 @@ export class BotStateSet { * Registers One or more `BotState` plugins with the set. * @param botStates One or more BotState plugins to register. */ - public add(...botStates: BotState[]): this { + add(...botStates: BotState[]): this { botStates.forEach((botstate: BotState) => { if (typeof botstate.load === 'function' && typeof botstate.saveChanges === 'function') { this.botStates.push(botstate); @@ -54,7 +54,7 @@ export class BotStateSet { * @param context Context for current turn of conversation with the user. * @param force (Optional) If `true` the cache will be bypassed and the state will always be read in directly from storage. Defaults to `false`. */ - public async loadAll(context: TurnContext, force = false): Promise { + async loadAll(context: TurnContext, force = false): Promise { const promises: Promise[] = this.botStates.map((botstate: BotState) => botstate.load(context, force)); await Promise.all(promises); @@ -74,7 +74,7 @@ export class BotStateSet { * @param context Context for current turn of conversation with the user. * @param force (Optional) if `true` the state will always be written out regardless of its change state. Defaults to `false`. */ - public async saveAllChanges(context: TurnContext, force = false): Promise { + async saveAllChanges(context: TurnContext, force = false): Promise { const promises: Promise[] = this.botStates.map((botstate: BotState) => botstate.saveChanges(context, force) ); diff --git a/libraries/botbuilder-core/src/browserStorage.ts b/libraries/botbuilder-core/src/browserStorage.ts index 77986c6b1b..f958145aa3 100644 --- a/libraries/botbuilder-core/src/browserStorage.ts +++ b/libraries/botbuilder-core/src/browserStorage.ts @@ -24,7 +24,7 @@ export class BrowserLocalStorage extends MemoryStorage { /** * Creates a new [BrowserLocalStorage](xref:botbuilder-core.BrowserLocalStorage) instance. */ - public constructor() { + constructor() { super(localStorage as any); } } @@ -48,7 +48,7 @@ export class BrowserSessionStorage extends MemoryStorage { /** * Creates a new [BrowserSessionStorage](xref:botbuilder-core.BrowserSessionStorage) instance. */ - public constructor() { + constructor() { super(sessionStorage as any); } } diff --git a/libraries/botbuilder-core/src/cardFactory.ts b/libraries/botbuilder-core/src/cardFactory.ts index f0e9b6e755..f458e1c229 100644 --- a/libraries/botbuilder-core/src/cardFactory.ts +++ b/libraries/botbuilder-core/src/cardFactory.ts @@ -46,7 +46,7 @@ export class CardFactory { /** * Lists the content type schema for each card style. */ - public static contentTypes: any = { + static contentTypes: any = { adaptiveCard: 'application/vnd.microsoft.card.adaptive', animationCard: 'application/vnd.microsoft.card.animation', audioCard: 'application/vnd.microsoft.card.audio', @@ -96,7 +96,7 @@ export class CardFactory { * }); * ``` */ - public static adaptiveCard(card: any): Attachment { + static adaptiveCard(card: any): Attachment { return { contentType: CardFactory.contentTypes.adaptiveCard, content: card }; } @@ -110,7 +110,7 @@ export class CardFactory { * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). */ - public static animationCard( + static animationCard( title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], @@ -129,7 +129,7 @@ export class CardFactory { * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). */ - public static audioCard( + static audioCard( title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], @@ -162,7 +162,7 @@ export class CardFactory { * ); * ``` */ - public static heroCard( + static heroCard( title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], @@ -192,7 +192,7 @@ export class CardFactory { * ); * ``` */ - public static heroCard( + static heroCard( title: string, text: string, images?: (CardImage | string)[], @@ -223,7 +223,7 @@ export class CardFactory { * ); * ``` */ - public static heroCard( + static heroCard( title: string, text?: any, images?: any, @@ -247,7 +247,7 @@ export class CardFactory { * @remarks * OAuth cards support the Bot Framework's single sign on (SSO) service. */ - public static oauthCard( + static oauthCard( connectionName: string, title: string, text?: string, @@ -290,7 +290,7 @@ export class CardFactory { * }); * ``` */ - public static o365ConnectorCard(card: O365ConnectorCard): Attachment { + static o365ConnectorCard(card: O365ConnectorCard): Attachment { return { contentType: CardFactory.contentTypes.o365ConnectorCard, content: card }; } @@ -300,7 +300,7 @@ export class CardFactory { * @param card A description of the receipt card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). */ - public static receiptCard(card: ReceiptCard): Attachment { + static receiptCard(card: ReceiptCard): Attachment { return { contentType: CardFactory.contentTypes.receiptCard, content: card }; } @@ -315,7 +315,7 @@ export class CardFactory { * @remarks * For channels that don't natively support sign-in cards, an alternative message is rendered. */ - public static signinCard(title: string, url: string, text?: string): Attachment { + static signinCard(title: string, url: string, text?: string): Attachment { const card: SigninCard = { buttons: [{ type: ActionTypes.Signin, title: title, value: url, channelData: undefined }], }; @@ -343,7 +343,7 @@ export class CardFactory { * Channels typically render the card's text to one side of the image, * with any buttons displayed below the card. */ - public static thumbnailCard( + static thumbnailCard( title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], @@ -367,7 +367,7 @@ export class CardFactory { * Channels typically render the card's text to one side of the image, * with any buttons displayed below the card. */ - public static thumbnailCard( + static thumbnailCard( title: string, text: string, images?: (CardImage | string)[], @@ -392,7 +392,7 @@ export class CardFactory { * Channels typically render the card's text to one side of the image, * with any buttons displayed below the card. */ - public static thumbnailCard( + static thumbnailCard( title: string, text?: any, images?: any, @@ -432,7 +432,7 @@ export class CardFactory { * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). */ - public static videoCard( + static videoCard( title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], @@ -447,7 +447,7 @@ export class CardFactory { * @param actions The array of action to include on the card. Each `string` in the array * is converted to an `imBack` button with a title and value set to the value of the string. */ - public static actions(actions: (CardAction | string)[] | undefined): CardAction[] { + static actions(actions: (CardAction | string)[] | undefined): CardAction[] { const list: CardAction[] = []; (actions || []).forEach((a: CardAction | string) => { if (typeof a === 'object') { @@ -471,7 +471,7 @@ export class CardFactory { * @param images The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. */ - public static images(images: (CardImage | string)[] | undefined): CardImage[] { + static images(images: (CardImage | string)[] | undefined): CardImage[] { const list: CardImage[] = []; (images || []).forEach((img: CardImage | string) => { if (typeof img === 'object') { @@ -489,7 +489,7 @@ export class CardFactory { * * @param links The media URLs. Each `string` is converted to a media URL object. */ - public static media(links: (MediaUrl | string)[] | undefined): MediaUrl[] { + static media(links: (MediaUrl | string)[] | undefined): MediaUrl[] { const list: MediaUrl[] = []; (links || []).forEach((lnk: MediaUrl | string) => { if (typeof lnk === 'object') { diff --git a/libraries/botbuilder-core/src/componentRegistration.ts b/libraries/botbuilder-core/src/componentRegistration.ts index f1f29cbd8b..53a5d149fc 100644 --- a/libraries/botbuilder-core/src/componentRegistration.ts +++ b/libraries/botbuilder-core/src/componentRegistration.ts @@ -16,7 +16,7 @@ export class ComponentRegistration { * Gets list of all ComponentRegistration objects registered. * @returns A list of ComponentRegistration objects. */ - public static get components(): ComponentRegistration[] { + static get components(): ComponentRegistration[] { return Array.from(ComponentRegistration._components.values()); } @@ -24,8 +24,8 @@ export class ComponentRegistration { * Add a component, only one instance per type is allowed for components. * @param componentRegistration The component to be registered. */ - public static add(componentRegistration: ComponentRegistration): void { + static add(componentRegistration: ComponentRegistration): void { const name = componentRegistration.constructor.name; ComponentRegistration._components.set(name, componentRegistration); } -} \ No newline at end of file +} diff --git a/libraries/botbuilder-core/src/conversationState.ts b/libraries/botbuilder-core/src/conversationState.ts index b591d3b8cf..2362dd25f5 100644 --- a/libraries/botbuilder-core/src/conversationState.ts +++ b/libraries/botbuilder-core/src/conversationState.ts @@ -45,7 +45,7 @@ export class ConversationState extends BotState { * Returns the storage key for the current conversation state. * @param context Context for current turn of conversation with the user. */ - public getStorageKey(context: TurnContext): string | undefined { + getStorageKey(context: TurnContext): string | undefined { const activity: Activity = context.activity; const channelId: string = activity.channelId; const conversationId: string = diff --git a/libraries/botbuilder-core/src/memoryStorage.ts b/libraries/botbuilder-core/src/memoryStorage.ts index d0133aefc0..84c2de865d 100644 --- a/libraries/botbuilder-core/src/memoryStorage.ts +++ b/libraries/botbuilder-core/src/memoryStorage.ts @@ -33,7 +33,7 @@ export class MemoryStorage implements Storage { * Creates a new MemoryStorage instance. * @param memory (Optional) memory to use for storing items. By default it will create an empty JSON object `{}`. */ - public constructor(protected memory: { [k: string]: string } = {}) { + constructor(protected memory: { [k: string]: string } = {}) { this.etag = 1; } @@ -42,7 +42,7 @@ export class MemoryStorage implements Storage { * @param keys Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to read. * @returns The read items. */ - public read(keys: string[]): Promise { + read(keys: string[]): Promise { return new Promise((resolve: any, reject: any): void => { if (!keys) { throw new ReferenceError(`Keys are required when reading.`); @@ -62,7 +62,7 @@ export class MemoryStorage implements Storage { * Writes storage items to storage. * @param changes The [StoreItems](xref:botbuilder-core.StoreItems) to write, indexed by key. */ - public write(changes: StoreItems): Promise { + write(changes: StoreItems): Promise { const that: MemoryStorage = this; function saveItem(key: string, item: any): void { const clone: any = { ...item }; @@ -96,7 +96,7 @@ export class MemoryStorage implements Storage { * Deletes storage items from storage. * @param keys Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to delete. */ - public delete(keys: string[]): Promise { + delete(keys: string[]): Promise { return new Promise((resolve: any, reject: any): void => { keys.forEach((key: string) => (this.memory[key] = undefined)); resolve(); diff --git a/libraries/botbuilder-core/src/memoryTranscriptStore.ts b/libraries/botbuilder-core/src/memoryTranscriptStore.ts index fbc3cd14fc..ba9071655b 100644 --- a/libraries/botbuilder-core/src/memoryTranscriptStore.ts +++ b/libraries/botbuilder-core/src/memoryTranscriptStore.ts @@ -25,7 +25,7 @@ export class MemoryTranscriptStore implements TranscriptStore { * Log an activity to the transcript. * @param activity Activity to log. */ - public logActivity(activity: Activity): void | Promise { + logActivity(activity: Activity): void | Promise { if (!activity) { throw new Error('activity cannot be null for logActivity()'); } @@ -60,7 +60,7 @@ export class MemoryTranscriptStore implements TranscriptStore { * @param continuationToken Continuation token to page through results. * @param startDate Earliest time to include. */ - public getTranscriptActivities( + getTranscriptActivities( channelId: string, conversationId: string, continuationToken?: string, @@ -106,7 +106,7 @@ export class MemoryTranscriptStore implements TranscriptStore { * @param channelId Channel Id. * @param continuationToken Continuation token to page through results. */ - public listTranscripts(channelId: string, continuationToken?: string): Promise> { + listTranscripts(channelId: string, continuationToken?: string): Promise> { if (!channelId) { throw new Error('Missing channelId'); } @@ -149,7 +149,7 @@ export class MemoryTranscriptStore implements TranscriptStore { * @param channelId Channel Id where conversation took place. * @param conversationId Id of the conversation to delete. */ - public deleteTranscript(channelId: string, conversationId: string): Promise { + deleteTranscript(channelId: string, conversationId: string): Promise { if (!channelId) { throw new Error('Missing channelId'); } diff --git a/libraries/botbuilder-core/src/messageFactory.ts b/libraries/botbuilder-core/src/messageFactory.ts index 240bf6135c..4893721550 100644 --- a/libraries/botbuilder-core/src/messageFactory.ts +++ b/libraries/botbuilder-core/src/messageFactory.ts @@ -49,7 +49,7 @@ export class MessageFactory { * @param speak (Optional) SSML to include in the message. * @param inputHint (Optional) input hint for the message. Defaults to `acceptingInput`. */ - public static text(text: string, speak?: string, inputHint?: InputHints | string): Partial { + static text(text: string, speak?: string, inputHint?: InputHints | string): Partial { const msg: Partial = { type: ActivityTypes.Message, text: text, @@ -76,7 +76,7 @@ export class MessageFactory { * @param speak (Optional) SSML to include with the message. * @param inputHint (Optional) input hint for the message. Defaults to `acceptingInput`. */ - public static suggestedActions( + static suggestedActions( actions: (CardAction | string)[], text?: string, speak?: string, @@ -119,7 +119,7 @@ export class MessageFactory { * @param speak (Optional) SSML to include with the message. * @param inputHint (Optional) input hint for the message. Defaults to `acceptingInput`. */ - public static attachment( + static attachment( attachment: Attachment, text?: string, speak?: string, @@ -146,7 +146,7 @@ export class MessageFactory { * @param speak (Optional) SSML to include with the message. * @param inputHint (Optional) input hint for the message. */ - public static list( + static list( attachments: Attachment[], text?: string, speak?: string, @@ -173,7 +173,7 @@ export class MessageFactory { * @param speak (Optional) SSML to include with the message. * @param inputHint (Optional) input hint for the message. */ - public static carousel( + static carousel( attachments: Attachment[], text?: string, speak?: string, @@ -198,7 +198,7 @@ export class MessageFactory { * @param speak (Optional) SSML to include with the message. * @param inputHint (Optional) input hint for the message. */ - public static contentUrl( + static contentUrl( url: string, contentType: string, name?: string, diff --git a/libraries/botbuilder-core/src/middlewareSet.ts b/libraries/botbuilder-core/src/middlewareSet.ts index 7889fa10c6..03f924963d 100644 --- a/libraries/botbuilder-core/src/middlewareSet.ts +++ b/libraries/botbuilder-core/src/middlewareSet.ts @@ -82,7 +82,7 @@ export class MiddlewareSet implements Middleware { * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param next Delegate to call to continue the bot middleware pipeline. */ - public onTurn(context: TurnContext, next: () => Promise): Promise { + onTurn(context: TurnContext, next: () => Promise): Promise { return this.run(context, next); } @@ -101,7 +101,7 @@ export class MiddlewareSet implements Middleware { * ``` * @param middleware One or more middleware handlers(s) to register. */ - public use(...middlewares: (MiddlewareHandler | Middleware)[]): this { + use(...middlewares: (MiddlewareHandler | Middleware)[]): this { middlewares.forEach((plugin) => { if (typeof plugin === 'function') { this.middleware.push(plugin); @@ -121,7 +121,7 @@ export class MiddlewareSet implements Middleware { * @param next Function to invoke at the end of the middleware chain. * @returns A promise that resolves after the handler chain is complete. */ - public run(context: TurnContext, next: () => Promise): Promise { + run(context: TurnContext, next: () => Promise): Promise { const runHandlers = ([handler, ...remaining]: MiddlewareHandler[]) => { try { return Promise.resolve(handler ? handler(context, () => runHandlers(remaining)) : next()); diff --git a/libraries/botbuilder-core/src/privateConversationState.ts b/libraries/botbuilder-core/src/privateConversationState.ts index 368e222d4b..2b8ba068d7 100644 --- a/libraries/botbuilder-core/src/privateConversationState.ts +++ b/libraries/botbuilder-core/src/privateConversationState.ts @@ -45,7 +45,7 @@ export class PrivateConversationState extends BotState { * Returns the storage key for the current PrivateConversation state. * @param context Context for current turn of PrivateConversation with the user. */ - public getStorageKey(context: TurnContext): string | undefined { + getStorageKey(context: TurnContext): string | undefined { const activity: Activity = context.activity; const channelId: string = activity.channelId; const conversationId: string = diff --git a/libraries/botbuilder-core/src/queueStorage.ts b/libraries/botbuilder-core/src/queueStorage.ts index 01cba6cce5..cbb70cedf8 100644 --- a/libraries/botbuilder-core/src/queueStorage.ts +++ b/libraries/botbuilder-core/src/queueStorage.ts @@ -20,7 +20,7 @@ export abstract class QueueStorage { * @param {number} visibilityTimeout Visibility timeout in seconds. Optional with a default value of 0. Cannot be larger than 7 days. * @param {number} timeToLive Specifies the time-to-live interval for the message in seconds. */ - public abstract queueActivity( + abstract queueActivity( activity: Partial, visibilityTimeout?: number, timeToLive?: number diff --git a/libraries/botbuilder-core/src/registerClassMiddleware.ts b/libraries/botbuilder-core/src/registerClassMiddleware.ts index 28a16f11f5..2e6eea3324 100644 --- a/libraries/botbuilder-core/src/registerClassMiddleware.ts +++ b/libraries/botbuilder-core/src/registerClassMiddleware.ts @@ -20,7 +20,7 @@ export class RegisterClassMiddleware implements Middleware { * @param service The object or service to add. * @param key The key for service object in turn state. */ - public constructor(service: T, key: string | symbol) { + constructor(service: T, key: string | symbol) { this.service = service; this._key = key; } @@ -28,17 +28,17 @@ export class RegisterClassMiddleware implements Middleware { /** * The object or service to add to the turn context. */ - public service: T; + service: T; /** * Adds the associated object or service to the current turn context. * @param turnContext The context object for this turn. * @param next The delegate to call to continue the bot middleware pipeline. */ - public async onTurn(turnContext: TurnContext, next: () => Promise): Promise { + async onTurn(turnContext: TurnContext, next: () => Promise): Promise { turnContext.turnState.set(this._key, this.service); if (next) { await next(); } } -} \ No newline at end of file +} diff --git a/libraries/botbuilder-core/src/showTypingMiddleware.ts b/libraries/botbuilder-core/src/showTypingMiddleware.ts index 042bb641f2..bb378f6774 100644 --- a/libraries/botbuilder-core/src/showTypingMiddleware.ts +++ b/libraries/botbuilder-core/src/showTypingMiddleware.ts @@ -41,7 +41,7 @@ export class ShowTypingMiddleware implements Middleware { * @param context {TurnContext} An incoming TurnContext object. * @param next {function} The next delegate function. */ - public async onTurn(context: TurnContext, next: () => Promise) { + async onTurn(context: TurnContext, next: () => Promise) { let finished = false; let timeout: ReturnType; diff --git a/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts b/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts index 6b6fd29e24..4e2201805e 100644 --- a/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts +++ b/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts @@ -14,7 +14,7 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { super(); } - public async createSkillConversationIdWithOptions(options: SkillConversationIdFactoryOptions): Promise { + async createSkillConversationIdWithOptions(options: SkillConversationIdFactoryOptions): Promise { const conversationReference = TurnContext.getConversationReference(options.activity); const skillConversationId = uuid(); @@ -29,7 +29,7 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { return skillConversationId; } - public async getSkillConversationReference(skillConversationId: string): Promise { + async getSkillConversationReference(skillConversationId: string): Promise { const skillConversationInfo = await this.storage.read([skillConversationId]); if (!skillConversationInfo) { return undefined!; // eslint-disable-line @typescript-eslint/no-non-null-assertion diff --git a/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts b/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts index 7289e8072c..1fd40d40cd 100644 --- a/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts +++ b/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts @@ -21,7 +21,7 @@ export abstract class SkillConversationIdFactoryBase { * @param conversationReference The skill's caller ConversationReference. * @returns A unique conversation ID used to communicate with the skill. */ - public createSkillConversationIdWithOptions(options: SkillConversationIdFactoryOptions): Promise { + createSkillConversationIdWithOptions(options: SkillConversationIdFactoryOptions): Promise { throw new Error('Not Implemented'); } @@ -33,7 +33,7 @@ export abstract class SkillConversationIdFactoryBase { * @param conversationReference The skill's caller ConversationReference. * @returns A unique conversation ID used to communicate with the skill. */ - public createSkillConversationId(conversationReference: ConversationReference): Promise { + createSkillConversationId(conversationReference: ConversationReference): Promise { throw new Error('Not Implemented'); } @@ -43,7 +43,7 @@ export abstract class SkillConversationIdFactoryBase { * @param skillConversationId >A skill conversationId created using createSkillConversationId(). * @returns The caller's ConversationReference for a skillConversationId. null if not found. */ - public getConversationReference(skillConversationId: string): Promise { + getConversationReference(skillConversationId: string): Promise { throw new Error('Not Implemented'); } @@ -51,7 +51,7 @@ export abstract class SkillConversationIdFactoryBase { * Gets the SkillConversationReference created using createSkillConversationId() for a skillConversationId. * @param skillConversationId Gets the SkillConversationReference used during createSkillConversationId for a skillConversationId. */ - public getSkillConversationReference(skillConversationId: string): Promise { + getSkillConversationReference(skillConversationId: string): Promise { throw new Error('Not Implemented'); } @@ -59,5 +59,5 @@ export abstract class SkillConversationIdFactoryBase { * Deletes a ConversationReference. * @param skillConversationId A skill conversationId created using createSkillConversationId(). */ - public abstract deleteConversationReference(skillConversationId: string): Promise; + abstract deleteConversationReference(skillConversationId: string): Promise; } diff --git a/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts b/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts index 2bdbd0deee..2bba4d2f14 100644 --- a/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts +++ b/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts @@ -25,7 +25,7 @@ export class SkypeMentionNormalizeMiddleware implements Middleware { * Performs the normalization of Skype mention Entities. * @param activity [Activity](xref:botframework-schema.Activity) containing the mentions to normalize. */ - public static normalizeSkypeMentionText(activity: Activity): void { + static normalizeSkypeMentionText(activity: Activity): void { if (activity.channelId === 'skype' && activity.type === 'message') { activity.entities.map((element): void => { if (element.type === 'mention') { @@ -45,7 +45,7 @@ export class SkypeMentionNormalizeMiddleware implements Middleware { * @param turnContext [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation. * @param next Delegate to call to continue the bot middleware pipeline. */ - public async onTurn(turnContext: TurnContext, next: () => Promise): Promise { + async onTurn(turnContext: TurnContext, next: () => Promise): Promise { SkypeMentionNormalizeMiddleware.normalizeSkypeMentionText(turnContext.activity); await next(); } diff --git a/libraries/botbuilder-core/src/stringUtils.ts b/libraries/botbuilder-core/src/stringUtils.ts index 6d5186ceb7..c4f208e0ed 100644 --- a/libraries/botbuilder-core/src/stringUtils.ts +++ b/libraries/botbuilder-core/src/stringUtils.ts @@ -15,7 +15,7 @@ export class StringUtils { * @param text Text. * @param length Length to truncate text. */ - public static ellipsis(text: string, length: number): string { + static ellipsis(text: string, length: number): string { text = text || ''; if (text.length <= length) { return text; @@ -34,7 +34,7 @@ export class StringUtils { * * @param text Text to hash. */ - public static hash(text: string): string { + static hash(text: string): string { const length = text.length; let hash = 0; for (let i = 0; i < length; i++) { @@ -50,7 +50,7 @@ export class StringUtils { * @param text Text to truncate. * @param length Length to truncate at. */ - public static ellipsisHash(text: string, length: number): string { + static ellipsisHash(text: string, length: number): string { text = text || ''; if (text.length <= length) { return text; diff --git a/libraries/botbuilder-core/src/telemetryConstants.ts b/libraries/botbuilder-core/src/telemetryConstants.ts index fb4d0ca3eb..1c1e53e2bb 100644 --- a/libraries/botbuilder-core/src/telemetryConstants.ts +++ b/libraries/botbuilder-core/src/telemetryConstants.ts @@ -8,75 +8,75 @@ export class TelemetryConstants { /** * The telemetry property value for channel id. */ - public static readonly channelIdProperty: string = 'channelId'; + static readonly channelIdProperty: string = 'channelId'; /** * The telemetry property value for conversation id. */ - public static readonly conversationIdProperty: string = 'conversationId'; + static readonly conversationIdProperty: string = 'conversationId'; /** * The telemetry property value for conversation name. */ - public static readonly conversationNameProperty: string = 'conversationName'; + static readonly conversationNameProperty: string = 'conversationName'; /** * The telemetry property value for dialog id. */ - public static readonly dialogIdProperty: string = 'dialogId'; + static readonly dialogIdProperty: string = 'dialogId'; /** * The telemetry property value for from id. */ - public static readonly fromIdProperty: string = 'fromId'; + static readonly fromIdProperty: string = 'fromId'; /** * The telemetry property value for from name. */ - public static readonly fromNameProperty: string = 'fromName'; + static readonly fromNameProperty: string = 'fromName'; /** * The telemetry property value for locale. */ - public static readonly localeProperty: string = 'locale'; + static readonly localeProperty: string = 'locale'; /** * The telemetry property value for recipient id. */ - public static readonly recipientIdProperty: string = 'recipientId'; + static readonly recipientIdProperty: string = 'recipientId'; /** * The telemetry property value for recipient name. */ - public static readonly recipientNameProperty: string = 'recipientName'; + static readonly recipientNameProperty: string = 'recipientName'; /** * The telemetry property value for reply activity id. */ - public static readonly replyActivityIdProperty: string = 'replyActivityId'; + static readonly replyActivityIdProperty: string = 'replyActivityId'; /** * The telemetry property value for text. */ - public static readonly textProperty: string = 'text'; + static readonly textProperty: string = 'text'; /** * The telemetry property value for speak. */ - public static readonly speakProperty: string = 'speak'; + static readonly speakProperty: string = 'speak'; /** * The telemetry property value for user id. */ - public static readonly userIdProperty: string = 'userId'; + static readonly userIdProperty: string = 'userId'; /** * The telemetry property value for attachments. */ - public static readonly attachmentsProperty: string = 'attachments'; + static readonly attachmentsProperty: string = 'attachments'; /** * The telemetry property value for activity type. */ - public static readonly activityTypeProperty: string = 'type'; + static readonly activityTypeProperty: string = 'type'; } diff --git a/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts b/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts index 55fbdff0c0..6a6783a6dd 100644 --- a/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts +++ b/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts @@ -28,22 +28,22 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * The name of the event when when new message is received from the user. */ - public static readonly botMsgReceiveEvent: string = 'BotMessageReceived'; + static readonly botMsgReceiveEvent: string = 'BotMessageReceived'; /** * The name of the event when a message is updated by the bot. */ - public static readonly botMsgSendEvent: string = 'BotMessageSend'; + static readonly botMsgSendEvent: string = 'BotMessageSend'; /** * The name of the event when a message is updated by the bot. */ - public static readonly botMsgUpdateEvent: string = 'BotMessageUpdate'; + static readonly botMsgUpdateEvent: string = 'BotMessageUpdate'; /** * The name of the event when a message is deleted by the bot. */ - public static readonly botMsgDeleteEvent: string = 'BotMessageDelete'; + static readonly botMsgDeleteEvent: string = 'BotMessageDelete'; private readonly _telemetryClient: BotTelemetryClient; private readonly _logPersonalInformation: boolean; @@ -61,14 +61,14 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Gets a value indicating whether determines whether to log personal information that came from the user. */ - public get logPersonalInformation(): boolean { + get logPersonalInformation(): boolean { return this._logPersonalInformation; } /** * Gets the currently configured botTelemetryClient that logs the events. */ - public get telemetryClient(): BotTelemetryClient { + get telemetryClient(): BotTelemetryClient { return this._telemetryClient; } @@ -77,7 +77,7 @@ export class TelemetryLoggerMiddleware implements Middleware { * @param context The context object for this turn. * @param next The delegate to call to continue the bot middleware pipeline */ - public async onTurn(context: TurnContext, next: () => Promise): Promise { + async onTurn(context: TurnContext, next: () => Promise): Promise { if (context === null) { throw new Error('context is null'); } diff --git a/libraries/botbuilder-core/src/testAdapter.ts b/libraries/botbuilder-core/src/testAdapter.ts index 44e1c69a71..7df205fb6e 100644 --- a/libraries/botbuilder-core/src/testAdapter.ts +++ b/libraries/botbuilder-core/src/testAdapter.ts @@ -62,7 +62,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param logicOrConversation The bots logic that's under test. * @param template (Optional) activity containing default values to assign to all test messages received. */ - public constructor( + constructor( logicOrConversation?: ((context: TurnContext) => Promise) | ConversationReference, template?: Partial, sendTraceActivity = false @@ -94,38 +94,38 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @private * INTERNAL: used to drive the promise chain forward when running tests. */ - public get activityBuffer(): Partial[] { + get activityBuffer(): Partial[] { return this.activeQueue; } /** * Gets a value indicating whether to send trace activities. */ - public get enableTrace(): boolean { + get enableTrace(): boolean { return this._sendTraceActivity; } /** * Sets a value inidicating whether to send trace activities. */ - public set enableTrace(value: boolean) { + set enableTrace(value: boolean) { this._sendTraceActivity = value; } /** * Gets or sets the locale for the conversation. */ - public locale = 'en-us'; + locale = 'en-us'; /** * Gets the queue of responses from the bot. */ - public readonly activeQueue: Partial[] = []; + readonly activeQueue: Partial[] = []; /** * Gets or sets a reference to the current conversation. */ - public conversation: ConversationReference; + conversation: ConversationReference; /** * Create a ConversationReference. @@ -133,7 +133,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param user name of the user (also id) default: User1. * @param bot name of the bot (also id) default: Bot. */ - public static createConversation(name: string, user = 'User1', bot = 'Bot'): ConversationReference { + static createConversation(name: string, user = 'User1', bot = 'Bot'): ConversationReference { const conversationReference: ConversationReference = { channelId: Channels.Test, serviceUrl: 'https://test.com', @@ -148,7 +148,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Dequeues and returns the next bot response from the activeQueue */ - public getNextReply(): Partial { + getNextReply(): Partial { if (this.activeQueue.length > 0) { return this.activeQueue.shift(); } @@ -159,7 +159,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * Creates a message activity from text and the current conversational context. * @param text The message text. */ - public makeActivity(text?: string): Partial { + makeActivity(text?: string): Partial { const activity: Partial = { type: ActivityTypes.Message, locale: this.locale, @@ -178,14 +178,14 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param userSays The text of the user's message. * @param callback The bot logic to invoke. */ - public sendTextToBot(userSays: string, callback: (context: TurnContext) => Promise): Promise { + sendTextToBot(userSays: string, callback: (context: TurnContext) => Promise): Promise { return this.processActivity(this.makeActivity(userSays), callback); } /** * `Activity` template that will be merged with all activities sent to the logic under test. */ - public readonly template: Partial; + readonly template: Partial; private _logic: (context: TurnContext) => Promise; private _sendTraceActivity = false; @@ -198,7 +198,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param activity The activity to process. * @param callback The bot logic to invoke. */ - public async processActivity( + async processActivity( activity: string | Partial, callback?: (context: TurnContext) => Promise ): Promise { @@ -232,7 +232,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param context Context object for the current turn of conversation with the user. * @param activities Set of activities sent by logic under test. */ - public async sendActivities(context: TurnContext, activities: Partial[]): Promise { + async sendActivities(context: TurnContext, activities: Partial[]): Promise { if (!context) { throw new Error('TurnContext cannot be null.'); } @@ -282,7 +282,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param activity Activity being updated. * @returns promise representing async operation */ - public updateActivity(context: TurnContext, activity: Partial): Promise { + updateActivity(context: TurnContext, activity: Partial): Promise { if (activity.id) { const idx = this.activeQueue.findIndex((a) => a.id === activity.id); if (idx !== -1) { @@ -300,7 +300,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param context Context object for the current turn of conversation with the user. * @param reference `ConversationReference` for activity being deleted. */ - public deleteActivity(context: TurnContext, reference: Partial): Promise { + deleteActivity(context: TurnContext, reference: Partial): Promise { if (reference.activityId) { const idx = this.activeQueue.findIndex((a) => a.id === reference.activityId); if (idx !== -1) { @@ -317,7 +317,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * This will cause the adapters middleware pipe to be run and it's logic to be called. * @param activity Text or activity from user. The current conversation reference [template](#template) will be merged the passed in activity to properly address the activity. Fields specified in the activity override fields in the template. */ - public receiveActivity(activity: string | Partial): Promise { + receiveActivity(activity: string | Partial): Promise { return this.processActivity(activity); } @@ -325,7 +325,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * The `TestAdapter` doesn't implement `continueConversation()` and will return an error if it's * called. */ - public continueConversation( + continueConversation( reference: Partial, logic: (revocableContext: TurnContext) => Promise ): Promise { @@ -357,7 +357,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * ``` * @param userSays Text or activity simulating user input. */ - public send(userSays: string | Partial): TestFlow { + send(userSays: string | Partial): TestFlow { return new TestFlow(this.processActivity(userSays), this); } @@ -377,7 +377,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. */ - public test( + test( userSays: string | Partial, expected: string | Partial | ((activity: Partial, description?: string) => void), description?: string, @@ -396,7 +396,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. */ - public testActivities(activities: Partial[], description?: string, timeout?: number): TestFlow { + testActivities(activities: Partial[], description?: string, timeout?: number): TestFlow { if (!activities) { throw new Error('Missing array of activities'); } @@ -428,7 +428,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param token The token to store. * @param magicCode (Optional) The optional magic code to associate with this token. */ - public addUserToken(connectionName: string, channelId: string, userId: string, token: string, magicCode?: string) { + addUserToken(connectionName: string, channelId: string, userId: string, token: string, magicCode?: string) { const key: UserToken = new UserToken(); key.channelId = channelId; key.connectionName = connectionName; @@ -457,7 +457,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * * @returns The [TokenStatus](xref:botframework-connector.TokenStatus) objects retrieved. */ - public async getTokenStatus( + async getTokenStatus( context: TurnContext, userId: string, includeFilter?: string, @@ -496,7 +496,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. */ - public async getUserToken( + async getUserToken( context: TurnContext, connectionName: string, magicCode?: string @@ -530,7 +530,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param connectionName Name of the auth connection to use. * @param userId User ID to sign out. */ - public async signOutUser(context: TurnContext, connectionName?: string, userId?: string): Promise { + async signOutUser(context: TurnContext, connectionName?: string, userId?: string): Promise { const channelId = context.activity.channelId; userId = userId || context.activity.from.id; this._userTokens = this._userTokens.filter( @@ -545,7 +545,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ - public async getSignInLink(context: TurnContext, connectionName: string): Promise { + async getSignInLink(context: TurnContext, connectionName: string): Promise { return `https://fake.com/oauthsignin/${connectionName}/${context.activity.channelId}/${context.activity.from.id}`; } @@ -554,7 +554,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ - public async getAadTokens( + async getAadTokens( context: TurnContext, connectionName: string, resourceUrls: string[] @@ -574,7 +574,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param exchangeableItem Exchangeable token or resource URI. * @param token Token to store. */ - public addExchangeableToken( + addExchangeableToken( connectionName: string, channelId: string, userId: string, @@ -598,7 +598,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param finalRedirect Final redirect URL. * @returns A `Promise` with a new [SignInUrlResponse](xref:botframework-schema.SignInUrlResponse) object. */ - public async getSignInResource( + async getSignInResource( context: TurnContext, connectionName: string, userId?: string, @@ -622,7 +622,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param tokenExchangeRequest Exchange request details, either a token to exchange or a uri to exchange. * @returns If the promise completes, the exchanged token is returned. */ - public async exchangeToken( + async exchangeToken( context: TurnContext, connectionName: string, userId: string, @@ -659,7 +659,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider * @param userId The user id. * @param exchangeableItem The exchangeable token or resource URI. */ - public throwOnExchangeRequest( + throwOnExchangeRequest( connectionName: string, channelId: string, userId: string, @@ -694,12 +694,12 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider } class UserToken { - public connectionName: string; - public userId: string; - public channelId: string; - public token: string; + connectionName: string; + userId: string; + channelId: string; + token: string; - public equalsKey(rhs: UserToken): boolean { + equalsKey(rhs: UserToken): boolean { return ( rhs && this.connectionName === rhs.connectionName && @@ -710,18 +710,18 @@ class UserToken { } class TokenMagicCode { - public key: UserToken; - public magicCode: string; + key: UserToken; + magicCode: string; } class ExchangeableToken extends UserToken { - public exchangeableItem: string; + exchangeableItem: string; - public equalsKey(rhs: ExchangeableToken): boolean { + equalsKey(rhs: ExchangeableToken): boolean { return rhs != null && this.exchangeableItem === rhs.exchangeableItem && super.equalsKey(rhs); } - public toKey(): string { + toKey(): string { return this.exchangeableItem; } } @@ -772,7 +772,7 @@ export class TestFlow { * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. */ - public test( + test( userSays: string | Partial, expected: string | Partial | ((activity: Partial, description?: string) => void), description?: string, @@ -785,7 +785,7 @@ export class TestFlow { * Sends something to the bot. * @param userSays Text or activity simulating user input. */ - public send(userSays: string | Partial): TestFlow { + send(userSays: string | Partial): TestFlow { return new TestFlow( this.previous.then(() => this.adapter.processActivity(userSays, this.callback)), this.adapter, @@ -798,7 +798,7 @@ export class TestFlow { * * @returns {TestFlow} A new TestFlow object. */ - public sendConversationUpdate(): TestFlow { + sendConversationUpdate(): TestFlow { return new TestFlow( this.previous.then(() => { const cu = ActivityEx.createConversationUpdateActivity(); @@ -817,7 +817,7 @@ export class TestFlow { * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. */ - public assertReply( + assertReply( expected: string | Partial | TestActivityInspector, description?: string, timeout?: number @@ -896,7 +896,7 @@ export class TestFlow { * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. */ - public assertNoReply(description?: string, timeout?: number): TestFlow { + assertNoReply(description?: string, timeout?: number): TestFlow { return new TestFlow( this.previous.then(() => { // tslint:disable-next-line:promise-must-complete @@ -939,7 +939,7 @@ export class TestFlow { * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. */ - public assertReplyOneOf(candidates: string[], description?: string, timeout?: number): TestFlow { + assertReplyOneOf(candidates: string[], description?: string, timeout?: number): TestFlow { return this.assertReply( (activity: Partial, description2: string) => { for (const candidate of candidates) { @@ -962,7 +962,7 @@ export class TestFlow { * Inserts a delay before continuing. * @param ms ms to wait */ - public delay(ms: number): TestFlow { + delay(ms: number): TestFlow { return new TestFlow( this.previous.then(() => { return new Promise((resolve: any, reject: any): void => { @@ -978,16 +978,16 @@ export class TestFlow { * Adds a `then()` step to the tests promise chain. * @param onFulfilled Code to run if the test is currently passing. */ - public then(onFulfilled?: () => void, onRejected?: (err) => void): TestFlow { + then(onFulfilled?: () => void, onRejected?: (err) => void): TestFlow { return new TestFlow(this.previous.then(onFulfilled, onRejected), this.adapter, this.callback); } /** * Adds a finally clause. Note that you can't keep chaining afterwards. - * @param onFinally - * @returns + * @param onFinally + * @returns */ - public finally(onFinally: () => void): Promise { + finally(onFinally: () => void): Promise { return Promise.resolve(this.previous.finally(onFinally)); } @@ -995,14 +995,14 @@ export class TestFlow { * Adds a `catch()` clause to the tests promise chain. * @param onRejected Code to run if the test has thrown an error. */ - public catch(onRejected?: (reason: any) => void): TestFlow { + catch(onRejected?: (reason: any) => void): TestFlow { return new TestFlow(this.previous.catch(onRejected), this.adapter, this.callback); } /** * Start the test sequence, returning a promise to await */ - public startTest(): Promise { + startTest(): Promise { return this.previous; } } diff --git a/libraries/botbuilder-core/src/transcriptLogger.ts b/libraries/botbuilder-core/src/transcriptLogger.ts index 0998a65aa8..477eacaaf2 100644 --- a/libraries/botbuilder-core/src/transcriptLogger.ts +++ b/libraries/botbuilder-core/src/transcriptLogger.ts @@ -40,7 +40,7 @@ export class TranscriptLoggerMiddleware implements Middleware { * @param context Context for the current turn of conversation with the user. * @param next Function to call at the end of the middleware chain. */ - public async onTurn(context: TurnContext, next: () => Promise): Promise { + async onTurn(context: TurnContext, next: () => Promise): Promise { const transcript: Activity[] = []; // log incoming activity at beginning of turn @@ -190,7 +190,7 @@ export class ConsoleTranscriptLogger implements TranscriptLogger { * Log an activity to the transcript. * @param activity Activity being logged. */ - public logActivity(activity: Activity): void | Promise { + logActivity(activity: Activity): void | Promise { if (!activity) { throw new Error('Activity is required.'); } diff --git a/libraries/botbuilder-core/src/turnContext.ts b/libraries/botbuilder-core/src/turnContext.ts index 9df2ef0084..a8dcfd3a2c 100644 --- a/libraries/botbuilder-core/src/turnContext.ts +++ b/libraries/botbuilder-core/src/turnContext.ts @@ -207,7 +207,7 @@ export class TurnContext { * **See also** * - [removeMentionText](xref:botbuilder-core.TurnContext.removeMentionText) */ - public static removeRecipientMention(activity: Partial): string { + static removeRecipientMention(activity: Partial): string { return TurnContext.removeMentionText(activity, activity.recipient.id); } @@ -241,7 +241,7 @@ export class TurnContext { * **See also** * - [removeRecipientMention](xref:botbuilder-core.TurnContext.removeRecipientMention) */ - public static removeMentionText(activity: Partial, id: string): string { + static removeMentionText(activity: Partial, id: string): string { const mentions = TurnContext.getMentions(activity); const mentionsFiltered = mentions.filter((mention): boolean => mention.mentioned.id === id); if (mentionsFiltered.length) { @@ -266,7 +266,7 @@ export class TurnContext { * const mentions = TurnContext.getMentions(turnContext.request); * ``` */ - public static getMentions(activity: Partial): Mention[] { + static getMentions(activity: Partial): Mention[] { const result: Mention[] = []; if (activity.entities !== undefined) { for (let i = 0; i < activity.entities.length; i++) { @@ -295,7 +295,7 @@ export class TurnContext { * * - [BotAdapter.continueConversation](xref:botbuilder-core.BotAdapter.continueConversation) */ - public static getConversationReference(activity: Partial): Partial { + static getConversationReference(activity: Partial): Partial { return { activityId: getAppropriateReplyToId(activity), user: shallowCopy(activity.from), @@ -321,7 +321,7 @@ export class TurnContext { * method on an incoming activity to get a conversation reference that you can then use * to update an outgoing activity with the correct delivery information. */ - public static applyConversationReference( + static applyConversationReference( activity: Partial, reference: Partial, isIncoming = false @@ -369,7 +369,7 @@ export class TurnContext { * - [deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) * - [updateActivity](xref:botbuilder-core.TurnContext.updateActivity) */ - public static getReplyConversationReference( + static getReplyConversationReference( activity: Partial, reply: ResourceResponse ): Partial { @@ -384,7 +384,7 @@ export class TurnContext { /** * List of activities to send when `context.activity.deliveryMode == 'expectReplies'`. */ - public readonly bufferedReplyActivities: Partial[] = []; + readonly bufferedReplyActivities: Partial[] = []; /** * Asynchronously sends an activity to the sender of the incoming activity. @@ -406,7 +406,7 @@ export class TurnContext { * * - [sendActivities](xref:botbuilder-core.TurnContext.sendActivities) */ - public sendTraceActivity( + sendTraceActivity( name: string, value?: any, valueType?: string, @@ -453,7 +453,7 @@ export class TurnContext { * - [updateActivity](xref:botbuilder-core.TurnContext.updateActivity) * - [deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) */ - public async sendActivity( + async sendActivity( activityOrText: string | Partial, speak?: string, inputHint?: string @@ -500,7 +500,7 @@ export class TurnContext { * - [updateActivity](xref:botbuilder-core.TurnContext.updateActivity) * - [deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) */ - public sendActivities(activities: Partial[]): Promise { + sendActivities(activities: Partial[]): Promise { let sentNonTraceActivity = false; const ref = TurnContext.getConversationReference(this.activity); const output = activities.map((activity) => { @@ -580,7 +580,7 @@ export class TurnContext { * - [deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) * - [getReplyConversationReference](xref:botbuilder-core.TurnContext.getReplyConversationReference) */ - public updateActivity(activity: Partial): Promise { + updateActivity(activity: Partial): Promise { const ref: Partial = TurnContext.getConversationReference(this.activity); const a: Partial = TurnContext.applyConversationReference(activity, ref); return this.emit(this._onUpdateActivity, a, () => this.adapter.updateActivity(this, a)); @@ -610,7 +610,7 @@ export class TurnContext { * - [updateActivity](xref:botbuilder-core.TurnContext.updateActivity) * - [getReplyConversationReference](xref:botbuilder-core.TurnContext.getReplyConversationReference) */ - public deleteActivity(idOrReference: string | Partial): Promise { + deleteActivity(idOrReference: string | Partial): Promise { let reference: Partial; if (typeof idOrReference === 'string') { reference = TurnContext.getConversationReference(this.activity); @@ -647,7 +647,7 @@ export class TurnContext { * }); * ``` */ - public onSendActivities(handler: SendActivitiesHandler): this { + onSendActivities(handler: SendActivitiesHandler): this { this._onSendActivities.push(handler); return this; @@ -677,7 +677,7 @@ export class TurnContext { * }); * ``` */ - public onUpdateActivity(handler: UpdateActivityHandler): this { + onUpdateActivity(handler: UpdateActivityHandler): this { this._onUpdateActivity.push(handler); return this; @@ -707,7 +707,7 @@ export class TurnContext { * }); * ``` */ - public onDeleteActivity(handler: DeleteActivityHandler): this { + onDeleteActivity(handler: DeleteActivityHandler): this { this._onDeleteActivity.push(handler); return this; @@ -740,7 +740,7 @@ export class TurnContext { /** * Gets the bot adapter that created this context object. */ - public get adapter(): BotAdapter { + get adapter(): BotAdapter { return this._adapter as BotAdapter; } @@ -754,7 +754,7 @@ export class TurnContext { * const utterance = (context.activity.text || '').trim(); * ``` */ - public get activity(): Activity { + get activity(): Activity { return this._activity as Activity; } @@ -775,14 +775,14 @@ export class TurnContext { * } * ``` */ - public get responded(): boolean { + get responded(): boolean { return this._respondedRef.responded; } /** * Gets the locale stored in the turnState. */ - public get locale(): string | undefined { + get locale(): string | undefined { const turnObj = this._turnState[this._turn]; const locale = turnObj[this._locale]; if (typeof locale === 'string') { @@ -795,7 +795,7 @@ export class TurnContext { /** * Sets the locale stored in the turnState. */ - public set locale(value: string | undefined) { + set locale(value: string | undefined) { const turnObj = this._turnState[this._turn]; if (turnObj) { turnObj[this._locale] = value; @@ -813,7 +813,7 @@ export class TurnContext { * update the responded flag. You can call this method directly to indicate that your bot has * responded appropriately to the incoming activity. */ - public set responded(value: boolean) { + set responded(value: boolean) { if (!value) { throw new Error(`TurnContext: cannot set 'responded' to a value of 'false'.`); } @@ -839,7 +839,7 @@ export class TurnContext { * > When creating middleware or a third-party component, use a unique symbol for your cache key * > to avoid state naming collisions with the bot or other middleware or components. */ - public get turnState(): TurnContextStateCollection { + get turnState(): TurnContextStateCollection { return this._turnState; } diff --git a/libraries/botbuilder-core/src/turnContextStateCollection.ts b/libraries/botbuilder-core/src/turnContextStateCollection.ts index 5d4c310c3d..d9e4a0162f 100644 --- a/libraries/botbuilder-core/src/turnContextStateCollection.ts +++ b/libraries/botbuilder-core/src/turnContextStateCollection.ts @@ -16,14 +16,14 @@ export class TurnContextStateCollection extends Map { * Gets a typed value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). * @param key The values key. */ - public get(key: any): T; + get(key: any): T; /** * Gets a value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). * @param key The values key. */ - public get(key: any): any; - public get(key: any): unknown { + get(key: any): any; + get(key: any): unknown { return super.get(key); } @@ -34,7 +34,7 @@ export class TurnContextStateCollection extends Map { * @param key The values key. * @param value The new value. */ - public push(key: any, value: any): void { + push(key: any, value: any): void { // Get current value and add to scope cache const current = this.get(key); const cache: Map = this.get(TURN_STATE_SCOPE_CACHE) || new Map(); @@ -57,7 +57,7 @@ export class TurnContextStateCollection extends Map { * @param key The values key. * @returns The removed value. */ - public pop(key: any): any { + pop(key: any): any { // Get current value const current = this.get(key); diff --git a/libraries/botbuilder-core/src/userState.ts b/libraries/botbuilder-core/src/userState.ts index 8c9b5d6b10..53f3dd18ef 100644 --- a/libraries/botbuilder-core/src/userState.ts +++ b/libraries/botbuilder-core/src/userState.ts @@ -44,7 +44,7 @@ export class UserState extends BotState { * Returns the storage key for the current user state. * @param context Context for current turn of conversation with the user. */ - public getStorageKey(context: TurnContext): string | undefined { + getStorageKey(context: TurnContext): string | undefined { const activity: Activity = context.activity; const channelId: string = activity.channelId; const userId: string = activity && activity.from && activity.from.id ? activity.from.id : undefined;