2024-06-12 22:10:49 +00:00
|
|
|
// Define Liveblocks types for your application
|
|
|
|
// https://liveblocks.io/docs/api-reference/liveblocks-react#Typing-your-data
|
|
|
|
declare global {
|
|
|
|
interface Liveblocks {
|
|
|
|
// Each user's Presence, for useMyPresence, useOthers, etc.
|
|
|
|
Presence: {
|
2024-07-08 00:04:37 +00:00
|
|
|
cursor: { x: number; y: number } | null;
|
2024-06-12 22:10:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// The Storage tree for the room, for useMutation, useStorage, etc.
|
|
|
|
Storage: {
|
|
|
|
// Example, a conflict-free list
|
|
|
|
// animals: LiveList<string>;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Custom user info set when authenticating with a secret key
|
|
|
|
UserMeta: {
|
|
|
|
id: string;
|
|
|
|
info: {
|
|
|
|
// Example properties, for useSelf, useUser, useOthers, etc.
|
|
|
|
// name: string;
|
|
|
|
// avatar: string;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// Custom events, for useBroadcastEvent, useEventListener
|
|
|
|
RoomEvent: {};
|
|
|
|
// Example has two events, using a union
|
|
|
|
// | { type: "PLAY" }
|
|
|
|
// | { type: "REACTION"; emoji: "🔥" };
|
|
|
|
|
|
|
|
// Custom metadata set on threads, for useThreads, useCreateThread, etc.
|
|
|
|
ThreadMetadata: {
|
|
|
|
// Example, attaching coordinates to a thread
|
|
|
|
// x: number;
|
|
|
|
// y: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Custom room info set with resolveRoomsInfo, for useRoomInfo
|
|
|
|
RoomInfo: {
|
|
|
|
// Example, rooms with a title and url
|
|
|
|
// title: string;
|
|
|
|
// url: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export {};
|