/**
 * YAML parser layer — schema-validating wrapper around the `yaml` v2 npm
 * package's Document API.
 *
 * Two reasons we go through `parseDocument` (not the lighter `parse`):
 *   1. Comment preservation. The setup UI (`docs/opensquid-real-design.md`
 *      §"Setup UI/UX") needs to write a user's edits back to YAML without
 *      shredding their comments — that requires the Document round-trip.
 *   2. Structured error surface. `Document.errors` is a discriminated list of
 *      lint codes (DUPLICATE_KEY, MISSING_CHAR, BAD_INDENT, …), each carrying
 *      a `linePos`. We forward those messages verbatim so callers can blame
 *      the right line.
 *
 * Validation is enforced via Zod (Task 2.1) — never via raw `JSON.parse` —
 * so this module is the single load boundary for YAML. Schemas accept
 * `unknown` input (per Zod's design) so `Document.toJSON()`'s `unknown`
 * return type drops in without a cast.
 *
 * Risk note from spec §"Task 2.2 / Risk callouts": `strict: true` does NOT
 * universally guard duplicate-key detection across yaml v2 patch versions.
 * Probe at `dup_check` (post-research) on yaml@2.9.0 confirms that the
 * installed version DOES raise `DUPLICATE_KEY` under `strict: true`, so no
 * separate detector is needed today. If a future pinned version regresses,
 * add `uniqueKeys: true` (orthogonal flag that forces the check); both
 * options are kept in scope by yaml v2's option model.
 *
 * Imports from: node:fs/promises, yaml, zod (type only).
 * Imported by: src/packs/loader.ts (Task 2.3), setup UI write-back paths.
 */
import { type Document } from 'yaml';
import type { z } from 'zod';
export interface ParsedYaml<T> {
    data: T;
    document: Document.Parsed;
}
export declare function parseYamlFile<T>(path: string, schema: z.ZodType<T>): Promise<ParsedYaml<T>>;
export declare function parseYamlString<T>(raw: string, schema: z.ZodType<T>, ctx?: string): ParsedYaml<T>;
export declare function serializeYamlDocument(path: string, doc: Document.Parsed): Promise<void>;
//# sourceMappingURL=yaml.d.ts.map