/**
 * BookViewer shared types + field-map normalisation.
 *
 * The BookViewer's entity boundary is `EntityRow` (raw schema data bound from
 * `@payload.data`). Books may use non-English field names (e.g. Arabic `.orb`
 * schemas), so `mapBookData()` normalises a raw record into canonical English
 * field names while keeping every value as `EntityRow` — no private entity
 * content-model types.
 *
 * The embedded orbital-diagram (`OrbitalSchema`) is richer than `FieldValue`
 * and therefore CANNOT live on an `EntityRow`. It is lifted OFF the entity
 * boundary into a separate `schemaByChapterId` lookup; consumers fetch a
 * chapter's schema by id and pass it as its own non-entity prop.
 */
import type { EntityRow, OrbitalSchema } from '@almadar/core';
/** A normalised book: cover fields + part rows + a chapter→schema side-table. */
export interface NormalizedBook {
    /** Cover-level fields (title/subtitle/author/coverImageUrl/direction). */
    cover: EntityRow;
    /** Reading direction resolved from the cover record. */
    direction: 'rtl' | 'ltr';
    /** Parts, each an `EntityRow` carrying `title` + a `chapters: EntityRow[]`. */
    parts: readonly EntityRow[];
    /** Flattened chapter rows in reading order (each carries id/title/content). */
    chapters: readonly EntityRow[];
    /** Orbital diagram schemas keyed by chapter id — kept OFF the entity rows. */
    schemaByChapterId: Record<string, OrbitalSchema>;
}
/**
 * Maps raw entity field names to canonical BookData field names.
 * Each key is a canonical field, each value is the entity field name.
 */
export interface BookFieldMap {
    title: string;
    subtitle: string;
    author: string;
    coverImageUrl: string;
    direction: string;
    parts: string;
    partTitle: string;
    chapters: string;
    chapterId: string;
    chapterTitle: string;
    chapterContent: string;
    chapterOrbitalSchema: string;
}
/** Identity map — entity already uses canonical English field names */
export declare const IDENTITY_BOOK_FIELDS: BookFieldMap;
/** Arabic field map for الأمة_الرقمية schema */
export declare const AR_BOOK_FIELDS: BookFieldMap;
/**
 * Resolves a fieldMap prop to a BookFieldMap object.
 * Accepts a BookFieldMap object directly, a locale string key ("ar"),
 * or undefined (defaults to identity/English).
 */
export declare function resolveFieldMap(fieldMap: BookFieldMap | string | undefined): BookFieldMap;
/**
 * Maps a raw entity record to a `NormalizedBook` using a field map. Cover and
 * chapter data come back as `EntityRow`s; the per-chapter `OrbitalSchema` is
 * lifted off into `schemaByChapterId`.
 */
export declare function mapBookData(raw: Record<string, unknown>, fields?: BookFieldMap): NormalizedBook;
