import type { HyphenationLocale, LocaleTag } from './types.js'; export { HYPHENATION_LOCALES, matchHyphenationLocale, hyphenationLocaleFor } from './locale.js'; export { normalizeHyphenationExceptions } from './hyphenationExceptions.js'; /** Set the dictionary {@link hyphenateText} uses when called without a * locale. Any BCP 47 tag is accepted (see {@link matchHyphenationLocale}); * a missing or blank one sets `'en-us'`. */ export declare function setHyphenationLocale(locale: LocaleTag): void; /** The dictionary {@link hyphenateText} uses when called without a locale. */ export declare function getHyphenationLocale(): HyphenationLocale; /** * Hyphenate a full text string by inserting soft hyphens at syllable boundaries * using TeX/Liang patterns for the active locale, or for `locale` (any BCP 47 * tag, see {@link matchHyphenationLocale}) when given — a missing or blank * one counts as not given. The dictionary also puts a zero-width space after * a slash inside a word (see {@link withoutSlashJoints}). The document's * rules ({@link setHyphenationRules}: words kept whole or divided at named * points, capitalised words, cited names) are applied to the dictionary's * result; {@link hyphenateByDictionary} gives the dictionary's own. */ export declare function hyphenateText(text: string, locale?: LocaleTag): string; /** * {@link hyphenateText} without the document's rules: every point the * patterns give. A word wider than its whole measure is divided there when * a rule keeps it whole (#699). */ export declare function hyphenateByDictionary(text: string, locale?: LocaleTag): string; /** What a document asks of its dictionary beyond the patterns * (`bodyText.hyphenation.exceptions` and `capitalized`, * `citations.hyphenateNames`). */ export interface HyphenationRules { /** Words the dictionary never divides (`'Alice'`) or divides only at the * hyphens of the entry (`'You-Tube'`), as resolved * (`normalizeHyphenationExceptions`). An entry in lower case matches the * word in any case; one with an initial capital matches the occurrences * that start with a capital. */ exceptions?: readonly string[]; /** `false`: no break inside a word that starts with a capital. */ capitalized?: boolean; /** Names never divided where they start with a capital (the authors a * document cites, `citations.hyphenateNames: false`). Each is read run * of letters by run of letters. */ names?: readonly string[]; } /** * Set the rules {@link hyphenateText} applies to the dictionary's result: * the document's, on every build (`initHyphenator`); a call with none, or * with rules that ask for nothing, clears the ones of the build before. A * host that measures text outside `buildDocument` sets them as it sets the * locale ({@link setHyphenationLocale}). */ export declare function setHyphenationRules(rules?: HyphenationRules): void; /** An id of the active rule set, `''` when no rule is set: lines measured * under one set of rules are not reused under another. */ export declare function getHyphenationRulesKey(): string; /** * Whether the soft hyphen typed at `at` in `text` is a break opportunity * (#700): only between two letters, combining marks or digits. One typed at * the edge of a word, after an opening bracket or quotation mark, or before * closing punctuation (`­Alice`, `(­Alice)`, `Alice­,`) breaks nothing and * prints no hyphen: the line would end on a hyphen after a whole word, or on * one its bracket carries. The word it stands in still gets no dictionary * point, so a soft hyphen before the first letter keeps that occurrence of * the word whole. Of soft hyphens typed in a row, the first counts. */ export declare function softHyphenBreaks(text: string, at: number): boolean; /** * `hyphenated` — `source` as written, or with the dictionary's soft hyphens * and slash joints added — without the soft hyphens of `source` that are no * break ({@link softHyphenBreaks}), for a breaker that takes every soft * hyphen it is given (pretext, the design text's word cutter). The * dictionary's own points stay. */ export declare function withoutEdgeSoftHyphens(source: string, hyphenated?: string): string; /** * {@link hyphenateText} with the active dictionary, leaving every compound * whole: a whitespace-delimited word with a hyphen between two letters * ("after-dinner") gets no soft hyphen, so it breaks only after its own * hyphen (`HyphenationConfig.compounds: false`). The soft hyphens the text * carries stay. */ export declare function hyphenateTextKeepingCompounds(text: string): string; /** * `hyphenated` — {@link hyphenateText} of `word` — without the zero-width * spaces the dictionary puts after a slash (`entrada/` U+200B `salida`). The * plain breaker takes them as break opportunities; text laid out word by * word (the rich breaker, design text) breaks only at the soft hyphens, and * the character must not ride along into its line text. A zero-width space * the word itself carries stays. */ export declare function withoutSlashJoints(word: string, hyphenated: string): string; //# sourceMappingURL=hyphenate.d.ts.map