/** * Configuration values the engine cannot use as written. The engine never * fails on them — it numbers in decimal, sets a font stack in its first * family, cuts the columns of a one-and-a-half layout at the nearest width * both can take, ignores a heading setting it does not know — but a silent * substitution is hard to spot, so every one is reported: on * `VDTDocument.configWarnings`, and to any host that asks with * {@link collectConfigWarnings}. */ import type { PostextConfig, Resource, DocumentMetadata } from './types.js'; import type { ConfigWarning } from './vdt.js'; /** * Walk a config for values the engine replaces or leaves out: * - an unknown numbering format (lists, page labels, resource counters — * any of their spellings is fine, see `parseNumberFormat`) and a CSS font * stack in a font-family field, in every nested partial config (heading * styles, part list overrides, `htmlViewer.overrides`, design elements); * - the `sideColumnPercent` of a one-and-a-half layout that would leave one * of the columns with no width (see `sideColumnPercentUsed`), and the * column count of a `multiple` layout that is no whole number from 3 to * 8 — the document's, and every heading style's own `layout`; * - a character grid (`cjk.grid`) larger than the page leaves room for; * - a key the heading settings or a paragraph style do not have * (`unknownConfigKey`: `headings`, its `balancing` and `levels`, * `headingStyles`, `paragraphStyles`), a top-level key a config does not * have, and a key a design element, its placement or a connector's end * does not have (#1122); * - a setting with a value outside its choices (`unknownConfigValue`): * `direction`, the Arabic body text words (`emphasis`, `tashkil`, * `kashida`, `kashidaPatterns`), the composition rules, `toc.groups.head`, * a heading's `numberPosition`, spread footnotes in a horizontal * document, the comics words, `print.standard`, `outputProfile` and * `renderingIntent`, the contrast check, the Canvas gaps * (`canvasViewer`), the `checks.contentInConfig` limits (`maxWords`, * `maxChars`), the line numbers, a resource type's `resetOn` and text * wrap, the code style, tab stops and drop caps; line numbers or text * wrap asked of a vertical document (`lineNumbersUnsupported`, * `wrapUnsupported`); * - a `numerals` value that names no digit system (`unknownNumerals`); * - page templates and label styles (see `validatePageTemplates`), and a * box style whose `extends` names no style or comes back to itself; * - the design texts that hold the book's content instead of placeholders * (`contentInConfig`, #849, tuned by `checks.contentInConfig`); * - a design element's point along a side (`anchor.at`) or size edge * (`size.width.edge`…) outside its choices (`unknownConfigValue`, #1055); * - a path element's keys, path data, `viewBox` and * `preserveAspectRatio` (#1060); * - box shapes (#1059): corner and side keys a box does not have, a label * tab's `position` outside its choices, a joined tab with an `offset`; * - a design element's `when` / `unless` that names no attribute, or that * a heading, part or box design would ignore (#1087); * - the exercise styles and settings (#1226): keys they do not have, words * outside their choices, numbering styles the engine does not know. * Pure. */ export declare function collectConfigWarnings(config: PostextConfig | undefined, options?: ConfigWarningOptions): ConfigWarning[]; /** What else the config checks may read. */ export interface ConfigWarningOptions { /** The book's resources: an anchor's label `style` is checked against * `labelStyles` (`labelStyleUnknown`). */ resources?: readonly Resource[]; /** The document's metadata (its front matter): its `title`, `subtitle`, * `author` and `publisher` are allowed in a design text as if listed in * `checks.contentInConfig.allow`, since a running head often repeats * them. */ metadata?: DocumentMetadata; } /** The literal text a design text prints whatever the document: its * content with every placeholder removed, on one line (#849). */ export declare function designTextLiteral(content: string): string; /** How the `contentInConfig` check reads one design text: its literal * (placeholders removed), what is left once the allowed phrases are taken * out (`rest`, compared without case), the letters and digits of `rest`, * and whether the text counts as content. */ export interface DesignTextVerdict { literal: string; rest: string; chars: number; content: boolean; } /** The `contentInConfig` rule of a configuration (#849), as a function of a * design text's `content`: the check's settings and allowed phrases (and * the metadata's) read once. Disabled checks still answer, as if enabled: * the migration of #874 asks what the check would say. Pure. */ export declare function contentInConfigRule(config: PostextConfig | undefined, options?: ConfigWarningOptions): (content: string) => DesignTextVerdict; //# sourceMappingURL=configWarnings.d.ts.map