import type { PostextConfig } from '../types.js'; /** * The configuration rules this engine writes: 19 since #1164 (18 from #1149, 17 from #1119, 16 from #1056, 15 from #853, 14 from * postext 1.30, 13 from 1.29, 12 from 1.28, 11 from 1.25, 10 from 1.24, 9 from 1.23, 8 from 1.5). Thirteen rules changed in 1.5 and * more since, and a configuration * stored under an older * number (or none) is read through {@link migrateConfig}: * - 3: a heading level's `breakBefore` (and a heading style's) merges field * by field onto the level's default — H1's being `always-odd` * ({@link pinLegacyHeadingBreaks}); * - 4: one em of a formula is the surrounding text's size × * `math.fontSizeScale`, where up to 1.4 formulas came out * {@link LEGACY_MATH_SIZE}× larger ({@link pinLegacyMathSize}); * - 5: an inline resource keeps the float gap below it as well as above * (`layout.inlineResourceGap: 'around'`), where up to 1.4 the text after * it resumed at the next grid line ({@link pinLegacyInlineGap}); * - 6, five rules: * - a heading reads its inline marks (`headings.inlineMarks: true`), * where up to 1.4 it printed them as plain text ({@link * pinLegacyHeadingMarks}); * - a design text's drop cap that names no size is set at the size that * brings its top level with the first line's capitals, where up to 1.4 * it was as tall as all the line boxes it spans ({@link * pinLegacyDropCapSize}); * - `bodyText.keepColonWithList` leaves room under the colon line for * the list's first item to start by its orphan and widow rules * (`bodyText.colonListRoom: 'item'`), where up to 1.4 one line was * enough ({@link pinLegacyColonListRoom}); * - an inline resource inside a box keeps the float gap too * (`layout.inlineResourceGapInBoxes`), where up to 1.4 it sat right * against the text around it ({@link pinLegacyBoxResourceGap}); * - a box that splits inside a paragraph or list item leaves at least two * lines of it on each side (`layout.boxChildSplitMinLines: 2`), where * up to 1.4 a cut could leave one ({@link pinLegacyBoxChildCut}); * - 7, two rules: * - a line may end after an em or en dash set closed between words * (`bodyText.breakAfterDashes`), where up to 1.4 Knuth–Plass never * broke there ({@link pinLegacyDashBreaks}); * - ragged running text is broken with Knuth–Plass too * (`bodyText.optimalRagged`), where up to 1.4 it was set line by line * ({@link pinLegacyRaggedBreaking}); * - 8, three rules: * - a paragraph kept with the heading above it at a column's foot * splits by the orphan rule too (`headings.keepWithNextSplit: * 'rules'`), where up to 1.4 it kept as many lines as fit under the * heading ({@link pinLegacyHeadingSplit}); * - the space under a `:::paragraphs` container merges with the next * block's own and is at least the paragraph spacing of the text around * it (`bodyText.paragraphContainerSpacing: 'collapse'`), where up to * 1.4 the style's space was baked into the grid snap and the next * block's space above added under it ({@link * pinLegacyParagraphContainerSpacing}); * - Knuth–Plass may end a line after the hyphen of a compound in every * paragraph (`bodyText.breakAfterHyphens`), where up to 1.4 a justified * paragraph with no inline formatting never broke there ({@link * pinLegacyHyphenBreaks}). * - 9 (#620, #624), four rules: * - a `:::verse` poem whose fence names no layout and whose lines carry * no hemistich separator is set line by line (`bodyText.verse.layout: * 'auto'`), where up to 1.22 its lines were single hemistichs centred * in the measure ({@link pinLegacyVerseLayout}); * - a paragraph style that sets `firstLineIndent` itself and a non-zero * `hangingIndent` indents its first line by the one and its turnovers * by the other, where up to 1.22 the hanging indent replaced the * first-line indent ({@link pinLegacyPairedIndents}); * - a backslash that ends a line of a paragraph, a quotation or a list * item, and `\\` in one, is a forced line break * (`bodyText.hardLineBreaks`), where up to 1.22 it printed ({@link * pinLegacyHardBreaks}); * - a ```` ``` ```` or `~~~` fence opens a code block (#624, * `codeStyle.blocks`), where up to 1.22 its lines were read as * Markdown ({@link pinLegacyCodeBlocks}). * - 10, two rules: * - a line of a poem set line by line that is a little wider than the * measure tightens its word spaces, down to `bodyText.minWordSpacing`, * and stays on one line (`bodyText.verse.tighten`, #620 follow-up), * where 1.23 turned it over ({@link pinLegacyVerseTightening}); * - a text element of a heading design or a part page that sets no * `overflow` wraps onto more lines (#628), where up to 1.23 it was cut * with an ellipsis ({@link pinLegacyDesignOverflow}). * - 11, seven rules: * - a horizontal page on a character grid (`cjk.grid.enabled`) is not * balanced unless `headings.balancing.enabled` says so (#632), where * up to 1.24 it was ({@link pinLegacyGridBalancing}); * - a table placed `here` follows its style's `overflow` * (`tableStyle.splitInline`, #634): one that does not fit the room * left in its column is cut between rows, where up to 1.24 it moved * whole to the next column ({@link pinLegacyInlineTableSplit}); * - a `:::columns` fence outside a box sets its blocks in sub-columns, * and a box that splits may cut inside a group (`layout.flowColumns`, * #634), where up to 1.24 such a fence was ignored and a box never cut * inside a group ({@link pinLegacyFlowColumns}); * - a line breaks inside a book title only where two of its characters * stand on either side (`cjk.titleMinChars: 2`, #637), where up to * 1.24 it could leave one ({@link pinLegacyTitleBreaks}); * - the circled numbers ①–⑳ and their kin are Chinese characters in CJK * text (`cjk.circledNumbers: 'cjk'`, #637), where up to 1.24 they were * Western letters ({@link pinLegacyCircledNumbers}); * - a design text in Chinese or Japanese takes the body's CJK rules * (`cjk.composeDesignText`, #637), where up to 1.24 it was wrapped at * spaces with every mark at its own advance ({@link * pinLegacyDesignText}); * - under a page-span opener set over several text columns, the head of * the opener's own column is a slot for a top float * (`layout.floatsUnderOpener`, #639), where up to 1.24 such a float * landed from the second column on ({@link pinLegacyOpenerHeadFloats}). * - 12 (#747), the rules of postext 1.28, each listed with its pin below. * - column balancing tries the list ends, the displays, the float bands * and the loose paragraphs before a heading takes a third line * (`headings.balancing.maxLinesBeforeLoose: 2`, #707), where up to 1.27 * a heading took all its lines first ({@link pinLegacyLooseOrder}); * - under a float that stands over several text columns, column * balancing lowers a column only with the others under it or to end it * flush (`headings.balancing.stretchAfterWideFloats: 'flush'`, #708), * where up to 1.27 a column took its after-float line as under any * float ({@link pinLegacyWideFloatStretch}); * - the level cut of a closing band counts lines of the band's own text * when it is off the baseline grid (`headings.balancing.trailingStep: * 'lines'`, #711), where up to 1.27 every cut stood on a grid line * ({@link pinLegacyTrailingStep}); * - a group of an index divided between two columns keeps two entries * on each side (`index.groups.splitMinEntries: 2`, #712), where up to * 1.27 a column could end between any two entries ({@link * pinLegacyIndexGroupSplit}); * - a page on a character grid (`cjk.grid.enabled`) holds its lines: * `bodyText.avoidWidows` is off by default there, and * `bodyText.avoidOrphans` too in the Japan region (#717), where up to * 1.27 both were on ({@link pinLegacyGridBreakRules}); * - a line breaks inside a two-row note only where two of its characters * stand on either side (`cjk.warichu.minChars: 2`, #720), where up to * 1.27 it could leave one ({@link pinLegacyNoteBreaks}); * - in the Japan region a Western word takes the Han–Latin space on a * side that ends in a bracket or a sign (`cjk.latinSpacingEdge: * 'western'`, #721), where up to 1.27 only a side that ends in a * letter or a digit did ({@link pinLegacyLatinSpacingEdge}); * - a resource set in the text takes `placement.captionSide` as a column * float does (`layout.inlineCaptionSide`, #729), where up to 1.27 its * caption stayed under it ({@link pinLegacyInlineCaptionSide}); * - a reference whose label is words (an anchor's text, a title, a * `text="…"` override) breaks at the spaces of its label * (`crossRefs.breakLabels`, #702), where up to 1.27 every label was * one unbreakable word ({@link pinLegacyRefLabelBreaks}); * - a comic balloon reshaped to fit its panel does not part a Chinese * word to do so (`comics.lettering.strictPlacement`, #728), where up * to 1.27 a narrow shape that cut one could win over a balloon read * out of order ({@link pinLegacyBalloonPlacement}); * - a word with no letter (`46.`, `1367)`) is shaped in the script of * the text around it, in a face that draws its punctuation by script * (`bodyText.scriptContext`, #725), where up to 1.27 it was shaped * alone, in the script each browser and the PDF picked ({@link * pinLegacyScriptContext}); * - 13 (#764), the rules of postext 1.29: * - the language the text is shaped in is a setting * (`bodyText.shapingLanguage`, #764): the host's, as up to 1.28, or * the document's own on every host; an older configuration has the * host's written out ({@link pinLegacyShapingLanguage}); * - the box of a task item is drawn by the engine and takes a room of * its own (`unorderedLists.taskBox`, #765), where up to 1.28 it was the * character ☐ or ☑ in the list's face, as wide as the font the system * gave for it ({@link pinLegacyTaskBox}); * - 14 (#770), the rule of postext 1.30: * - the text is shaped in the document's own language unless the * configuration says otherwise (`bodyText.shapingLanguage: * 'document'`, the default), where 1.29.1 and 1.29.2 shaped it in the * host's, as up to 1.28, and 1.29.0 in the document's with a canvas * and a PDF that did not follow the measure; a configuration stored * under 13 or an older number that does not name the setting has the * host's written out ({@link pinLegacyShapingLanguage}). The measure * rules that came with it apply only to a document shaped in its own * language, so the same pin keeps them off a stored one: one width * for a string whatever was measured before it, a right-to-left word * measured right to left, the two parts of a word broken at a line end * and the runs of a design text measured as they are painted, and in * the PDF the shaping word by word and each character from the file * the browser took it from. * - 15 (#853), composed pages: the configuration may hold page templates * (`pageTemplates`) and label styles (`labelStyles`), which an engine * that reads 14 or less ignores. Nothing an older configuration says * changes meaning, so one stored under 14 is read as it is (no pin): the * number marks a configuration that may hold templates, so an older * reader can say it lays out without them. * - 16 (#1056), composed pages round 2: a template's decoration may hold * connectors (`kind: 'connector'`), the first decoration element that is * not placed by an anchor. An engine that reads 15 or less leaves them * out (`unknownConfigValue`). Nothing older changes meaning: one stored * under 15 is read as it is (no pin). * - 17 (#1119), the rule of postext 1.52: a paragraph style's unset type * fields (face, size, leading, weights, colour) take the box's body * inside a box (`bodyText.paragraphStylesInBoxes: 'box'`), where up to * 1.51 they took the document's body text ({@link * pinLegacyBoxParagraphStyles}). * - 18 (#1149): a highlight style that names no `borderRadius` has square * ends (`markStyles[].borderRadius` defaults to 0, the print norm), * where up to 1.51 its band's ends were rounded at 0.2 em ({@link * pinLegacyMarkRadius}). * - 19 (#1164): a line of formatted text (captions, cells, notes and * bibliographies too) may end after a slash between two words * (`bodyText.breakAfterSlashes`), and a word wider than its line is * divided after a slash first, where up to 1.51 the rich breaker broke * after a slash only inside a web address ({@link pinLegacySlashBreaks}). * - 20 (#1172): a fence in a notation language (```` ```abc ````) is a * music score ({@link pinLegacyScoreFences}). * - 21 (#1209): a bundle's `localized[…].config` is an override merged * over the shared `config` field by field ({@link mergeConfigLayers}), * where up to 1.57 each of its top-level keys replaced the shared one * whole. Nothing to pin: a bundle stamped 20 or less is read the old * way. * * A configuration stored without a version was written for postext 1.4 or * earlier. One stored under 3 to 7 was written by a 1.5 prerelease, and * gets the pins of the rules after its number: under 3 the maths, * inline-gap, version-6, version-7 and version-8 pins, under 4 the * inline-gap, version-6, version-7 and version-8 pins, under 5 the * version-6, version-7 and version-8 pins, under 6 the version-7 and * version-8 pins, under 7 the version-8 pins. One stored under 8 was * written by postext 1.5 to 1.22 and gets the version-9 pins (which every * older one gets too); one stored under 9 was written by postext 1.23 and * gets the version-10 pins (which every older one gets too); one stored * under 10 was written by postext 1.24 and gets the version-11 pins (which * every older one gets too); one stored under 11 was written by postext * 1.25 to 1.27 and gets the version-12 pins (which every older one gets * too); one stored under 12 was written by postext 1.28 and gets the * version-13 pins (which every older one gets too); one stored under 13 * was written by postext 1.29 and gets the version-14 pin (which every * older one gets too); one stored under 14 was written by postext 1.30 to * 1.33 and gets nothing; one stored under 15 was written by postext 1.34 to * 1.47 and gets nothing either; one stored under 16 was written by postext * 1.48 to 1.51 and gets the version-17, version-18 and version-19 pins * (which every older one gets too); one stored as 17 was written by a * development build and gets the version-18 and version-19 pins; one stored * as 18 was written by postext 1.52 and gets the version-19 pin; one stored * as 19 was written by postext 1.53 and gets the version-20 pin (which every * older one gets too); one stored as 20 or less has its locale layer read * key by key. */ export declare const CONFIG_VERSION = 21; /** The rules that read page templates and label styles (#853). They add * keys and change no older one, so they pin nothing: kept to say where * the number came from. */ export declare const COMPOSED_PAGES_RULES = 15; /** The rules that draw connectors in a template's decoration (#1056): new * keys only, nothing to pin. */ export declare const CONNECTOR_RULES = 16; /** The rules that merge a bundle's locale configuration over the shared one * field by field (#1209). */ export declare const LOCALE_LAYER_RULES = 21; /** * How much larger postext 1.4 set maths than the size it documents: * MathJax gives a formula's box in `ex`, one `ex` of its TeX font is * 0.442 em (the font's `x_height`), and 1.4 took it as half an em. So * 0.5 ÷ 0.442 ≈ 1.1312; a configuration whose `math.fontSizeScale` is * multiplied by it sets every formula at the size 1.4 did. */ export declare const LEGACY_MATH_SIZE: number; /** * A configuration written for postext 1.4 or earlier, pinned to the heading * breaks it laid out then. Up to 1.4 a `headings` object turned the H1 page * break off unless it set `levels[0].breakBefore.enabled` (and stripping the * defaults dropped an H1 `enabled: false`, so saved and exported * configurations never carried one), a partial H1 break took its missing * field from the no-break default, and a heading style's `breakBefore` * replaced its level's with the same fill. The engine now merges each onto * the level's break — H1's being `always-odd` — so those breaks are written * out: `enabled: false` on H1, or `parity: 'any'` beside an `enabled: true`. * A configuration with no `headings` object, or one that spells every break * out in full, is returned as it is (the same object). */ export declare function pinLegacyHeadingBreaks>(config: T): T; /** * A configuration written before postext 1.5, pinned to the maths size it * laid out then: `math.fontSizeScale` (1 when unset) × {@link * LEGACY_MATH_SIZE}. A display formula's margins in `em` or `rem` are * lengths of the formula's own size, so they are divided by the same * factor and keep the space 1.4 left around the formula. A value that * lands on its default is left out (a scale of 0.884 becomes the default * 1), and a configuration with maths switched off (`math.enabled: false`, * whose formulas are set as their TeX source at the body size) is * returned as it is (the same object). */ export declare function pinLegacyMathSize>(config: T): T; /** * A configuration written before postext 1.5, pinned to the space it left * under an inline resource: `layout.inlineResourceGap: 'above'`, where 1.4 * kept the float gap above the resource only and set the text after it at * the next grid line. A configuration that names a gap already is returned * as it is (the same object). */ export declare function pinLegacyInlineGap>(config: T): T; /** * A configuration written before postext 1.5, pinned to the room it left * for a list under the colon line that introduces it: * `bodyText.colonListRoom: 'line'`, where 1.4 took one line of room as * enough and a first item the orphan and widow rules keep whole went on * to the next column without the colon line. A configuration that names a * room already, or turns `keepColonWithList` off, is returned as it is * (the same object). */ export declare function pinLegacyColonListRoom>(config: T): T; /** * A configuration written before postext 1.5, pinned to the space it left * around an inline resource inside a box: `layout.inlineResourceGapInBoxes: * false`, where 1.4 set the resource right under the text before it and * the text after it right under the resource. A configuration that already * says whether boxes keep the gap is returned as it is (the same object). */ export declare function pinLegacyBoxResourceGap>(config: T): T; /** * A configuration written before postext 1.5, pinned to the cuts it made in * a box that splits: `layout.boxChildSplitMinLines: 1`, where 1.4 cut * inside a paragraph or list item wherever each side of the box held its * `splitMinLines` lines in all, even when that left one line of the * paragraph or item on a side. A configuration that names the setting * already is returned as it is (the same object). */ export declare function pinLegacyBoxChildCut>(config: T): T; /** * A configuration written before postext 1.5, pinned to the line breaks it * made at a dash: `bodyText.breakAfterDashes: false`, where 1.4's * Knuth–Plass never ended a line after an em or en dash set closed between * words ("say—that’s"), and its line-by-line breaker for formatted text * only between two letters. A configuration that names the setting already * is returned as it is (the same object). */ export declare function pinLegacyDashBreaks>(config: T): T; /** * A configuration written before postext 1.5, pinned to the way it broke * ragged text: `bodyText.optimalRagged: false`, where 1.4 set every ragged * paragraph line by line, filling each line before the next, whatever * `optimalLineBreaking` said. A configuration that names the setting * already, that sets no running text ragged (the body, a paragraph style, * a box body, the body of a part or of a section style, in the * configuration or in its HTML viewer's overrides), or that turns * `optimalLineBreaking` off (the setting then changes nothing) is returned * as it is (the same object). */ export declare function pinLegacyRaggedBreaking>(config: T): T; /** * A configuration written before postext 1.5, pinned to the way it split a * paragraph kept with the heading above it at a column's foot: * `headings.keepWithNextSplit: 'fill'`, where 1.4 kept as many lines as fit * under the heading (at least `bodyText.widowMinLines`) however few went on * to the next column. A configuration that names the setting already, that * turns `headings.keepWithNext` off, or that turns `bodyText.avoidOrphans` * off (the setting then changes nothing) is returned as it is (the same * object). */ export declare function pinLegacyHeadingSplit>(config: T): T; /** * A configuration written before postext 1.5, pinned to the space it left * under a `:::paragraphs` container: `bodyText.paragraphContainerSpacing: * 'add'`, where 1.4 set the style's space (the larger of `spaceBetween` and * `marginBottom`) under the last paragraph before the grid snap, added the * next block's own space above (a heading's `marginTop`, the next * container's) under it, and left the paragraph spacing of the text around * the container out. A configuration that names the setting already, or * declares no paragraph style (in the configuration or in its HTML * viewer's overrides; a container naming no style is set as body text), is * returned as it is (the same object). */ export declare function pinLegacyParagraphContainerSpacing>(config: T): T; /** * A configuration written before postext 1.5, pinned to the line breaks it * made at the hyphen of a compound: `bodyText.breakAfterHyphens: false`, * where 1.4's Knuth–Plass ended a justified line after a hyphen between two * letters ("well-" | "known") only in a paragraph with inline formatting. * A configuration that names the setting already, or turns * `optimalLineBreaking` off (the setting then changes nothing), is returned * as it is (the same object). */ export declare function pinLegacyHyphenBreaks>(config: T): T; /** * A configuration written before #620 (postext 1.22 or earlier), pinned to * the way it set a `:::verse` poem with no hemistich separator: * `bodyText.verse.layout: 'bayt'`, every line a single hemistich centred in * the measure, where today such a poem is set line by line. A * configuration that names the setting already is returned as it is (the * same object). */ export declare function pinLegacyVerseLayout>(config: T): T; /** * A configuration written before the #620 follow-up (postext 1.23 or * earlier), pinned to the way 1.23 set a line of a poem in the line layout * that is wider than the measure: `bodyText.verse.tighten: false`, the line * turned over at its natural word spacing, where today one that fits with * its word spaces tightened down to `bodyText.minWordSpacing` stays on one * line. A configuration that names the setting already is returned as it * is (the same object). */ export declare function pinLegacyVerseTightening>(config: T): T; /** * A configuration written before #628 (postext 1.23 or earlier), pinned to * the way its heading designs and part pages set a text too wide for its * room: every text element of `headings.levels[].advancedDesign.slot`, * `headingStyles[].advancedDesign.slot`, `parts.design` and * `parts.versoDesign` that sets no `overflow` gets `'ellipsis-end'`, the * default up to 1.23, where today such an element wraps. The same designs * in its HTML viewer's overrides are pinned too. Running heads, folios and * the contents' part rows keep the ellipsis by default, so they are left * alone. A configuration with no such element is returned as it is (the * same object). */ export declare function pinLegacyDesignOverflow>(config: T): T; /** * A configuration written before #632 (postext 1.24 or earlier), pinned to * the way 1.24 balanced a horizontal page on a character grid: a config * with `cjk.grid.enabled` in horizontal text that does not set * `headings.balancing.enabled` gets `true`, where today such a page is * not balanced by default. (The levers it runs keep every character in * its cell now, which 1.24's loose paragraphs did not.) A vertical one * was not balanced then either, and any other configuration is returned * as it is (the same object). */ export declare function pinLegacyGridBalancing>(config: T): T; /** * A configuration written before #707 (postext 1.27 or earlier), pinned to * the order its columns were balanced in: `headings.balancing. * maxLinesBeforeLoose` gets the configuration's own `maxLinesPerHeading` * (4 when it sets none), so a heading takes all its lines before the list * ends, the displays, the float bands and the loose paragraphs are tried, * where today it takes two. A configuration that does not balance its * columns, that sets the key, or whose headings take two lines or fewer * (the order then changes nothing) is returned as it is (the same object). */ export declare function pinLegacyLooseOrder>(config: T): T; /** * A configuration written before #708 (postext 1.27 or earlier), pinned to * the way 1.27 stretched a column under a float that stands over several * columns: `headings.balancing.stretchAfterWideFloats: 'always'`, so the * column takes its after-float line as under any float, where today it * moves only with the others under the float or to end flush. A * configuration that does not balance its columns, that turns * `stretchAfterFloats` off or that sets the key is returned as it is (the * same object). */ export declare function pinLegacyWideFloatStretch>(config: T): T; /** * A configuration written before #711 (postext 1.27 or earlier), pinned to * the way 1.27 cut a closing band level: `headings.balancing.trailingStep: * 'grid'`, every cut a whole number of baseline-grid lines, where today a * band whose text is set on a leading of its own is cut by lines of that * leading. A configuration that does not balance its columns, that turns * `trailing` and `beforeSpan` both off or that sets the key is returned as * it is (the same object). */ export declare function pinLegacyTrailingStep>(config: T): T; /** * A configuration written before #712 (postext 1.27 or earlier), pinned to * the way 1.27 broke an index between columns: `index.groups. * splitMinEntries: 1`, so a column may end between any two entries of a * group, where today two of them stay and two go on. A configuration that * sets the key is returned as it is (the same object). */ export declare function pinLegacyIndexGroupSplit>(config: T): T; /** * A configuration written before #717 (postext 1.27 or earlier), pinned to * the break rules it laid out with on a character grid: a config with * `cjk.grid.enabled` gets `bodyText.avoidWidows: true`, and in the Japan * region `bodyText.avoidOrphans: true` too, each where it does not set the * key, where today the first is off by default on a grid and the second * in the Japan region ({@link avoidOrphansByDefault}; a Chinese grid keeps * it on, so nothing is written there). Any other configuration is * returned as it is (the same object). */ export declare function pinLegacyGridBreakRules>(config: T): T; /** * A configuration written before #729 (postext 1.27 or earlier), pinned to * the caption 1.27 gave a resource set in the text: `layout.inlineCaptionSide: * false` on a `oneAndHalf` layout that does not set the key, so * `placement.captionSide` acts on column floats only and the caption of an * inline embed stays under it, where today it goes to the float-only side * column. Any other configuration is returned as it is (the same object). */ export declare function pinLegacyInlineCaptionSide>(config: T): T; /** * A configuration written before #634 (postext 1.24 or earlier), pinned to * the way 1.24 placed a table set `here`: `tableStyle.splitInline: false`, * so an inline table that does not fit the room left in its column moves * whole to the next one, where today it is cut between rows. The named * table styles inherit it. A configuration that sets `splitInline` is * returned as it is (the same object). */ export declare function pinLegacyInlineTableSplit>(config: T): T; /** * A configuration written before #634 (postext 1.24 or earlier), pinned to * the way 1.24 read `:::columns`: `layout.flowColumns: false`, so a fence * outside a box is ignored (its blocks run at the full measure) and a box * that splits never cuts inside a group, where today the one sets its * blocks in sub-columns and the other cuts between them. A configuration * that sets `flowColumns` is returned as it is (the same object). */ export declare function pinLegacyFlowColumns>(config: T): T; /** * A configuration written before #639 (postext 1.24 or earlier), pinned to * the slots 1.24 offered under a page-span opener: * `layout.floatsUnderOpener: false`, so a float fenced or embedded right * after an opener set over several text columns lands from the second * column on, where today it takes the head of the opener's own column, * under its band. A configuration that sets `floatsUnderOpener` is * returned as it is (the same object). */ export declare function pinLegacyOpenerHeadFloats>(config: T): T; /** * A configuration written before #620 (postext 1.22 or earlier), pinned to * the indents of its paragraph styles: a style that sets both * `firstLineIndent` and a non-zero `hangingIndent` loses the * `firstLineIndent`, which up to 1.22 the hanging indent replaced (today * the first line starts at it). The styles of its HTML viewer's overrides * are pinned the same way. A configuration with no such style is returned * as it is (the same object). */ export declare function pinLegacyPairedIndents>(config: T): T; /** * A configuration written before #620 (postext 1.22 or earlier), pinned to * the way it read a backslash that ends a line of a paragraph, a quotation * or a list item, and `\\` in one: `bodyText.hardLineBreaks: false`, the * backslashes printed and the lines joined with a space, where today they * are forced line breaks. A configuration that names the setting already * is returned as it is (the same object). */ export declare function pinLegacyHardBreaks>(config: T): T; /** * A configuration written before #624 (postext 1.22 or earlier), pinned to * the way it read a ```` ``` ```` or `~~~` fence: `codeStyle.blocks: false`, * the fence and the lines inside it read as Markdown (paragraphs, headings, * lists…), where today they are a code block set as written. A * configuration that names the setting already is returned as it is (the * same object). */ export declare function pinLegacyCodeBlocks>(config: T): T; /** * A configuration written before postext 1.5, pinned to the headings it * laid out then: `headings.inlineMarks: false`, where 1.4 printed the text * of a heading's `*italic*`, `**bold**` and other marks in the heading's * plain style. A configuration that names the setting already is returned * as it is (the same object). */ export declare function pinLegacyHeadingMarks>(config: T): T; /** * A configuration written before postext 1.5, pinned to the drop caps it * laid out then. Up to 1.4 a design text's `dropCap` that named no * `fontSize` was as tall as the line boxes it spans over 0.72 (the share of * the size its capitals take), so its top stood above the capitals of the * first line; today's default brings the two level. Every such drop cap, * in whatever design it sits (running heads, heading designs and styles, * part pages, the contents' part rows), gets that size written out: in the * unit of the element's leading when that is a length, else in the unit of * its font size, at the size 1.4 set at the document's `page.dpi` (to the * last digit in most cases, and never more than a rounding step or two * away). A configuration with none is returned as it is (the same object). */ export declare function pinLegacyDropCapSize>(config: T): T; /** * A configuration written before #637 (postext 1.24 or earlier), pinned to * the way 1.24 broke lines inside a book title: `cjk.titleMinChars: 1`, a * line breaking anywhere in a `《…》` or `〈…〉` title the level allows * (`《說|文》`), where today two characters of it stand on either side of a * break. A configuration that sets `titleMinChars` is returned as it is * (the same object). */ export declare function pinLegacyTitleBreaks>(config: T): T; /** * A configuration written before #637 (postext 1.24 or earlier), pinned to * the way 1.24 set the circled numbers ①–⑳ and their kin in CJK text: * `cjk.circledNumbers: 'western'`, as Western letters with the Han–Latin * space on both sides and a line free to end on one, where today they are * Chinese characters kept off a line end. A configuration that sets * `circledNumbers` is returned as it is (the same object). */ export declare function pinLegacyCircledNumbers>(config: T): T; /** * A configuration written before #637 (postext 1.24 or earlier), pinned to * the way 1.24 set design text in Chinese or Japanese (openers, heading * designs, running heads, page designs): `cjk.composeDesignText: false`, * wrapped at spaces with every mark at the font's own advance, where * today it takes the body's CJK rules. A configuration that sets * `composeDesignText` is returned as it is (the same object). */ export declare function pinLegacyDesignText>(config: T): T; /** * A configuration written before #720 (postext 1.27 or earlier), pinned to * the way 1.27 broke a line inside a two-row note: `cjk.warichu.minChars: * 1`, so a break may leave one character of the note at the end of a line * or at the head of the next, where today two stand on either side. A * configuration that sets `warichu.minChars` is returned as it is (the * same object). */ export declare function pinLegacyNoteBreaks>(config: T): T; /** * A configuration written before #721 (postext 1.27 or earlier), pinned to * the sides of a Western word 1.27 set the Han–Latin space on: * `cjk.latinSpacingEdge: 'letters'` on a configuration that resolves to * the Japan region ({@link cjkRegionOfConfig}) and does not set the key, * where today such a document also sets the space on a side that ends in * a bracket or a sign (`normalize()関数`). A Chinese document keeps * `'letters'` by default, and any other configuration is returned as it is * (the same object). */ export declare function pinLegacyLatinSpacingEdge>(config: T): T; /** * A configuration written before #702 (postext 1.27 or earlier), pinned to * the way it set a cross-reference: `crossRefs.breakLabels: false`, every * label one word no line breaks inside, where today a label of words (the * text of a `[words]{#id}` anchor, a title, a `text="…"` override) breaks * at its spaces and those spaces stretch with the line. A configuration * that names the setting already is returned as it is (the same object). */ export declare function pinLegacyRefLabelBreaks>(config: T): T; /** * A configuration written before #728 (postext 1.27 or earlier), pinned to * the way it placed its comic balloons: `comics.lettering.strictPlacement: * false`, so a balloon reshaped to fit its panel may part a Chinese word * as it did, where today such a shape pays for the cut and the placement * looks elsewhere first. A configuration that names the setting already is * returned as it is (the same object). */ export declare function pinLegacyBalloonPlacement>(config: T): T; /** * A configuration written before #725 (postext 1.27 or earlier), pinned to * the way it shaped a word with no letter (`46.`, `1367)`): * `bodyText.scriptContext: false`, each such word shaped alone, in the * script the browser that measures it and the PDF's shaper pick, where * today it takes the script of the text around it. Every such * configuration gets it: the rule acts in a face that draws its * punctuation by script, and which faces a document loads is not known * here. A configuration that names the setting already is returned as it * is (the same object). */ export declare function pinLegacyScriptContext>(config: T): T; /** * A configuration written before #770 (postext 1.29 or earlier), pinned to * the language its text was shaped in: `bodyText.shapingLanguage: 'host'`, * the measuring contexts left with the language of the page that hosts * the layout (none in a worker), the canvas painting in that same * language, and only a Chinese, Japanese, Korean or right-to-left * document declared and embedded in its own, where from postext 1.30 a * document is measured, painted and embedded in its own language. Up to * 1.28 there was no other way; 1.29.1 and 1.29.2 had the setting with the * host's as its default. Every such configuration gets it: a face answers * with other glyphs under a language, and which faces a document loads is * not known here. The rules that measure a text as it is painted (one * width for a string, right-to-left words, the parts of a broken word, * the runs of a design text, the PDF's shaping word by word and its * choice of file) apply only to a document shaped in its own language, so * a pinned one keeps every width and its PDF. A configuration that names * the setting already is returned as it is (the same object): `'host'`, * or `'document'`, which postext 1.29.1 and 1.29.2 stored for a document * that asked for it. One stored under 13 with no value was laid out in * the host's language by 1.29.1 and 1.29.2, and in the document's by * 1.29.0, whose canvas and PDF did not follow that measure: it reads with * the host's too. One stored under 14 with no value takes the default, * the document's. */ export declare function pinLegacyShapingLanguage>(config: T): T; /** * A configuration written before #1119 (postext 1.51 or earlier), pinned to * the type its paragraph styles took inside a box: * `bodyText.paragraphStylesInBoxes: 'document'`, the face, size, leading, * weights and colour a style leaves unset taken from the document's body * text, where today they are the box's. A configuration that names the * setting already, or declares no paragraph style (in the configuration or * in its HTML viewer's overrides), is returned as it is (the same object). */ export declare function pinLegacyBoxParagraphStyles>(config: T): T; /** * A configuration written before #765 (postext 1.28 or earlier), pinned to * the box it set before a task item: `unorderedLists.taskBox: 'character'`, * the character ☐ (☑ when the item is done) set as text in the list's * face and the item's text started after its width, where today the * engine draws the box and gives it a room of its own. That width was the * advance of the character in whatever font held it, a font of the system * in most documents, which is not known here: every such configuration * gets the pin, so no line of its task lists moves. A configuration that * names the setting already is returned as it is (the same object). */ export declare function pinLegacyTaskBox>(config: T): T; /** * A configuration written for postext 1.51 or earlier, pinned to the * rounded ends its highlight bands had then (#1149): every mark style that * names no `borderRadius` gets the old default, 0.2 em, and a * configuration with no `markStyles` gets the built-in `mark` style with * it. An empty list, or one where every style names its radius, is * returned as it is (the same object). */ export declare function pinLegacyMarkRadius>(config: T): T; /** * A configuration written for postext 1.51 or earlier, pinned to the line * breaks its formatted text made at a slash (#1164): * `bodyText.breakAfterSlashes: false`, where the rich breaker ended a line * after a slash only inside a web address and divided a word wider than * its line at a syllable or between two letters. Every such configuration * gets it: a slash between two words may stand in a caption, a table cell * or a bibliography as well as in the chapters, and only the chapters are * read here. A configuration that names the setting already is returned as * it is (the same object). */ export declare function pinLegacySlashBreaks>(config: T): T; /** * A configuration written for postext 1.53 or earlier, pinned to the way it * read a fence in a notation language — ```` ```abc ````, ```` ```musicxml ````, * ```` ```mei ````, ```` ```humdrum ````, ```` ```kern ```` — as a code * listing (#1172): `scoreStyle.enabled: false`. A configuration that names * the setting already is returned as it is (the same object). */ export declare function pinLegacyScoreFences>(config: T): T; export interface MigrateConfigOptions { /** * The markdown the configuration lays out (a bundle's chapters, a book's), * when the caller has it. Most pins are there for something the text * sets (maths for {@link pinLegacyMathSize}, a `::resource{id="…"}` line * for {@link pinLegacyInlineGap}, a `:::callout` for {@link * pinLegacyBoxChildCut}, a heading for {@link pinLegacyHeadingSplit}, a * task item for {@link pinLegacyTaskBox}…): a pin the content shows * nothing for is not given, which keeps a stored configuration as short * as it was. {@link migrateConfig} says what each pin looks for; a few * read the configuration too (CJK in its design text, a note it sets as * warichu, a page-span heading, a bayt verse layout), and the pins that * look for nothing in the text are given whatever it holds (the heading * breaks, the drop-cap sizes, the ragged breaking, the paired indents, * the design overflow, the grid balancing and break rules, the script * context, the shaping language). Without it every pin the stamp calls for is given, each * still under the conditions on the configuration it names. * Any iterable of texts will do, a generator or a Map's `values()` * included: it is read once. */ content?: string | Iterable; } /** * A configuration stored under `configVersion` (see {@link CONFIG_VERSION}), * in today's terms. One with no version (a number is expected; anything * else counts as none) or one older than 3 has its heading breaks pinned by * {@link pinLegacyHeadingBreaks}; one older than 4 has its maths size * pinned by {@link pinLegacyMathSize}, unless `options.content` shows it * sets no maths; one older than 5 has its inline gap pinned by {@link * pinLegacyInlineGap}, unless `options.content` shows it embeds no * resource; one older than 6 has its heading marks pinned by {@link * pinLegacyHeadingMarks}, unless `options.content` shows no heading * carries one, its drop caps by {@link pinLegacyDropCapSize}, its * colon-list room by {@link pinLegacyColonListRoom}, unless * `options.content` shows no list introduced by a colon, and its box gap * by {@link pinLegacyBoxResourceGap}, unless `options.content` shows it * embeds no resource inside a box, and its box cut by {@link * pinLegacyBoxChildCut}, unless `options.content` shows it holds no box; * one older than 7 has its dash breaks pinned by {@link * pinLegacyDashBreaks}, unless `options.content` shows no closed dash, and * its ragged breaking by {@link pinLegacyRaggedBreaking}, when it sets some * running text ragged; one older than 8 has its split under a heading * pinned by {@link pinLegacyHeadingSplit}, unless `options.content` shows * no heading, the space under its `:::paragraphs` containers by {@link * pinLegacyParagraphContainerSpacing}, when it declares a paragraph style, * unless `options.content` shows no such container, and its compound * breaks by {@link pinLegacyHyphenBreaks}, unless `options.content` shows * no compound; one older than 9 has its poems with no hemistich separator * pinned by {@link pinLegacyVerseLayout}, unless `options.content` shows * none, its paragraph styles' indents by {@link pinLegacyPairedIndents}, * its forced line breaks by {@link pinLegacyHardBreaks}, unless * `options.content` shows none, and its code fences by {@link * pinLegacyCodeBlocks}, unless `options.content` shows none; one older * than 10 has its verse turnovers pinned by {@link * pinLegacyVerseTightening}, unless `options.content` shows no poem set * line by line, the text elements of its heading and part designs * that set no `overflow` by {@link pinLegacyDesignOverflow}; one older * than 11 has the balancing of a horizontal page on a character grid * pinned by {@link pinLegacyGridBalancing}, and its inline tables by {@link * pinLegacyInlineTableSplit}, unless `options.content` shows it embeds no * resource, its `:::columns` groups by {@link pinLegacyFlowColumns}, * unless `options.content` shows none, its book titles by {@link pinLegacyTitleBreaks}, unless * `options.content` shows none, its circled numbers by {@link * pinLegacyCircledNumbers}, unless `options.content` shows none, and its * design text by {@link pinLegacyDesignText}, unless neither * `options.content` nor the configuration holds CJK text, and the slots * under its page-span openers by {@link pinLegacyOpenerHeadFloats}, when * it sets a heading level or style with `span: 'page'`, unless * `options.content` shows no heading; one older than 12 has the order of * its balancing levers pinned by {@link pinLegacyLooseOrder}, when it * balances its columns and lets a heading take more than two lines, unless * `options.content` shows no heading, and the after-float lever under a * float over several columns by {@link pinLegacyWideFloatStretch}, when it * balances its columns, unless `options.content` shows no float, the unit * of the level cut of its closing bands by {@link pinLegacyTrailingStep}, * when it balances its columns, unless `options.content` shows prose and * headings only, and the * breaks inside the groups of its indexes by {@link * pinLegacyIndexGroupSplit}, unless `options.content` shows no `:::index`; * it also has the widow and * orphan rules of a page on a character grid pinned by {@link * pinLegacyGridBreakRules}, the breaks inside its two-row notes by * {@link pinLegacyNoteBreaks}, unless neither `options.content` nor the * configuration shows a note, and the sides of a Western word that take * the Han–Latin space in the Japan region by {@link * pinLegacyLatinSpacingEdge}, unless `options.content` shows no kana or * kanji, and the caption of a resource set in the text of a `oneAndHalf` * layout by {@link pinLegacyInlineCaptionSide}, unless `options.content` * shows it embeds no resource, and the labels of its cross-references kept whole by {@link * pinLegacyRefLabelBreaks}, unless `options.content` shows no reference, * and its comic balloons placed as 1.27 placed them by {@link * pinLegacyBalloonPlacement}, unless `options.content` shows no comic page * or strip, and its words with no letter shaped alone by {@link * pinLegacyScriptContext}; one older than 13 has the box of its task items * set as a character by {@link pinLegacyTaskBox}, unless `options.content` * shows no task item; one older than 14 has its text shaped in the host's * language by {@link pinLegacyShapingLanguage}, unless it names the * language its text is shaped in; one older than 17 has the type of its * paragraph styles inside a box pinned by {@link * pinLegacyBoxParagraphStyles}, when it declares a paragraph style; one * older than 18 has the rounded ends of its highlight bands pinned by * {@link pinLegacyMarkRadius}, unless neither `options.content` nor the * configuration shows a `:mark[…]`; one older than 19 has its breaks at a * slash pinned by {@link pinLegacySlashBreaks}. * A current one is returned as it is (the same object). * Migrate a stored configuration once and store it again under * `CONFIG_VERSION`: the maths pin multiplies a scale, so a configuration * read twice under its old number would grow twice. */ export declare function migrateConfig>(config: T, configVersion: unknown, options?: MigrateConfigOptions): T; /** * A bundle's configuration in today's terms: `base` (the reader's own) * under the manifest's `config` and the locale's overrides, both stored * under `configVersion`. The manifest's top-level keys replace the base's * whole; the locale's override is merged over them field by field * ({@link mergeConfigLayers}) when the bundle was written for rules 21 or * later, and replaces them key by key when it is older. So * the heading breaks are pinned layer by layer (the base's are taken as * they are) and the maths size once, on the `math` the layers leave in * force — the size 1.4 set this bundle's formulas at, whichever layer * named it, the base included when neither the manifest nor the locale * names one. The inline gap, the box gap and the box cut are pinned the * same way, on the `layout` in force, the colon-list room, the dash * breaks, the compound breaks, the ragged breaking and the space under * `:::paragraphs` containers on the `bodyText` in force (the ragged * breaking when the merged configuration sets some running text ragged, * the container space when it declares a paragraph style), the heading * marks and the split under a heading on the `headings` in force, the * drop caps and the overflow of heading and part design texts wherever * they sit in the merged configuration, the balancing of a horizontal * character grid on the merged `cjk`, `layout` and `headings`, the * inline tables on the `tableStyle` in force, the `:::columns` groups and * the slots under a page-span opener on the `layout` in force (the slots * when the merged configuration sets a page-span heading), and the book * titles, the circled numbers and the design text on the `cjk` in force, * the order of the balancing levers and the after-float lever under a * float over several columns on the `headings` in force (when the * merged configuration balances its columns), with the unit of the level * cut of a closing band, the breaks inside the groups * of an index on the `index` in force, * and the widow and orphan rules of a character grid on the merged `cjk` * and `bodyText`, and the breaks inside two-row notes and the sides of a * Western word that take the Han–Latin space (in the Japan region, read * from the merged `cjk`, `locale` and hyphenation locale) on the `cjk` in * force, the side caption of a resource set in the text on the `layout` in * force, and the labels of cross-references on the `crossRefs` in force, * and the shaping of words with no letter and the language the text is * shaped in on the `bodyText` in force, and the box of a task item on the * `unorderedLists` in force, the type of paragraph styles inside a box * on the `bodyText` in force (when the merged configuration declares a * paragraph style), the ends of the highlight bands on the * `markStyles` in force, and the breaks at a slash on the `bodyText` in * force. * @internal `readBundle`'s; hosts call {@link migrateConfig}. */ export declare function migrateBundleConfig(base: PostextConfig, layers: readonly PostextConfig[], configVersion: unknown, options?: MigrateConfigOptions): PostextConfig; //# sourceMappingURL=configVersion.d.ts.map