From dc973a85d631c07238c7709fb18e6905af858557 Mon Sep 17 00:00:00 2001 From: Yuki Nagai Date: Tue, 15 Aug 2017 09:03:44 +0900 Subject: [PATCH] Add middleware property to Controller interface --- lib/Botkit.d.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/Botkit.d.ts b/lib/Botkit.d.ts index 666d86a2c..c5114a2fe 100644 --- a/lib/Botkit.d.ts +++ b/lib/Botkit.d.ts @@ -87,15 +87,30 @@ declare namespace botkit { interface ConsoleSpawnConfiguration { } interface Controller> { + readonly changeEars: HearsFunction; + readonly log: { + (...params: any[]): void; + } + readonly middleware: { + capture: { + use(bot: B, message: M, convo: Conversation, next: () => void): void; + }; + heard: { + use(bot: B, message: M, next: () => void): void; + }; + receive: { + use(bot: B, message: M, next: () => void): void; + }; + send: { + use(bot: B, message: M, next: () => void): void; + }; + } readonly storage: { users: Storage; channels: Storage; teams: Storage; }; readonly studio: Studio; - readonly log: { - (...params: any[]): void; - } hears(keywords: string | string[] | RegExp | RegExp[], events: string | string[], cb: HearsCallback): this; hears(keywords: string | string[] | RegExp | RegExp[], events: string | string[], middleware_or_cb: HearsFunction, cb: HearsCallback): this; on(event: string, cb: HearsCallback): this;