/** * Unified comment parser that combines TSDoc structural parsing with span * enrichment from the regex-based comment-syntax parser. * * TSDoc handles structured extraction (summary, remarks, deprecated) while * the regex parser provides accurate source spans for IDE tooling. The two * are aligned by matching normalized tag names in document order. */ import { type ParsedCommentTag } from "./comment-syntax.js"; import { type ExtensionTagSource } from "./tag-registry.js"; /** * Options for the unified comment parser. * * @public */ export interface UnifiedParseOptions { /** Absolute source offset for all emitted spans. */ readonly offset?: number; /** Extension tag sources used to classify target specifiers. */ readonly extensions?: readonly ExtensionTagSource[]; /** Additional tag names to register with the TSDoc parser. */ readonly extensionTagNames?: readonly string[]; } /** * A parsed tag that combines regex-derived span information with TSDoc * structural enrichment for the same tag. * * @public */ export interface UnifiedParsedTag extends ParsedCommentTag { /** Best-effort resolved payload text (prefers raw span for TAGS_REQUIRING_RAW_TEXT). */ readonly resolvedPayloadText: string; } /** * Result of a unified parse, containing all structural fields extracted from * the comment along with fully-spanned tag information. * * @public */ export interface UnifiedParsedComment { /** Original comment text passed to the parser. */ readonly commentText: string; /** Absolute source offset used for span calculations. */ readonly offset: number; /** Parsed tags with spans and optional TSDoc block references. */ readonly tags: readonly UnifiedParsedTag[]; /** Summary text (text before the first block tag). */ readonly summaryText: string; /** Content of the `@remarks` block, or empty string if absent. */ readonly remarksText: string; /** Whether the comment contains a `@deprecated` block. */ readonly isDeprecated: boolean; /** Deprecation message from `@deprecated`, or empty string if not deprecated. */ readonly deprecationMessage: string; } /** * Parses a JSDoc/TSDoc comment string into a structured representation that * combines TSDoc's structural parsing with the regex parser's accurate spans. * * The parse has four phases: * 1. TSDoc structural parse — extracts summary, remarks, deprecated, and * custom block nodes. * 2. Regex span parse — extracts tag source spans for IDE tooling use. * 3. Tag alignment — matches TSDoc blocks to regex tags by normalized name. * 4. Summary extraction — applies the tag-only leakage fix for unregistered * tags that TSDoc folds into the summary section. * * @public */ export declare function parseUnifiedComment(commentText: string, options?: UnifiedParseOptions): UnifiedParsedComment; //# sourceMappingURL=unified-comment-parser.d.ts.map