Skip to content

Commit f79149f

Browse files
committed
Introduce an abstraction for Room
All APIs that need to return a room will use this type.
1 parent 39d670d commit f79149f

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

packages/element-web-module-api/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type { Api, Module, ModuleFactory } from "./api";
1010
export type { Config, ConfigApi } from "./api/config";
1111
export type { I18nApi, Variables, Translations } from "./api/i18n";
1212
export type * from "./models/event";
13+
export type * from "./models/Room";
1314
export type * from "./api/custom-components";
1415
export type * from "./api/extras";
1516
export type * from "./api/legacy-modules";
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
Copyright 2025 New Vector Ltd.
3+
4+
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
5+
Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { Watchable } from "../api/watchable";
9+
10+
/**
11+
* Represents a room from element-web.
12+
* @public
13+
*/
14+
export interface Room {
15+
/**
16+
* Id of this room.
17+
*/
18+
id: string;
19+
/**
20+
* {@link Watchable} holding the name for this room.
21+
*/
22+
name: Watchable<string>;
23+
/**
24+
* Get the timestamp of the last message in this room.
25+
* @returns last active timestamp
26+
*/
27+
getLastActiveTimestamp: () => number;
28+
}

0 commit comments

Comments
 (0)