/**
 * Brand voice profile document — portable markdown + YAML frontmatter format.
 *
 * Pure utilities (no Node APIs) shared by the admin UI and server normalization.
 * The markdown file is the interchange format; flat form fields are derived from
 * it for prompt injection and the quick-edit UI.
 */
import type { BrandVoiceProfile } from './types.js';
import type { BrandVoiceStructuredProfile } from './brand-voice-structured.js';
export declare const BRAND_VOICE_DOCUMENT_MAX = 50000;
export type BrandVoiceDocumentStatus = 'draft' | 'reviewed' | 'approved';
export interface BrandVoiceDocumentMeta {
    version: number;
    status: BrandVoiceDocumentStatus;
    generatedFrom: string[];
    lastUpdated: string;
}
export type BrandVoiceDocumentFields = Pick<BrandVoiceProfile, 'name' | 'tone' | 'audience' | 'guidelines' | 'sampleText'>;
export interface ParsedBrandVoiceDocument {
    document: string;
    frontmatter: string;
    body: string;
    meta: BrandVoiceDocumentMeta;
    fields: BrandVoiceDocumentFields;
}
export interface ParseBrandVoiceDocumentResult {
    ok: true;
    value: ParsedBrandVoiceDocument;
}
export interface ParseBrandVoiceDocumentError {
    ok: false;
    error: string;
}
/** Split a markdown file into YAML frontmatter and body. */
export declare function splitBrandVoiceDocument(markdown: string): {
    frontmatter: string;
    body: string;
} | null;
/** Derive quick-edit form fields from a profile document body + frontmatter. */
export declare function deriveBrandVoiceFields(body: string, frontmatter: string): BrandVoiceDocumentFields;
export declare function parseBrandVoiceDocument(markdown: string): ParseBrandVoiceDocumentResult | ParseBrandVoiceDocumentError;
/** Serialize form fields (and optional metadata) into the portable markdown file. */
export declare function serializeBrandVoiceDocument(input: {
    fields: BrandVoiceDocumentFields;
    meta?: Partial<BrandVoiceDocumentMeta>;
    existingDocument?: string;
    structured?: BrandVoiceStructuredProfile;
}): string;
/** Merge parsed document fields into a profile, preserving enabled flag. */
export declare function applyParsedDocumentToProfile(profile: Partial<BrandVoiceProfile>, parsed: ParsedBrandVoiceDocument): Partial<BrandVoiceProfile>;
/** Build a profile document from quick-edit fields when none is stored yet. */
export declare function ensureBrandVoiceDocument(profile: Partial<BrandVoiceProfile>): string;
/** Sync flat fields from the stored document (when present). */
export declare function syncFieldsFromDocument(profile: Partial<BrandVoiceProfile>): Partial<BrandVoiceProfile>;
export declare const BRAND_VOICE_EXPORT_FILENAME = "brand-voice-profile.md";
//# sourceMappingURL=brand-voice-document.d.ts.map