Documentation/TypeScript Declaration mismatch for GroupChannel.getMessagesByMessageId

The JS documentation for getMessagesByMessageId (GroupChannel - Documentation and specify that the argument order is messageId, then params.

This contradicts with TypeScript declaration files which specify:

    getMessagesByMessageId(params: MessageListParams, messageId: number, callback?: messageListCallback): Promise<Array<UserMessage | FileMessage | AdminMessage>>;

More generally, I’m finding there are several instances of the typescript declaration file being out of date. Is it possible that SendBird will accept external contributions to the TS declaration file, or will I just need to wait for these to updated later?

Just an example snippet of types I had to override:

  const params = new SB_INSTANCE.MessageListParams();
  params.isInclusive = false;
  params.prevResultSize = LIST_QUERY_LIMIT;
  // Incorrect sendbird.d.ts file
  ((params as unknown) as { reverse: boolean }).reverse! = true;

    lastMessageId as any /* Incorrect sendbird.d.ts file */,
    params as any /* Incorrect sendbird.d.ts file */,
    (messages, error) => {
      if (error) {
      } else {

@Jonathan_Xu We don’t accept external contributions but if you could provide me with a list of ones that you’ve noticed, I’ll be more than happy to get them corrected.


So far what I’ve noticed is:

From the message above:

  • GroupChannel.getMessagesByMessageId has the first two argument types flipped
  • The reverse property is missing from MessageListParams

Additionally. it looks like the FileMessageParams.file type is File while the documentation (FileMessageParams - Documentation) states that it is Blob or Object