Comprehensive TypeScript type definitions for building Slack applications and integrations with the Node Slack SDK
94
Build a TypeScript utility that creates Slack modal views with configurable input fields, where specific fields can be automatically focused when the modal opens.
Create a function buildFormModal that accepts a form configuration and returns a properly typed Slack modal view structure. The configuration should specify which input field should receive initial focus when the modal is displayed to the user.
The function should accept:
The function must be properly typed using the @slack/types package to ensure:
@generates
export interface FormField {
fieldId: string;
label: string;
type: 'plain_text_input' | 'multi_line_text_input';
shouldFocus?: boolean;
}
export interface FormConfig {
title: string;
fields: FormField[];
submitLabel: string;
}
export function buildFormModal(config: FormConfig): unknown;Provides TypeScript type definitions for Slack Block Kit UI components and modal views.
Install with Tessl CLI
npx tessl i tessl/npm-slack--typesdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10