Added state structure #19

This commit is contained in:
2025-10-15 21:01:04 +02:00
parent 68ec582d3b
commit cc4812ef3c
7 changed files with 98 additions and 135 deletions
+20
View File
@@ -0,0 +1,20 @@
import { Dispatch, RefObject, SetStateAction } from "react";
import { StringMap } from "./typeUtils";
import { UserProfile } from "@/hooks/get-user";
import { Message } from "./types";
export type SetState<T> = Dispatch<SetStateAction<T>>;
export default interface App {
node: RefObject<WebSocket | null>;
profile: UserProfile | null;
profiles: StringMap<UserProfile>;
setProfiles: SetState<StringMap<UserProfile>>;
messages: Message[];
addMessage: (v: Message) => void;
sidebarOpen: boolean;
setSidebarOpen: SetState<boolean>;
}