CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-slack--types

Comprehensive TypeScript type definitions for building Slack applications and integrations with the Node Slack SDK

94

1.11x
Overview
Eval results
Files

task.mdevals/scenario-6/

Slack Image Gallery Builder

Problem Statement

Build a Slack message formatter that creates an image gallery display. The formatter should accept a list of images with their metadata and create a properly structured Slack message that displays these images with context.

Requirements

Your implementation must:

  1. Accept an array of image objects, where each object contains:

    • Image URL (required)
    • Alt text description (required)
    • Title (optional)
  2. Create a Slack message that displays each image with its metadata. The message should:

    • Display images in a visually organized manner
    • Show the title above each image when provided
    • Include proper accessibility descriptions for all images
    • Separate image entries with clear visual dividers
  3. Return a valid Slack message structure that can be sent via the Slack API

Implementation Details

Create a TypeScript module with the following:

  • A src/image-gallery.ts file containing:
    • Type definition for the image input object
    • A function that takes an array of images and returns a properly typed Slack message structure

Test Cases

Implement the following test cases in src/image-gallery.test.ts:

@test Basic single image display

Given an array with one image (URL: "https://example.com/photo.jpg", alt text: "A beautiful sunset"), the function should return a valid Slack message structure that displays this image.

@test Multiple images with titles

Given an array with three images, each having a URL, alt text, and title, the function should return a Slack message that displays all three images with their titles and maintains clear visual separation between them.

@test Image without title

Given an image with only URL and alt text (no title), the function should create a valid display that includes the image with its alt text but gracefully handles the missing title.

Dependencies { .dependencies }

@slack/types { .dependency }

Provides TypeScript type definitions for Slack message structures and Block Kit components.

Deliverables

  • src/image-gallery.ts - Main implementation
  • src/image-gallery.test.ts - Test suite
  • package.json - Project configuration with @slack/types dependency

Install with Tessl CLI

npx tessl i tessl/npm-slack--types

tile.json