import { type RequestContext } from '../../utils/internal/requestContext.js';
/**
 * Result of parsing markdown with frontmatter.
 * @template T The expected type of the parsed frontmatter object.
 */
export interface FrontmatterResult<T = unknown> {
    /**
     * Remaining markdown content after frontmatter extraction.
     * If no frontmatter exists, contains the original markdown.
     */
    content: string;
    /**
     * Parsed frontmatter object. Empty object if no frontmatter found.
     */
    frontmatter: T;
    /**
     * Indicates whether frontmatter was found and extracted.
     */
    hasFrontmatter: boolean;
}
/**
 * Utility class for extracting and parsing YAML frontmatter from markdown documents.
 * Supports Obsidian-style and Jekyll-style frontmatter (YAML between `---` delimiters).
 * Delegates YAML parsing to {@link yamlParser}.
 */
export declare class FrontmatterParser {
    /**
     * Extracts and parses YAML frontmatter from a markdown string.
     *
     * Looks for a `---`-delimited block at the very start of the document. If
     * found, the YAML inside is parsed via {@link yamlParser} and the remaining
     * markdown is returned separately. An empty `---\n---` block is accepted and
     * returns `frontmatter: {}` with `hasFrontmatter: true`. If no frontmatter
     * block is present, the original string is returned unchanged.
     *
     * @template T - The expected shape of the parsed frontmatter object. Defaults to `unknown`.
     * @param markdown - The markdown string that may contain a frontmatter block.
     * @param context - Optional {@link RequestContext} used for correlated logging.
     * @returns A {@link FrontmatterResult} with `frontmatter`, `content`, and `hasFrontmatter`.
     * @throws {McpError} With code `ValidationError` if the YAML content is present but malformed.
     * @example
     * ```typescript
     * import { frontmatterParser } from './frontmatterParser.js';
     *
     * const md = `---\ntitle: Hello\ntags: [a, b]\n---\n\n# Body`;
     * const result = await frontmatterParser.parse<{ title: string; tags: string[] }>(md);
     * // result.frontmatter → { title: 'Hello', tags: ['a', 'b'] }
     * // result.content     → '\n# Body'
     * // result.hasFrontmatter → true
     * ```
     */
    parse<T = unknown>(markdown: string, context?: RequestContext): Promise<FrontmatterResult<T>>;
}
/**
 * Singleton instance of {@link FrontmatterParser}.
 *
 * Use this shared instance to extract and parse YAML frontmatter from markdown
 * documents rather than constructing a new parser per call.
 *
 * @example
 * ```typescript
 * import { frontmatterParser } from './frontmatterParser.js';
 * import { requestContextService } from '../../utils/internal/requestContext.js';
 *
 * const context = requestContextService.createRequestContext({ operation: 'ParseObsidianNote' });
 *
 * // Markdown with frontmatter
 * const markdown = `---
 * title: My Note
 * tags: [productivity, notes]
 * date: 2025-01-15
 * ---
 *
 * # Note Content
 * This is the actual note.`;
 *
 * const result = await frontmatterParser.parse(markdown, context);
 * console.log(result.frontmatter);    // { title: 'My Note', tags: [...], date: '2025-01-15' }
 * console.log(result.content);        // '\n# Note Content\nThis is the actual note.'
 * console.log(result.hasFrontmatter); // true
 *
 * // Markdown without frontmatter
 * const plainMarkdown = '# Just Content';
 * const result2 = await frontmatterParser.parse(plainMarkdown, context);
 * console.log(result2.frontmatter);    // {}
 * console.log(result2.content);        // '# Just Content'
 * console.log(result2.hasFrontmatter); // false
 * ```
 */
export declare const frontmatterParser: FrontmatterParser;
//# sourceMappingURL=frontmatterParser.d.ts.map