import { type Maybe } from '../value/maybe.type'; /** * Default text appended by {@link firstSentence} when the sentence is cut to fit `maxLength`. */ export declare const DEFAULT_FIRST_SENTENCE_END_TEXT = "\u2026"; /** * Configuration for {@link firstSentence}. */ export interface FirstSentenceConfig { /** * Maximum length of the returned text, including `endText`. A longer sentence is cut at the last word boundary that fits. */ readonly maxLength?: Maybe; /** * Text appended when the sentence is cut. * * Defaults to {@link DEFAULT_FIRST_SENTENCE_END_TEXT}. */ readonly endText?: Maybe; } /** * Returns the first sentence of the first paragraph of the input. * * - The first paragraph ends at the first blank line. * - Soft line breaks and runs of whitespace are collapsed to single spaces. * - A sentence ends at `.`, `!` or `?` (plus optional closing `"`, `'`, `)` or `]`) followed by the end of the text, or by whitespace and a character that is not a lowercase letter. * - A period after `e.g`, `i.e`, `cf` or `vs` never ends a sentence. * - With no terminator, the whole flattened paragraph is returned. * - When `maxLength` is set and exceeded, the text is cut at the last space that fits and `endText` is appended. * * @param input - The text to read, typically a JSDoc description. * @param config - Optional length cap and end text. * @returns The first sentence, flattened to a single line. * * @dbxUtil * @dbxUtilCategory string * @dbxUtilTags sentence, summary, first-line, truncate, paragraph, description * @dbxUtilRelated js-doc-inline-links-to-text * * @example * ```ts * firstSentence('Creates the\nthing for the user. Then more.'); * // 'Creates the thing for the user.' * ``` */ export declare function firstSentence(input: string, config?: Maybe): string;