1.2.0 • Published 5 months ago

@the-draupnir-project/matrix-basic-types v1.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

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());
}
1.2.0

5 months ago

1.1.0

7 months ago

1.0.0

7 months ago

0.2.0

10 months ago

0.1.1

12 months ago