import { UrlInspectionResult } from "../core/types.mjs"; import { CallOptions, GoogleSearchConsoleClient } from "../core/client.mjs"; interface InspectUrlResult { url: string; inspection?: UrlInspectionResult; isIndexed: boolean; } /** * Inspects a URL in Google Search Console to check its indexing status. */ declare function inspectUrl(client: GoogleSearchConsoleClient, siteUrl: string, inspectionUrl: string): Promise<{ inspection: UrlInspectionResult | undefined; isIndexed: boolean; }>; /** * Batch inspect multiple URLs with rate limiting. * Returns inspection results for each URL. */ declare function batchInspectUrls(client: GoogleSearchConsoleClient, siteUrl: string, urls: string[], options?: { delayMs?: number; concurrency?: number; onProgress?: (result: InspectUrlResult, index: number, total: number) => void; }): Promise; interface ParsedIndexingResult { url: string; verdict: string | null; coverageState: string | null; indexingState: string | null; robotsTxtState: string | null; pageFetchState: string | null; lastCrawlTime: string | null; crawlingUserAgent: string | null; userCanonical: string | null; googleCanonical: string | null; sitemaps: string | null; referringUrls: string | null; mobileVerdict: string | null; mobileIssues: string | null; richResultsVerdict: string | null; richResultsItems: string | null; ampVerdict: string | null; ampUrl: string | null; ampIndexingState: string | null; ampIndexStatusVerdict: string | null; ampRobotsTxtState: string | null; ampPageFetchState: string | null; ampLastCrawlTime: string | null; ampIssues: string | null; inspectionResultLink: string | null; } declare function inspectUrlFlat(client: GoogleSearchConsoleClient, siteUrl: string, inspectionUrl: string, options?: CallOptions): Promise; /** Maximum parallel URL Inspection requests started by the settled flat batch helper. */ declare const MAX_FLAT_INSPECTION_BATCH_CONCURRENCY = 10; type InspectUrlFlatSettledResult = { url: string; status: 'fulfilled'; value: ParsedIndexingResult; } | { url: string; status: 'rejected'; reason: unknown; }; interface BatchInspectUrlsFlatSettledOptions extends CallOptions { /** Delay after each request handled by a worker. Defaults to 200ms. */ delayMs?: number; /** Number of workers. Defaults to 1 and is capped at {@link MAX_FLAT_INSPECTION_BATCH_CONCURRENCY}. */ concurrency?: number; onProgress?: (result: InspectUrlFlatSettledResult, index: number, total: number) => void; } /** * Inspect URLs into the flat storage shape without failing the whole batch * when one URL fails. Results retain input order and include each URL so * callers can persist successes and classify individual failures safely. */ declare function batchInspectUrlsFlatSettled(client: GoogleSearchConsoleClient, siteUrl: string, urls: readonly string[], options?: BatchInspectUrlsFlatSettledOptions): Promise; type LegacyInspectionPriority = 'high' | 'medium' | 'low'; type ValueWeightedInspectionPriority = 'critical' | 'high' | 'elevated' | 'normal' | 'dormant'; type InspectionPriority = LegacyInspectionPriority | ValueWeightedInspectionPriority; /** * Derive the recheck tier. * * Omitting `impressions28d` preserves the verdict-only policy. Consumers own * signal freshness and the 90-day stable-zero guard, and should omit the value * until those conditions make a dormant classification safe. */ declare function getNextCheckPriority(result: Pick): LegacyInspectionPriority; declare function getNextCheckPriority(result: Pick, impressions28d: undefined): LegacyInspectionPriority; declare function getNextCheckPriority(result: Pick, impressions28d: number): ValueWeightedInspectionPriority; declare function getNextCheckPriority(result: Pick, impressions28d: number | undefined): InspectionPriority; /** Next-check unix seconds for a given priority. */ declare function getNextCheckAfter(priority: InspectionPriority): number; declare function canUseUrlInspection(permissionLevel: string | null | undefined): boolean; type IndexingIneligibleReason = 'missing_indexing_scope' | 'insufficient_gsc_permission'; interface IndexingEligibility { indexingEligible: boolean; indexingIneligibleReason?: IndexingIneligibleReason; indexingPermissionLevel?: string | null; grantedScopes?: string[]; } declare function getIndexingEligibility(grantedScopes: string | null | undefined, permissionLevel: string | null | undefined): IndexingEligibility; export { BatchInspectUrlsFlatSettledOptions, IndexingEligibility, IndexingIneligibleReason, InspectUrlFlatSettledResult, InspectUrlResult, InspectionPriority, LegacyInspectionPriority, MAX_FLAT_INSPECTION_BATCH_CONCURRENCY, ParsedIndexingResult, ValueWeightedInspectionPriority, batchInspectUrls, batchInspectUrlsFlatSettled, canUseUrlInspection, getIndexingEligibility, getNextCheckAfter, getNextCheckPriority, inspectUrl, inspectUrlFlat };