export type ErrorResponse = { error: string; } export function isErrorResponse(data: unknown): data is ErrorResponse { return ((data as ErrorResponse).error !== undefined); } export type Token = { token: string; userId: number; createdAt: string; expiresAt: string; } export type User = { id: number; username: string; avatar: string | null; createdAt: string; }; export type Message = { id: number; channelId: number; authorId: number; content: string; createdAt: string; }; export type Channel = { id: number; name: string; lastMessageId: number | null; createdAt: string; };