Files
Draupnir/packages/matrix-basic-types
Gnuxie a8d2ea3d6d Bootstrap packages onto npm now we're monorepo. (#1069)
Preperation for 3.0.0

Part of https://github.com/the-draupnir-project/planning/issues/102.

For some dumb reason the CHANGELOG from mps was never added but ok.
2026-04-02 18:44:00 +01:00
..
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00

Matrix basic types

Do you type Matrix roomIDs, userIDs, and eventIDs as string?

Have you ever accidentally mixed the two up?

Well fear no more, this library provides distinct types for each kind of identifier, and also a wrapper for the various ways of referring to rooms.

async function acceptInvitation(
  inviteSender: StringUserID,
  room: MatrixRoomID
): Promise<Result<void>> {
  console.log(
    `accepting invitation from ${inviteSender} to ${room.toPermalink()}`
  );
  return await client.joinRoom(room.toRoomIDOrAlias(), room.getViaServers());
}