Hiyve Components - v1.0.0
    Preparing search index...

    Interface UseSessionStateResult<T>

    State and actions returned by useSessionState hook

    interface UseSessionStateResult<T> {
        close: () => void;
        data: T;
        fileId: string | null;
        isActive: boolean;
        isFromFile: boolean;
        openExisting: (data: T, fileId: string) => void;
        setData: Dispatch<SetStateAction<T>>;
        setFileId: Dispatch<SetStateAction<string | null>>;
        startNew: (initialData?: T) => void;
    }

    Type Parameters

    • T
    Index

    Properties

    close: () => void

    Close the current session

    data: T

    Current session data

    fileId: string | null

    File ID if editing an existing session

    isActive: boolean

    Whether a session is currently active

    isFromFile: boolean

    Whether the session was loaded from a file (should be read-only)

    openExisting: (data: T, fileId: string) => void

    Open an existing session with data and file ID

    setData: Dispatch<SetStateAction<T>>

    Update the session data

    setFileId: Dispatch<SetStateAction<string | null>>

    Update the file ID

    startNew: (initialData?: T) => void

    Start a new session with optional initial data