Added state structure #19
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
Reference in New Issue
Block a user