Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Add middleware property to Controller interface
Browse files Browse the repository at this point in the history
  • Loading branch information
uny committed Aug 15, 2017
1 parent 70b176c commit dc973a8
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions lib/Botkit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,30 @@ declare namespace botkit {
interface ConsoleSpawnConfiguration {
}
interface Controller<S, M extends Message, B extends Bot<S, M>> {
readonly changeEars: HearsFunction<M>;
readonly log: {
(...params: any[]): void;
}
readonly middleware: {
capture: {
use(bot: B, message: M, convo: Conversation<M>, 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<User>;
channels: Storage<Channel>;
teams: Storage<Team>;
};
readonly studio: Studio<S, M, B>;
readonly log: {
(...params: any[]): void;
}
hears(keywords: string | string[] | RegExp | RegExp[], events: string | string[], cb: HearsCallback<S, M, B>): this;
hears(keywords: string | string[] | RegExp | RegExp[], events: string | string[], middleware_or_cb: HearsFunction<M>, cb: HearsCallback<S, M, B>): this;
on(event: string, cb: HearsCallback<S, M, B>): this;
Expand Down

0 comments on commit dc973a8

Please sign in to comment.