Skip to content

Commit 18f6fb5

Browse files
author
Gintautas Miselis
committed
Type cleanup
1 parent c43137d commit 18f6fb5

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

lib/index.d.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,17 @@ export declare type BotkitWatsonMessage = BotkitMessage & {
4646
export interface ContextDelta {
4747
[index: string]: any;
4848
}
49-
export declare type ErrorCallback = (err: null | Error) => null;
5049
export declare class WatsonMiddleware {
51-
private config;
50+
private readonly config;
5251
private conversation;
5352
private storage;
54-
private minimumConfidence;
53+
private readonly minimumConfidence;
5554
private readonly ignoreType;
5655
constructor(config: WatsonMiddlewareConfig);
5756
hear(patterns: string[], message: Botkit.BotkitMessage): boolean;
5857
before(message: Botkit.BotkitMessage, payload: Payload): Promise<Payload>;
5958
after(message: Botkit.BotkitMessage, response: any): Promise<any>;
60-
sendToWatson(bot: any, message: Botkit.BotkitMessage, contextDelta: ContextDelta): Promise<void>;
59+
sendToWatson(bot: Botkit.BotWorker, message: Botkit.BotkitMessage, contextDelta: ContextDelta): Promise<void>;
6160
receive(bot: Botkit.BotWorker, message: Botkit.BotkitMessage): Promise<void>;
6261
interpret(bot: Botkit.BotWorker, message: Botkit.BotkitMessage): Promise<void>;
6362
readContext(user: string): Promise<Context>;

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ export interface ContextDelta {
5858
[index: string]: any;
5959
}
6060

61-
export type ErrorCallback = (err: null | Error) => null;
62-
6361
export class WatsonMiddleware {
64-
private config: WatsonMiddlewareConfig;
62+
private readonly config: WatsonMiddlewareConfig;
6563
private conversation: AssistantV1;
6664
private storage: Storage;
67-
private minimumConfidence: number = 0.75;
65+
private readonly minimumConfidence: number = 0.75;
6866
// These are initiated by Slack itself and not from the end-user. Won't send these to WCS.
6967
private readonly ignoreType = ['presence_change', 'reconnect_url'];
7068

@@ -103,7 +101,7 @@ export class WatsonMiddleware {
103101
}
104102

105103
public async sendToWatson(
106-
bot,
104+
bot: Botkit.BotWorker,
107105
message: Botkit.BotkitMessage,
108106
contextDelta: ContextDelta,
109107
): Promise<void> {

0 commit comments

Comments
 (0)