/**
 * Tier-1 deterministic SEO issue fixes — no AI, instant, approval-gated apply.
 *
 * Maps audit issue `type` values to validated document SEO field patches. Used
 * by the Audit tab inline "Approve fix" flow (Phase 1).
 */
import type { SiteSEOConfig } from '../config/types.js';
import type { AuditEntityInput } from './audit-engine.js';
export declare const META_TITLE_MAX = 60;
export declare const META_TITLE_MIN = 30;
export declare const META_DESC_MAX = 160;
export declare const META_DESC_MIN = 120;
/** Issue types that support a deterministic one-click fix in Phase 1. */
export declare const DETERMINISTIC_FIX_TYPES: Set<string>;
export interface SeoFixFieldChange {
    /** API / UI field key (matches SeoFieldPayload). */
    field: string;
    label: string;
    before: string | boolean | null;
    after: string | boolean | null;
}
export interface SeoIssueFixSuggestion {
    autoFixable: boolean;
    /** How the suggestion was produced. */
    source?: 'deterministic' | 'ai';
    /** True when AI fix was requested but the provider is not configured. */
    aiUnavailable?: boolean;
    /** Stable token for stale-fix detection — `${entityId}:${updatedAtMs}:${issueType}`. */
    fingerprint: string;
    /** Patch keys use document data layer names (`canonical`, not `canonicalUrl`). */
    patch: Record<string, unknown>;
    changes: SeoFixFieldChange[];
    justification: string;
}
export interface SeoIssueFixInput {
    type: string;
    title: string;
    recommendation?: string | null;
    entityType: string | null;
    entityId: string | null;
}
export interface SeoIssueFixContext {
    entity: AuditEntityInput;
    siteSeo?: SiteSEOConfig | null;
    /** Document `updatedAt` ISO string or ms — used for fingerprinting. */
    updatedAt: string | Date;
}
/** Truncate at a word boundary when possible so snippets read naturally. */
export declare function truncateAtWordBoundary(text: string, maxLen: number): string;
/** Build a meta description excerpt from page body (plain text). */
export declare function excerptForMetaDescription(content: string, maxLen?: number): string;
export declare function buildFixFingerprint(entityId: string, issueType: string, updatedAt: string | Date): string;
/**
 * Compute a deterministic fix suggestion for an audit issue. Returns
 * `autoFixable: false` when the issue type is unsupported or required context
 * is missing (e.g. no site URL for canonical).
 */
export declare function suggestDeterministicFix(issue: SeoIssueFixInput, ctx: SeoIssueFixContext): SeoIssueFixSuggestion;
export interface SuggestIssueFixResult {
    suggestion: SeoIssueFixSuggestion;
    /** When true, caller should persist metadata.pendingFix before apply. */
    cacheForApply: boolean;
}
/**
 * Resolve a fix suggestion: deterministic first, then AI when needed.
 */
export declare function suggestIssueFix(issue: SeoIssueFixInput, ctx: SeoIssueFixContext, aiDeps?: import('./issue-fix-ai.js').AiFixDeps): Promise<SuggestIssueFixResult>;
//# sourceMappingURL=issue-fix.d.ts.map