/** * Reading story drawings back out of the annotations that carry them. * * The counterpart to `storyDrawingAnnotations.ts`, and the reason the private * `mangoState.drawingAnnotations` copy could be dropped. Until this existed the * standalone overlay annotations were written for show: a IIIF client could read * them, but Mango itself restored every drawing from the extension body, so the * published geometry and style were never exercised and nothing caught them * drifting. Now they are the only copy, which is also what stops the same * drawing being reconciled from two places — the shape item 1 of the authoring * ticket took. * * Everything here is a lossless inverse of what the writer emits, with one * deliberate asymmetry: a value that matches the writer's default is read back * as absent. A stylesheet always spells out colour, width and fill, so without * that a drawing whose author chose none of them would return from a round trip * carrying all three. */ import type { ChapterDrawingAnnotation } from '../core/types/story'; /** Path segment marking an overlay annotation as a drawing rather than a caption. */ export declare const DRAWING_OVERLAY_SEGMENT = "/overlay/drawing/"; /** Whether an overlay id names a drawing belonging to a given chapter annotation. */ export declare const isDrawingOverlayId: (overlayId: string | undefined, chapterAnnotationId: string | undefined) => boolean; /** * Turns one exported overlay annotation back into a story drawing. * * Parsing goes through the canonical parser rather than reading the JSON * directly, so a `FragmentSelector`, an `SvgSelector` and a `PointSelector` are * all understood, and so is a document some other client wrote in a shape Mango * does not emit. */ export declare const parseStoryDrawingOverlay: (overlay: unknown, options?: { canvasId?: string; chapterAnnotationId?: string; }) => ChapterDrawingAnnotation | null;