diff --git a/src/App.ts b/src/App.ts
index 2644388d3..055c82494 100644
--- a/src/App.ts
+++ b/src/App.ts
@@ -151,9 +151,9 @@ export interface ActionConstraints {
// TODO: more strict typing to allow block/action_id for block_suggestion etc.
export interface OptionsConstraints {
- type?: A["type"];
+ type?: A['type'];
block_id?: A extends SlackOptions ? string | RegExp : never;
- action_id?: A extends SlackOptions ? string | RegExp : never;
+ action_id?: A extends SlackOptions ? string | RegExp : never;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
callback_id?: Extract extends any ? string | RegExp : never;
}
@@ -793,11 +793,10 @@ export default class App
actionIdOrConstraints: string | RegExp | OptionsConstraints,
...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[]
): void {
- const constraints: OptionsConstraints =
- typeof actionIdOrConstraints === "string" ||
- util.types.isRegExp(actionIdOrConstraints)
- ? { action_id: actionIdOrConstraints }
- : actionIdOrConstraints;
+ const constraints: OptionsConstraints = typeof actionIdOrConstraints === 'string' ||
+ util.types.isRegExp(actionIdOrConstraints) ?
+ { action_id: actionIdOrConstraints } :
+ actionIdOrConstraints;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const _listeners = listeners as any; // FIXME: workaround for TypeScript 4.7 breaking changes