/** * HTML of a comic page (#565): the panels, their pictures cropped to their * outlines, borders and pop-out cut-outs, and the lettering, painted in the * order the canvas paints them (SPEC D5) and read in reading order: each * panel a `
` holding its picture (an inline SVG clipped to the * panel's outline, named by its text alternative), followed by its * balloons and captions as paragraphs and its sound effects as named * images. Balloons sit over every panel (`z-index`), sound effects over * every balloon, whatever their place in the reading order. * * Everything is in sheet coordinates: the markup is laid over the page * box, outside any flow frame. */ import type { ComicCastMember } from './types.js'; import type { VDTComicArt, VDTComicPage, VDTComicPanel, VDTDesignTextBlock } from './vdt.js'; /** How a comic page's markup gets its pictures and its text. */ export interface ComicHtmlPaint { /** The URL of a picture, or undefined (a placeholder is drawn). */ artUrl: (art: VDTComicArt) => string | undefined; /** Extra CSS declarations for a picture (a single-ink filter). */ artStyle?: (art: VDTComicArt, url: string) => string; /** The HTML of a design text block (the lettering's lines). */ text: (block: VDTDesignTextBlock) => string; /** Prefix of the ids the markup sets (clip paths): unique per page of * the document the markup goes into. */ idBase: string; /** `comics.cast`: the names speakers are announced under. */ cast?: readonly ComicCastMember[]; /** Markup laid over a panel, after its figure and before its lettering * (a text panel's frame, #885), by panel index. */ overPanel?: (panel: VDTComicPanel) => string; } /** Options of {@link comicPanelSvg}. */ export interface ComicPanelSvgOptions { /** The URL of a picture, or undefined (a placeholder is drawn). */ href: (art: VDTComicArt) => string | undefined; artStyle?: (art: VDTComicArt, url: string) => string; /** Id of the panel's clip path. */ clipId: string; /** The text alternative: the SVG is then an image of that name * (`role="img"`); without one it is hidden from assistive technology. */ label?: string; /** A document of its own (XML: `xmlns`, `xlink:href`), sized `width` px * wide (default: the panel's own width) — the reflowable EPUB's panel * picture. Otherwise it fills the box it is placed in. */ standalone?: { width?: number; }; /** Stroke the panel's border (default true). */ border?: boolean; /** Draw the pop-out cut-out (default true). */ pop?: boolean; /** Class of the ``. */ className?: string; } /** * A comic panel as an SVG picture whose user space is the sheet (page px): * the viewBox is the panel's bounding box, the panel's background and * picture are clipped to its outline (a polygon, or a rounded rectangle), * then its border is stroked and its pop-out cut-out drawn over it, as * the canvas paints it. The picture is the whole stored picture at * `art.box`, so only `art.source` shows: an exact crop, with no image * decoding. */ export declare function comicPanelSvg(panel: VDTComicPanel, options: ComicPanelSvgOptions): string; /** * The markup of a comic page, laid over a page `width` × `height` px: a * container (`.pt-comic`, its own stacking context) holding, in reading * order, each panel's `
` followed by its lettering, then the * pop-out cut-outs of the panels in a layer over every figure. */ export declare function renderComicHtml(comic: VDTComicPage, width: number, height: number, paint: ComicHtmlPaint): string; //# sourceMappingURL=htmlComic.d.ts.map