TS2305
Module '"@slack/web-api"' has no exported member 'Channel'.
Broken Code ❌
import { type Channel } from '@slack/web-api';
const channels: Channel[] = [];export type ConversationsListResponse = WebAPICallResult & {
channels?: Channel[];
error?: string;
needed?: string;
ok?: boolean;
provided?: string;
response_metadata?: ResponseMetadata;
};Fixed Code ✔️
The ConversationsListResponse declaration file doesn't export the Channel type, so we have to infer the type from the ConversationsListResponse itself:
import { type ConversationsListResponse } from '@slack/web-api';
const channels: ConversationsListResponse['channels'] = [];