/** * Generic YAML frontmatter parser. * * Parses content that may begin with a YAML frontmatter block delimited * by `---`. Returns the parsed frontmatter as `unknown` so each consumer * can apply its own Schema validation. * * @experimental This API is unstable and may change without notice. */ import * as Effect from "effect/Effect"; import { type AppError } from "../app-error/index.js"; /** * Result of parsing frontmatter from content. * * @experimental This API is unstable and may change without notice. */ export interface FrontmatterResult { /** Parsed YAML frontmatter, or undefined if no frontmatter block was found. */ readonly frontmatter: unknown; /** Content body after the frontmatter block, or full content if no frontmatter. */ readonly body: string; } declare const FrontmatterParseFailure_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "FrontmatterParseFailure"; } & Readonly; /** Bounded, document-relative failure from parsing a YAML frontmatter block. */ export declare class FrontmatterParseFailure extends FrontmatterParseFailure_base<{ readonly reason: string; readonly line?: number; readonly column?: number; }> { } /** Normalize a foreign YAML failure without retaining its raw cause or parser code. */ export declare const normalizeFrontmatterParseFailure: (error: unknown, documentLineOffset: number) => FrontmatterParseFailure; /** Preserve the former CLI-facing validation error at higher-level boundaries. */ export declare const frontmatterParseFailureToAppError: (cause: FrontmatterParseFailure) => AppError; /** * Parse frontmatter from content synchronously. * * Throws on malformed YAML. Use `parseFrontmatterEffect` for full error channel. * * @experimental This API is unstable and may change without notice. */ export declare const parseFrontmatterSync: (content: string) => FrontmatterResult; /** * Parse frontmatter from content as an Effect. * * Returns `FrontmatterParseFailure` in the error channel for malformed YAML. * * @experimental This API is unstable and may change without notice. */ export declare const parseFrontmatterEffect: (content: string) => Effect.Effect; export {}; //# sourceMappingURL=frontmatter.d.ts.map