export interface ActChapter {
    chapterInfoId: string;
    chapterId: string;
    title: string;
    chapterOrder: number;
    actId: number;
    incidentId?: string;
    plotPointId?: string;
    summary: string;
    goal: string;
}

export interface ChapterListProps {
    chapterId: string;
    title: string;
    summary?: string;
    chapterOrder?: number;
    goal?: string;
}

export interface ChapterProps {
    chapterId: string;
    chapterOrder: number;
    title: string;
    chapterContent: ChapterContent;
}

export interface ChapterContent {
    version: number;
    content: string;
    wordsCount: number;
}

export interface ChapterVersion {
    value: number;
    label: 'Invite' | 'Brouillon' | 'Perfectionnement' | 'Révision' | 'Finale';
}

export interface TiptapLinkAttrs {
    href: string;
    target?: string;
}

export type TiptapAttrValue = string | number | boolean | null | TiptapLinkAttrs;

export type TiptapNode = {
    type: string;
    content?: TiptapNode[];
    text?: string;
    attrs?: {
        [key: string]: TiptapAttrValue;
    };
};

export interface CompanionContent {
    version: number;
    content: string;
    wordsCount: number;
}

export type ExportFormat = 'epub' | 'pdf' | 'docx';

export interface ChapterExportInfo {
    chapterId: string;
    title: string;
    chapterOrder: number;
    availableVersions: number[];
}

export interface ChapterExportSelection {
    chapterId: string;
    version: number;
    selected: boolean;
}

export interface ExportRequestBody {
    bookId: string;
    format: ExportFormat;
    chapters: { chapterId: string; version: number }[];
}
