/** * One page model (#885, DESIGN ยง7): a comic page's `split` is a shorthand * that generates frames. Each cell of the split tree (after its panel's * `pad`) is a frame, and so is each `inset` panel (laid over the frame * before it, one layer up); the frame holds the panel (its art, border and * background) and, for a text panel (`::panel{text}`), the Markdown its * body pours into it. The lettering stays positioned by the comics code, * panel by panel, as before. * * The frames are those of a composed page (`VDTFrame`) with what a cut of * the split needs besides: a `polygon` when a slanted line cuts the cell, * and `panel`, the index of the panel the frame holds. Ids follow the * composed pages' rule (#857): built from the comic fence's ordinal in its * chapter and the names the Markdown gives (`cm:`, a panel's * `id`, else `p`), never from the layout, so they are the same in every * locale and across relayouts. */ import type { BoundingBox, ResolvedConfig, VDTComicPage, VDTComicPanel, VDTFrame, VDTPoint } from '../vdt.js'; import type { ResolvedCalloutStyleConfig } from '../types.js'; import { type ComicCell } from './geometry.js'; import type { ComicPanelSource } from './types.js'; /** A comic (page, spread or strip): `cm`, `n` the ordinal of its fence * among the comic fences of its chapter. */ export declare function comicElementId(fenceIndex: number): string; /** A frame of a comic: `cm:`. */ export declare function comicFrameElementId(fenceIndex: number, name: string): string; /** A balloon, caption or sound effect of a panel: `:b`, * `order` its line's place in the panel's script. */ export declare function comicBalloonElementId(frameId: string, order: number): string; /** The name of the frame of the panel laid `index`-th (0-based): the * panel's `id` when it has one no frame before took, else `p`. */ export declare function comicFrameName(panel: Pick | undefined, index: number, taken: ReadonlySet): string; /** Whether a panel's body is Markdown text (`::panel{text}`) rather than a * lettering script. */ export declare function isComicTextPanel(panel: Pick | undefined): boolean; /** The callout style a panel's `box` names (#885), or undefined (unset, * or no such style: `comicPanelFrame`, reason `unknownBox`). */ export declare function comicBoxStyle(resolved: Pick, value: string | undefined): ResolvedCalloutStyleConfig | undefined; /** A frame the split generates, before its panel is built: where it is * and which panel it holds. */ export interface ComicFrameSpec { name: string; /** The frame's outline (the cell, its panel's `pad` taken off), * clockwise, and its box. */ polygon: VDTPoint[]; bbox: BoundingBox; /** An axis-aligned rectangle (round corners allowed). */ rect: boolean; /** The panel the frame holds; undefined for a cell no panel fills. */ panel?: ComicPanelSource; /** An `inset` panel's frame, laid over the frame before it. */ inset: boolean; /** Paint order among the frames: 1 for a cell, 2 for an inset. */ layer: number; } /** Insets of a panel (`pad`), px, or undefined. */ export type ComicPadding = { top: number; right: number; bottom: number; left: number; } | undefined; /** A cell inset by its panel's `pad`. */ export declare function padComicCell(cell: Pick, pad: ComicPadding): Pick; /** `inset="x y w h"`: percentages (or fractions) of the previous panel's * box. */ export declare function comicInsetBox(value: string | undefined, of: BoundingBox): BoundingBox | undefined; /** * The frames a split generates, in panel order: the cells of the split tree * in reading order, each taking the next panel that is not an inset (or * none), and every inset panel laid over the frame laid before it (the * insets that come before a panel in the source follow the frame before * that panel). `padOf` gives a panel's `pad` for the box it pads. */ export declare function comicFrameSpecs(panels: readonly ComicPanelSource[], cells: readonly Pick[], padOf: (panel: ComicPanelSource | undefined, box: BoundingBox) => ComicPadding): ComicFrameSpec[]; /** The frame of a laid-out panel: its box and outline, its id and source. */ export declare function comicPanelFrame(panel: VDTComicPanel, name: string, layer: number): VDTFrame; /** The panel a frame of a comic holds (`VDTFrame.panel` is the panel's * `index`, which is its place in the comic laid out whole: on a half of a * spread, whose panels are the ones that reach the page, it is not its * place in `panels`). */ export declare function comicPanelOfFrame(comic: Pick, frame: Pick): VDTComicPanel | undefined; /** The frames of a comic whose panels were moved or cut (a spread's half, * #567): each frame of `whole` whose panel `panels` still holds, on that * panel's box and outline; a text frame keeps its blocks. */ export declare function comicFramesFor(whole: Pick, panels: readonly VDTComicPanel[]): VDTFrame[] | undefined; //# sourceMappingURL=frames.d.ts.map