Skip to main content
Module

x/slack_bolt/src/types/middleware.ts

TypeScript framework to build Slack apps in a flash with the latest platform features. Deno port of @slack/bolt
Latest
File
import { Logger, WebClient } from "../../deps.ts"import { SlackActionMiddlewareArgs } from "./actions/index.ts"import { SlackCommandMiddlewareArgs } from "./command/index.ts"import { SlackEventMiddlewareArgs } from "./events/index.ts"import { StringIndexed } from "./helpers.ts"import { SlackOptionsMiddlewareArgs } from "./options/index.ts"import { SlackShortcutMiddlewareArgs } from "./shortcuts/index.ts"import { SlackViewMiddlewareArgs } from "./view/index.ts"
// TODO: rename this to AnyListenerArgs, and all the constituent typesexport type AnyMiddlewareArgs = | SlackEventMiddlewareArgs | SlackActionMiddlewareArgs | SlackCommandMiddlewareArgs | SlackOptionsMiddlewareArgs | SlackViewMiddlewareArgs | SlackShortcutMiddlewareArgs
export interface AllMiddlewareArgs { context: StringIndexed logger: Logger client: WebClient // TODO: figure out how to make next non-optional next?: NextFn}
// NOTE: Args should extend AnyMiddlewareArgs, but because of contravariance for function types, including that as a// constraint would mess up the interface of App#event(), App#message(), etc.export interface Middleware<Args> { (args: Args & AllMiddlewareArgs): Promise<void>}
export type NextFn = () => Promise<void>export type { StringIndexed } from "./helpers.ts"