import type { DocumentChapter, DocumentSection } from "../../types/sections";
export interface ChapterParseResult {
    sections: DocumentSection[];
    wrapper: string;
}
export interface BookChaptersState {
    /** Set of chapter ids currently expanded in the TOC. */
    expandedChapterIds: Set<string>;
    /** Add a chapter id to the expanded set. */
    expandChapter: (chapterId: string) => void;
    /** Remove a chapter id from the expanded set. */
    collapseChapter: (chapterId: string) => void;
    /** Toggle a chapter's expansion state. */
    toggleChapterExpanded: (chapterId: string) => void;
    /**
     * Parsed `{sections, wrapper}` for the chapter, or `null` if its content
     * is not loaded or fails to parse.
     */
    getChapterParse: (chapterId: string) => ChapterParseResult | null;
}
export interface BookChaptersOptions {
    chapters: DocumentChapter[];
}
export declare function useBookChapters({ chapters, }: BookChaptersOptions): BookChaptersState;
