From 6928244c5929430e2f3c48d957799bb33b30cbda Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 20 May 2022 14:18:11 +0900 Subject: [PATCH] Fix #1454 Missing type declarations in view objects (#1455) --- src/types/view/index.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/types/view/index.ts b/src/types/view/index.ts index 9acfaa03f..5124b9e49 100644 --- a/src/types/view/index.ts +++ b/src/types/view/index.ts @@ -1,5 +1,4 @@ -import { View, PlainTextElement } from '@slack/types'; -import { StringIndexed } from '../helpers'; +import { Block, KnownBlock, PlainTextElement } from '@slack/types'; import { AckFn, RespondFn } from '../utilities'; /** @@ -28,6 +27,13 @@ interface PlainTextElementOutput { emoji?: boolean; } +export interface ViewResponseUrl { + block_id: string; + action_id: string; + channel_id: string; + response_url: string; +} + /** * A Slack view_submission event wrapped in the standard metadata. * @@ -56,6 +62,7 @@ export interface ViewSubmitAction { id: string; name: string; }; + response_urls: ViewResponseUrl[]; } /** @@ -96,7 +103,7 @@ export interface ViewClosedAction { export interface ViewWorkflowStepSubmitAction extends ViewSubmitAction { trigger_id: string; - response_urls: []; + response_urls: ViewResponseUrl[]; workflow_step: { workflow_step_edit_id: string; workflow_id: string; @@ -146,7 +153,7 @@ export interface ViewOutput { bot_id: string; title: PlainTextElementOutput; type: string; - blocks: StringIndexed; // TODO: should this just be any? + blocks: (KnownBlock | Block)[]; close: PlainTextElementOutput | null; submit: PlainTextElementOutput | null; state: { @@ -167,12 +174,12 @@ export interface ViewOutput { export interface ViewUpdateResponseAction { response_action: 'update'; - view: View; + view: ViewOutput; } export interface ViewPushResponseAction { response_action: 'push'; - view: View; + view: ViewOutput; } export interface ViewClearResponseAction {