TS2305

Module '"@slack/web-api"' has no exported member 'Channel'.

Broken Code ❌

main.ts
import { type Channel } from '@slack/web-api';
 
const channels: Channel[] = [];
ConversationsListResponse.d.ts
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:

main.ts
import { type ConversationsListResponse } from '@slack/web-api';
 
const channels: ConversationsListResponse['channels'] = [];