Skip to content

feat: add TypeScript definitions and paginated room message history#13

Open
NandanPaT-eL wants to merge 2 commits into
Aaromalpm:mainfrom
NandanPaT-eL:feature/add-typescript-definitions
Open

feat: add TypeScript definitions and paginated room message history#13
NandanPaT-eL wants to merge 2 commits into
Aaromalpm:mainfrom
NandanPaT-eL:feature/add-typescript-definitions

Conversation

@NandanPaT-eL
Copy link
Copy Markdown
Contributor

Summary

  • add src/index.d.ts so TypeScript users get types for the public API
  • add in-memory room message storage with getRoomMessages(roomId, page, limit)
  • return paginated room message history and clear it on closeRoom()
  • restore validation tests and align test expectations with current auth error messages
  • document TypeScript support, pagination behavior, and single-process limitation in the README

Details

  • sendMessage() now stores messages in memory per room
  • getRoomMessages() returns paginated results, where page 1 is the most recent messages
  • pagination is capped to a reasonable page size and room history is capped in memory to avoid unbounded growth
  • editMessage() now warns if the target message is not present in the in-memory store
  • package metadata now points to src/index.d.ts via the types field

Why

This improves developer experience for TypeScript consumers and adds a practical way to load older chat messages without fetching the full room history at once.

Notes

  • room message pagination currently uses in-memory storage, so it is intended for single-process deployments
  • verified with npm test (34 passed, 0 failed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant