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

    Props for FileSessionHost.

    interface FileSessionHostProps {
        assignmentProps?: Record<string, unknown>;
        backgroundFiles?: {
            fileId: string;
            fileName: string;
            resourceType: string;
        }[];
        clipProps?: Record<string, unknown>;
        connectedRoom?: string | null;
        controlledFileToOpen?: FileEntry | null;
        editors?: FileEditorMap;
        emptyState?: FileSessionEmptyStateConfig;
        ensureRoom?: (roomName: string) => void;
        file: FileEntry | null;
        initialFileData?: Record<string, unknown>;
        isNewFile?: boolean;
        isReady?: boolean;
        noteProps?: Record<string, unknown>;
        onAutoCreatedAbandoned?: (file: FileEntry) => void;
        onClose: () => void;
        onError?: (error: Error) => void;
        onFileOpen?: (file: FileEntry) => void;
        onGetFileUrl?: (file: FileEntry) => Promise<string | null>;
        onResolveFileUrl?: (file: { fileId: string }) => Promise<string | null>;
        onUploadBackgroundFile?: (
            file: File,
        ) => Promise<
            { fileId: string; fileName: string; resourceType: string }
            | null,
        >;
        variant: FileSessionHostVariant;
        whiteboardProps?: Record<string, unknown>;
    }
    Index

    Properties

    assignmentProps?: Record<string, unknown>
    backgroundFiles?: { fileId: string; fileName: string; resourceType: string }[]

    Whiteboard background image list (passed through to the whiteboard editor).

    clipProps?: Record<string, unknown>
    connectedRoom?: string | null

    The currently connected room name.

    controlledFileToOpen?: FileEntry | null

    Optional external "controlled" file to open. When this changes, the host opens the new file by calling onFileOpen. Used by presenter sync in lesson rooms so students follow the teacher's file selection.

    editors?: FileEditorMap

    Editor components keyed by resource type.

    Empty state config (inline variant only). When provided, the host shows an empty state with a file list when file === null.

    ensureRoom?: (roomName: string) => void

    Switch file-ops target to a different room.

    file: FileEntry | null

    The file currently open. When null and variant is inline, the empty state is rendered (requires emptyState). When null and variant is modal, nothing is rendered.

    initialFileData?: Record<string, unknown>

    The fresh file data returned by createXxxFile() immediately after upload. Pass alongside isNewFile so the editor opens with the real metadata (notably authorId) instead of an empty {} placeholder.

    isNewFile?: boolean

    Newly created file — editors should initialize empty instead of fetching.

    isReady?: boolean

    Whether the underlying file-ops room connection is ready. Defaults to true.

    noteProps?: Record<string, unknown>
    onAutoCreatedAbandoned?: (file: FileEntry) => void

    Fires when a file that was auto-created by emptyState.autoCreateOnMount is abandoned — either the user closed it (e.g., via the title-bar close button or "Open existing") or the host unmounted (e.g., the parent navigated to a different tab). The consumer is expected to inspect the file's current server-side state and delete it if it's still in its auto-created pristine form (default name, empty content) so the user's library doesn't accumulate orphan blanks.

    onClose: () => void

    Called when the user closes the host.

    onError?: (error: Error) => void

    Error sink (file load, save, connection).

    onFileOpen?: (file: FileEntry) => void

    Called when a file is opened from the empty state (or via controlled sync).

    onGetFileUrl?: (file: FileEntry) => Promise<string | null>

    Resolve a presigned URL for the file (used to pre-fetch note/assignment/clip content).

    onResolveFileUrl?: (file: { fileId: string }) => Promise<string | null>

    Resolve a presigned URL for a background file (passed through to the whiteboard editor).

    onUploadBackgroundFile?: (
        file: File,
    ) => Promise<
        { fileId: string; fileName: string; resourceType: string }
        | null,
    >

    Upload a new background file from disk (passed through to the whiteboard editor).

    How the host should render.

    whiteboardProps?: Record<string, unknown>

    Per-editor prop overrides. These are merged into the editor component's props after the host's defaults. Use this to pass editor-specific configuration (colors, labels, feature flags) from the consuming page.