/** * Whether a line may end after the em or en dash `dash`, set closed between * `prev` and `next` (the characters around it; undefined at the edge of the * text, or where a space stands): "say—that’s", "riddles.—I", "Hamburg–Berlin". * `beforePrev` is the character before `prev`, read the same way. * The dash is the Unicode line-breaking class B2 (em) or BA (en), both of * which allow a break after them. Never after a dash that opens an aside or a * line of dialogue: a space before it ("—dijo"), or a space and a quotation * mark (`said "—Hola`, German `sagte »—Ich`). A straight quote, `»`, `”` or * `’` before the dash may open a quote as well as close one, so it counts as * closing only after a letter, a digit or closing punctuation ("\"no\"—and", * "boys'—and", "«no»—y"), and `»` also after a no-break space (French * "« non »—et"). `“` and `«`, which German and Danish close with, count as * closing only after a letter, a digit, `.`, `!`, `?` or `…` ("„nein“—und", * "»nej«—og"). Never before punctuation ("él—,"), a quotation mark * or a bracket ("thinking—\" and", "says—“no”", "says—(no)"), inside a run of * dashes ("——"), or inside a range of numbers set with an en dash * ("1914–1918"). A quote after a dash may close the speech as well as open * one, and UAX #14 allows no break before it; pretext, which sets plain text * line by line, keeps a dash with the quote or bracket after it, so both * breakers agree. */ export declare function breaksAfterDash(prev: string | undefined, dash: string, next: string | undefined, beforePrev?: string): boolean; /** Whether `ch` is an em or an en dash. */ export declare function isDash(ch: string | undefined): boolean; /** Whether `text` holds a compound (see {@link COMPOUND_RE}). A soft hyphen * next to the hyphen hides it, as it hides it from the breakers. */ export declare function hasCompound(text: string): boolean; /** * Whether a line may end after a hyphen the text carries, between `prev` * and `next` (the characters around it): between two letters only * ("meta-analyses", "UNE-EN"), never in "-5", "1-2" or "pre-(war)". The * line then ends on that hyphen and nothing is added. */ export declare function breaksAfterHardHyphen(prev: string | undefined, next: string | undefined): boolean; /** * How far a ragged line may fall short of its measure at the cost a * justified line pays at its word-spacing limit, in ems of the text: the * right-hand "glue" of a ragged setting in Knuth and Plass's model (TeX's * `\rightskip` of `0pt plus 3em`). A shorter line costs less, a line short by * more than this is priced like one stretched past the limit. */ export declare const RAGGED_STRETCH_EM = 3; /** The size of a CSS font string, in px (the `16px` of `italic 16px Serif`); * 16 when it names none. */ export declare function fontSizePxOf(font: string): number; /** The stretch a ragged line of `font` gets in the Knuth–Plass model (see * {@link RAGGED_STRETCH_EM}). */ export declare function raggedStretchPx(font: string): number; /** The zero-width space U+200B: a break opportunity the author typed, * with no width and nothing added at the line end. */ export declare const ZERO_WIDTH_SPACE = "\u200B"; /** See {@link getSlashBreaks}. */ export declare function setSlashBreaks(on: boolean): void; /** Whether a line may end after a slash between two words (see * {@link slashBreakIndices}); also whether a word wider than its line is * divided after a slash first. */ export declare function getSlashBreaks(): boolean; /** * Where a line may end after a slash inside a word (#1164), as offsets into * `text` (the position after the slash): "entrada/" | "salida", * "ACC/" | "AHA/" | "AAPA". The slash stands between two runs of at least * three letters or digits, and not between two digits. A unit keeps its * slash ("km/h", "m/s", "kg/m³", "km/min", "mg/dL"), and so do a short * pair ("and/or", "y/o", "c/Mayor"), a fraction and a date ("1/2", * "10/03/2026", "2020/2021"). Nothing is added at the line end, and the * next line opens with the word after the slash. A web address is broken * at its own joints instead (`urlBreakIndices`). None while * {@link getSlashBreaks} is off. */ export declare function slashBreakIndices(text: string): number[]; /** * `text` with its zero-width spaces taken out, and where each one stood as * offsets into the text left (#1164): the rich breaker may end a line * there, adds nothing, and the character never reaches the line text (the * plain breaker drops it too). Offsets at either end of the text are no * break. A text that is only zero-width spaces is left as it is. */ export declare function withoutZeroWidthSpaces(text: string): { text: string; breaks: number[]; }; //# sourceMappingURL=breakRules.d.ts.map