import { waitReady } from './wait-ready';

import type { TimInstanceType, TimType } from '../types';


export async function getMessageList({
  conversationId,
  // count = 15,
  nextMsgId,
  tim,
  TIM,
}: {
  tim: TimInstanceType;
  TIM: TimType;
  nextMsgId: string;
  conversationId: string;
}) {
  await waitReady(tim, TIM);

  return await tim.getMessageList({
    conversationID: conversationId,
    // count,
    nextReqMessageID: nextMsgId,
  });
}
