/**
 * @fileoverview Force Commands Parser for Legal Markdown
 *
 * This module provides functionality to parse and apply forced configuration commands
 * from YAML front matter. It allows documents to specify their own processing options
 * directly in the document metadata, enabling automatic configuration based on document content.
 *
 * Features:
 * - Parse command strings from YAML front matter
 * - Support for template variable resolution in commands
 * - Integration with existing CLI options
 * - Override protection for critical options
 * - Validation and error handling
 *
 * @example
 * ```yaml
 * ---
 * title: Contract
 * client: Acme Corp
 * force_commands: >
 *   --css custom.css
 *   --output-name Contract_{{title}}_{{client}}_{{formatDate(date, "YYYYMMDD")}}.pdf
 *   --pdf --highlight
 * ---
 * ```
 */
import type { YamlValue } from '../../types/index.js';
import { LegalMarkdownOptions } from '../../types/index.js';
/**
 * Interface for parsed command line arguments
 */
export interface ParsedCommands {
    /** CSS file path */
    css?: string;
    /** Output file name/path (maps to CLI --output) */
    output?: string;
    /** PDF generation flag */
    pdf?: boolean;
    /** HTML generation flag */
    html?: boolean;
    /** DOCX generation flag */
    docx?: boolean;
    /** Field highlighting flag */
    highlight?: boolean;
    /** AST-first field tracking */
    astFieldTracking?: boolean;
    /** Winner branch highlighting */
    logicBranchHighlighting?: boolean;
    /** Export YAML metadata flag */
    exportYaml?: boolean;
    /** Export JSON metadata flag */
    exportJson?: boolean;
    /** Custom output path for exports */
    outputPath?: string;
    /** Page format for PDF */
    format?: 'A4' | 'Letter' | 'Legal';
    /** Landscape orientation flag */
    landscape?: boolean;
    /** Debug mode flag */
    debug?: boolean;
    /** Custom title */
    title?: string;
}
/**
 * Parse a force_commands string into structured options
 *
 * @param commandString - The command string from YAML front matter
 * @param metadata - Document metadata for template resolution
 * @param processingOptions - Current processing options for template context
 * @returns Parsed command options or null if parsing fails
 *
 * @example
 * ```typescript
 * const commands = parseForceCommands(
 *   "--css theme.css --pdf --output-name {{title}}_{{client}}.pdf",
 *   { title: "Contract", client: "Acme" },
 *   {}
 * );
 * // Returns: { css: "theme.css", pdf: true, output: "Contract_Acme.pdf" }
 * ```
 */
export declare function parseForceCommands(commandString: string, metadata?: Record<string, YamlValue>, processingOptions?: Partial<LegalMarkdownOptions>): ParsedCommands | null;
/**
 * Parse command string into arguments array, respecting quoted strings
 *
 * @param commandString - Raw command string
 * @returns Array of parsed arguments
 *
 * @example
 * ```typescript
 * parseCommandArguments('--css "my file.css" --pdf')
 * // Returns: ['--css', 'my file.css', '--pdf']
 * ```
 */
declare function parseCommandArguments(commandString: string): string[];
/**
 * Convert parsed arguments array into structured command options
 *
 * @param args - Array of command arguments
 * @returns Parsed command options
 */
declare function parseArgumentsToCommands(args: string[]): ParsedCommands;
/**
 * Validate commands and filter out protected options
 *
 * @param commands - Raw parsed commands
 * @returns Validated and filtered commands
 */
declare function validateAndFilterCommands(commands: ParsedCommands): ParsedCommands;
/**
 * Apply parsed force commands to existing options
 *
 * Force commands will override existing options where applicable.
 * Some options (like processing flags) are preserved from original options.
 *
 * @param existingOptions - Current processing options
 * @param forceCommands - Parsed force commands to apply
 * @returns Updated options with force commands applied
 *
 * @example
 * ```typescript
 * const updated = applyForceCommands(
 *   { debug: false, pdf: false },
 *   { debug: true, css: "custom.css" }
 * );
 * // Returns: { debug: true, pdf: false, css: "custom.css" }
 * ```
 */
export declare function applyForceCommands(existingOptions: Partial<LegalMarkdownOptions> & Record<string, any>, forceCommands: ParsedCommands): Partial<LegalMarkdownOptions> & Record<string, any>;
/**
 * Check if metadata contains force_commands and extract them
 *
 * @param metadata - Document metadata from YAML front matter
 * @returns Force commands string or null if not found
 */
export declare function extractForceCommands(metadata: Record<string, YamlValue>): string | null;
export { parseCommandArguments as _parseCommandArguments, parseArgumentsToCommands as _parseArgumentsToCommands, validateAndFilterCommands as _validateAndFilterCommands, };
//# sourceMappingURL=force-commands-parser.d.ts.map