import type { DocumentChapter, DocumentSection, DocumentSectionType } from "../../types/sections";
import type { ChapterParseResult } from "./useBookChapters";
export interface BookTocProps {
    sections: DocumentSection[];
    currentSectionId: string | null;
    onSelectSection: (id: string) => void;
    onAddSection: (afterId: string | null) => void;
    onAddIntroduction: () => void;
    onAddConclusion: () => void;
    onRemoveSection: (id: string) => void;
    onUpdateSection: (id: string, changes: {
        title?: string;
        type?: DocumentSectionType;
        xmlId?: string | null;
        label?: string | null;
    }) => void;
    /** Reorder sections within the currently-active chapter. */
    onReorderSections: (sections: DocumentSection[]) => void;
    onAddFirstSection?: () => void;
    editMode: "document" | "sectioned";
    onToggleEditMode: () => void;
    readonly: boolean;
    chapters: DocumentChapter[];
    currentChapterId: string | null | undefined;
    onChapterSelect?: (chapterId: string) => void;
    onChaptersReorder?: (chapters: DocumentChapter[]) => void;
    expandedChapterIds: Set<string>;
    onToggleChapterExpanded: (chapterId: string) => void;
    getChapterParse: (chapterId: string) => ChapterParseResult | null;
    onChapterRequestLoad?: (chapterId: string) => void;
    onChapterAdd?: (afterChapterId: string | null) => void;
    onChapterRemove?: (chapterId: string) => void;
    /**
     * Persist a chapter's updated content back to the host.  Required for
     * cross-chapter section drag-and-drop to work; without it, drops between
     * chapters are rejected.
     */
    onChapterContentChange?: (chapterId: string, content: string) => void;
    /**
     * Handle a section click in a chapter that isn't currently active.
     * The parent switches the active chapter and lands directly on the
     * named section in sectioned mode.
     */
    onSelectSectionInChapter?: (chapterId: string, sectionTitle: string) => void;
    /**
     * Commit edited chapter properties (title, xml:id, label).  When provided,
     * an edit (✎) button is shown on each chapter row.
     */
    onUpdateChapter?: (chapterId: string, changes: {
        title?: string;
        xmlId?: string | null;
        label?: string | null;
    }) => void;
}
/**
 * Book-mode TOC body with unified drag-and-drop.
 *
 * A single `DndContext` wraps both the chapter sortable and the per-chapter
 * section sortables, so a drag can begin inside one chapter's section list
 * and end inside another.  Section ids are globally unique, so we
 * distinguish chapter vs section drags by id membership in `chapters`.
 *
 * For section drops:
 *   - same chapter, source = active: route through `onReorderSections`.
 *   - same chapter, source = non-active: re-merge the chapter and emit
 *     `onChapterContentChange`.
 *   - cross-chapter: remove from source, splice into target, emit content
 *     changes for both (route the active side through `onReorderSections`
 *     so the live editor state stays in sync).
 *
 * The merge-into-section gesture (700 ms hover) is intentionally omitted
 * here — cross-chapter merge would be confusing and the existing article
 * flow doesn't apply.  Intra-chapter merge can be added back later.
 */
declare const BookToc: ({ sections, currentSectionId, onSelectSection, onAddSection, onAddIntroduction, onAddConclusion, onRemoveSection, onUpdateSection, onReorderSections, onAddFirstSection, editMode, onToggleEditMode, readonly, chapters, currentChapterId, onChapterSelect, onChaptersReorder, expandedChapterIds, onToggleChapterExpanded, getChapterParse, onChapterRequestLoad, onChapterAdd, onChapterRemove, onChapterContentChange, onSelectSectionInChapter, onUpdateChapter, }: BookTocProps) => import("react/jsx-runtime").JSX.Element;
export default BookToc;
