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

    Interface NoteEditorRef

    Ref handle for the NoteEditor component.

    Use this ref to imperatively control the NoteEditor from a parent component, such as triggering a save from a custom header.

    import { NoteEditor, type NoteEditorRef } from '@hiyve/react-notes';

    function NotesPanel() {
    const noteEditorRef = useRef<NoteEditorRef>(null);

    return (
    <Box>
    <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
    <Typography>Notes</Typography>
    <IconButton
    onClick={() => noteEditorRef.current?.save()}
    disabled={noteEditorRef.current?.isSaving || !noteEditorRef.current?.hasUnsavedChanges}
    >
    <SaveIcon />
    </IconButton>
    </Box>
    <NoteEditor ref={noteEditorRef} enableAutoSave />
    </Box>
    );
    }
    interface NoteEditorRef {
        fileId: string | null;
        hasUnsavedChanges: boolean;
        isSaving: boolean;
        lastSaved: Date | null;
        save: () => Promise<string | null>;
    }
    Index

    Properties

    fileId: string | null

    Current file ID (null if not yet saved)

    hasUnsavedChanges: boolean

    Whether there are unsaved changes

    isSaving: boolean

    Whether a save is in progress

    lastSaved: Date | null

    Last successful save timestamp

    save: () => Promise<string | null>

    Manually trigger a save, returns file ID