/** * Spaces that glue their neighbours (EF-66): the no-break space U+00A0, the * figure space U+2007, the narrow no-break space U+202F and the zero-width * no-break space U+FEFF. JavaScript's `\s` matches all four, so a breaker * that splits words on `\s` would break the line at them; the word breakers * split on {@link BREAKING_SPACE_RE} instead and keep them inside the word * they join, set at their own width (justification stretches word spaces * only). The word joiner U+2060 is no whitespace and glues already. */ export declare const NO_BREAK_SPACES = "\u00A0\u2007\u202F\uFEFF"; /** The ideographic space U+3000 is no word space either: in Chinese and * Japanese text it is a character one em wide (an indent typed as two of * them, a gap in a title), which a line may break after but which never * stretches on a justified line nor vanishes at a line start. */ export declare const IDEOGRAPHIC_SPACE = "\u3000"; /** One whitespace character a line may break at: `\s` without the * no-break spaces and the ideographic space. */ export declare const BREAKING_SPACE_RE: RegExp; /** Words and the runs of breaking whitespace between them, in order: a * word may hold no-break spaces ("37 °C", "225 000") and ideographic * spaces. */ export declare const WORDS_AND_SPACES_RE: RegExp; /** Runs of breaking whitespace, captured, for `split` (design text keeps * the separators). */ export declare const BREAKING_SPACE_RUNS_SPLIT_RE: RegExp; /** Whether `ch` (one character) is whitespace a line may break at. */ export declare function isBreakingSpace(ch: string | undefined): boolean; /** * The pieces a reference label of words breaks into (#702): its words and * the runs of breaking spaces between them, in order, or undefined when no * line may break inside it. A number, a Roman numeral or a single letter * keeps to the word before it, the space between them part of the piece * (`Fig. 1a`, `plate IV`, `Appendix A`, `page 12`): only a label made of * words breaks, and never between a word and its number. Spaces at the * label's ends stay with the word beside them. */ export declare function refLabelPieces(text: string): string[] | undefined; /** Whether `text` is nothing but breaking whitespace (and not empty). */ export declare function isBreakingSpaceRun(text: string): boolean; /** Whether `text` sets nothing: empty, or breaking whitespace only. A * no-break space (U+00A0, U+2007, U+202F) is content, as in CommonMark, * where a line holding one is no blank line (`String.prototype.trim` would * strip it). The zero-width U+FEFF has no width to keep and is mostly a * byte-order mark left by a pasted file, so a text of it alone is blank, * as `trim` has it. */ export declare function isBlankText(text: string): boolean; /** `text` with every run of breaking whitespace set as one space and the * ends trimmed of it; no-break spaces stay as they are. */ export declare function collapseBreakingSpaces(text: string): string; /** {@link collapseBreakingSpaces}, keeping the ideographic space (U+3000): * in a Chinese title (`甄士隱夢幻識通靈 賈雨村風塵懷閨秀`, `第一回 …`) it is * a character of the title, not a gap between words. */ export declare function collapseTitleSpaces(text: string): string; //# sourceMappingURL=spaces.d.ts.map