export type SeoGrade = 'good' | 'fair' | 'poor' | 'critical';
export type SeoSeverity = 'critical' | 'warning' | 'info';
export type SeoIssueStatus = 'open' | 'ignored' | 'resolved' | 'recurring';
export type SeoIssueCategory = 'content' | 'technical' | 'redirects' | 'media' | 'performance' | 'schema' | 'social' | 'indexing';
export type RedirectStatusCode = 301 | 302 | 307 | 308 | 410;
export interface SeoSiteScore {
    score: number;
    grade: SeoGrade;
    /** Change vs the previous audit run, e.g. +6. */
    delta: number | null;
    breakdown: {
        category: string;
        score: number;
        weight: number;
        contribution: number;
    }[];
}
export interface SeoMetric {
    label: string;
    value: string;
    helper: string;
    /** Optional trend direction for the helper colour. */
    trend?: 'up' | 'down' | 'flat';
}
export interface SeoIssue {
    id: string;
    auditRunId: string | null;
    entityType: string | null;
    entityId: string | null;
    entityTitle: string | null;
    url: string | null;
    severity: SeoSeverity;
    category: SeoIssueCategory;
    type: string;
    title: string;
    description: string | null;
    impact: string | null;
    recommendation: string | null;
    status: SeoIssueStatus;
    fixable: boolean;
    fixActionType: string | null;
    relatedEntityIds: string[];
    source: string;
    firstDetectedAt: string | null;
    lastDetectedAt: string | null;
    resolvedAt: string | null;
}
export interface QuickWin {
    id: string;
    title: string;
    explanation: string;
    impact: 'High' | 'Medium' | 'Low';
    issueId: string | null;
    fixActionType: string | null;
}
export interface SearchPerformanceRow {
    url: string;
    title: string;
    impressions: number;
    clicks: number;
    ctr: number;
    averagePosition: number;
}
export interface SeoOverview {
    siteScore: SeoSiteScore;
    metrics: SeoMetric[];
    issues: SeoIssue[];
    issuesSummary: {
        total: number;
        critical: number;
        warning: number;
        info: number;
    };
    quickWins: QuickWin[];
    searchPerformance: SearchPerformanceRow[];
    searchConsoleConnected: boolean;
    lastAuditRunId: string | null;
}
export declare function fetchSeoOverview(): Promise<SeoOverview>;
export declare function fetchSearchPerformance(params?: {
    limit?: number;
}): Promise<SearchPerformanceRow[]>;
export interface SeoContentRecord {
    id: string;
    entityType: 'page' | 'post';
    entityId: string;
    title: string;
    url: string;
    canonicalUrl: string | null;
    metaTitle: string | null;
    metaDescription: string | null;
    focusKeyword: string | null;
    ogTitle: string | null;
    ogDescription: string | null;
    ogImageId: string | null;
    ogImage: string | null;
    twitterTitle: string | null;
    twitterDescription: string | null;
    twitterImageId: string | null;
    noindex: boolean;
    nofollow: boolean;
    structuredDataType: string | null;
    structuredData: Record<string, unknown> | null;
    seoScore: number;
    seoGrade: SeoGrade;
    updatedAt: string | null;
}
export type ContentSeoFilter = 'all' | 'pages' | 'posts';
export declare function fetchSeoContentRecords(): Promise<SeoContentRecord[]>;
export declare function fetchSeoContentRecord(entityType: string, entityId: string): Promise<SeoContentRecord | null>;
export interface SeoFieldPayload {
    metaTitle?: string;
    metaDescription?: string;
    canonicalUrl?: string;
    focusKeyword?: string;
    ogTitle?: string;
    ogDescription?: string;
    ogImage?: string;
    twitterTitle?: string;
    twitterDescription?: string;
    twitterImage?: string;
    noindex?: boolean;
    nofollow?: boolean;
    structuredDataType?: string;
    structuredData?: Record<string, unknown>;
}
export declare function updateSeoFields(entityType: string, entityId: string, payload: SeoFieldPayload): Promise<{
    error?: string;
}>;
/** Pure search/filter over the content records (decoupled from network for tests). */
export declare function applyContentSeoQuery(records: SeoContentRecord[], query: {
    search?: string;
    filter?: ContentSeoFilter;
}): SeoContentRecord[];
export type SeoAuditScope = 'full' | 'content' | 'technical' | 'redirect';
export interface SeoAuditRun {
    id: string;
    status: 'RUNNING' | 'COMPLETED' | 'FAILED';
    scope: string;
    startedAt: string;
    finishedAt: string | null;
    siteScoreBefore: number | null;
    siteScoreAfter: number | null;
    pagesScanned: number;
    issuesFound: number;
    criticalCount: number;
    warningCount: number;
    infoCount: number;
    errorMessage: string | null;
}
export declare function runSeoAudit(scope?: SeoAuditScope): Promise<{
    run?: SeoAuditRun;
    error?: string;
}>;
export declare function fetchSeoAuditRuns(): Promise<SeoAuditRun[]>;
export declare function fetchSeoAuditRun(auditRunId: string): Promise<SeoAuditRun | null>;
export interface SeoIssueQuery {
    severity?: SeoSeverity | 'all';
    category?: SeoIssueCategory | 'all';
    status?: SeoIssueStatus | 'all';
    auditRunId?: string;
}
export declare function fetchSeoIssues(query?: SeoIssueQuery): Promise<SeoIssue[]>;
export declare function fetchSeoIssue(issueId: string): Promise<SeoIssue | null>;
export declare function resolveSeoIssue(issueId: string): Promise<{
    error?: string;
}>;
export declare function ignoreSeoIssue(issueId: string): Promise<{
    error?: string;
}>;
export declare function reopenSeoIssue(issueId: string): Promise<{
    error?: string;
}>;
export interface SitemapStatus {
    sitemapUrl: string;
    lastGeneratedAt: string | null;
    pagesIncluded: number;
    pagesExcluded: number;
    autoRegenerateOnPublish: boolean;
    errors: string[];
    warnings: string[];
}
export interface CrawlSettings {
    indexEntireSite: boolean;
    includeImagesInSitemap: boolean;
    includePostsInSitemap: boolean;
    noindexPaginatedArchives: boolean;
    noindexTagPages: boolean;
}
export declare function fetchSitemapStatus(): Promise<SitemapStatus | null>;
export declare function regenerateSitemap(): Promise<{
    status?: SitemapStatus;
    error?: string;
}>;
export declare function fetchCrawlSettings(): Promise<CrawlSettings | null>;
export declare function updateCrawlSettings(payload: Partial<CrawlSettings>): Promise<{
    error?: string;
}>;
export interface RobotsConfig {
    body: string;
    generated: boolean;
}
export interface RobotsValidation {
    valid: boolean;
    blocksEntireSite: boolean;
    errors: string[];
    warnings: string[];
}
export declare function fetchRobotsTxt(): Promise<RobotsConfig | null>;
export declare function updateRobotsTxt(body: string): Promise<{
    error?: string;
}>;
/** Client-side robots.txt validation (mirrors server-side checks). */
export declare function validateRobotsTxt(body: string): RobotsValidation;
export interface RedirectRule {
    id: string;
    type: RedirectStatusCode;
    fromPath: string;
    toPath: string;
    enabled: boolean;
    priority: number;
    preserveQuery: boolean;
    hits: number;
    lastHitAt: string | null;
    stale: boolean;
    source: string;
    notes: string | null;
    createdAt: string;
    updatedAt: string;
}
export interface RedirectOverview {
    activeRedirects: number;
    staleRedirects: number;
    notFoundCount: number;
    notFoundHits: number;
    chainsAndLoops: number;
    trafficRecovered: number;
}
export interface Redirect404 {
    id: string;
    path: string;
    hits: number;
    lastSeenAt: string;
}
export interface RedirectSuggestion {
    id: string;
    fromPath: string;
    toPath: string;
    confidence: number;
    reason: string | null;
    status: 'open' | 'accepted' | 'dismissed';
    hits: number;
    trend: string | null;
}
export interface RedirectChain {
    id: string;
    kind: 'chain' | 'loop';
    hops: string[];
    suggestedFrom: string;
    suggestedTo: string;
}
export declare function fetchRedirectOverview(): Promise<RedirectOverview>;
export declare function fetchRedirectRules(): Promise<RedirectRule[]>;
export interface RedirectRulePayload {
    type: RedirectStatusCode;
    fromPath: string;
    toPath: string;
    enabled?: boolean;
    preserveQuery?: boolean;
    notes?: string;
}
export declare function createRedirectRule(payload: RedirectRulePayload): Promise<{
    error?: string;
}>;
export declare function updateRedirectRule(redirectId: string, payload: Partial<RedirectRulePayload>): Promise<{
    error?: string;
}>;
export declare function deleteRedirectRule(redirectId: string): Promise<{
    error?: string;
}>;
export declare function fetchRedirectChains(): Promise<RedirectChain[]>;
export declare function flattenRedirectChain(chainId: string): Promise<{
    error?: string;
}>;
export declare function fetchRedirectSuggestions(): Promise<RedirectSuggestion[]>;
export declare function generate404RecoverySuggestions(): Promise<{
    error?: string;
}>;
export declare function acceptRedirectSuggestion(suggestionId: string): Promise<{
    error?: string;
}>;
export declare function dismissRedirectSuggestion(suggestionId: string): Promise<{
    error?: string;
}>;
export declare function exportRedirectsCsv(): Promise<{
    csv?: string;
    error?: string;
}>;
export declare function importRedirectsCsv(csv: string): Promise<{
    imported?: number;
    errors?: string[];
    error?: string;
}>;
export interface SeoAiResult {
    text?: string;
    alternatives?: string[];
    structuredData?: Record<string, unknown>;
    /** True when the AI provider is not configured (graceful fallback). */
    unavailable?: boolean;
}
export declare function generateSeoField(field: 'metaTitle' | 'metaDescription' | 'ogTitle' | 'ogDescription' | 'focusKeyword', context: {
    entityType: string;
    entityId: string;
}): Promise<SeoAiResult>;
export declare function explainSeoIssue(issueId: string): Promise<SeoAiResult>;
export declare function generateStructuredData(context: {
    entityType: string;
    entityId: string;
    schemaType: string;
}): Promise<SeoAiResult>;
export declare function summarizeSeoAudit(): Promise<SeoAiResult>;
//# sourceMappingURL=seo-service.d.ts.map