-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroom.ts
42 lines (35 loc) · 931 Bytes
/
room.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { UserInfo } from "../liveblocks.config";
import { DocumentRoomMetadata } from "./document";
/**
* These types are used in the Liveblocks API
* https://liveblocks.io/docs/api-reference/rest-api-endpoints
*/
export type Room = {
type: "room";
id: string;
metadata: DocumentRoomMetadata;
defaultAccesses: RoomAccess[];
groupsAccesses: RoomAccesses;
usersAccesses: RoomAccesses;
draft: "yes" | "no";
createdAt?: string;
lastConnectionAt: string;
};
export enum RoomAccess {
RoomWrite = "room:write",
RoomRead = "room:read",
RoomPresenceWrite = "room:presence:write",
}
export enum RoomAccessLevels {
USER = "user",
GROUP = "group",
DEFAULT = "default",
}
export type RoomMetadata = Record<string, string | string[]>;
export type RoomAccesses = Record<string, RoomAccess[] | null>;
export type RoomActiveUser = {
type: "user";
id: string;
connectionId: number;
info: UserInfo;
};