interface SitemapUrlEntry { loc: string; lastmod?: string; changefreq?: string; priority?: number; } interface SitemapIndexEntry { loc: string; lastmod?: string; } interface SitemapDocumentMeta { bytesRead: number; complete: boolean; hasBom: boolean; hasXmlDeclaration: boolean; namespace: string | null; } type SitemapDocumentResult = { _tag: 'urlset'; entries: SitemapUrlEntry[]; meta: SitemapDocumentMeta; } | { _tag: 'index'; entries: SitemapIndexEntry[]; meta: SitemapDocumentMeta; } | { _tag: 'empty_body'; } | { _tag: 'html'; metaRefreshUrl?: string; } | { _tag: 'byte_limit'; bytesRead: number; maxBytes: number; } | { _tag: 'parse_error'; error: string; } | { _tag: 'unsupported_document'; root: string | null; }; interface ParseSitemapDocumentOptions { maxBytes?: number; maxEntries?: number; acceptUrl?: (entry: SitemapUrlEntry) => boolean; } type SitemapBody = string | Uint8Array | ReadableStream | AsyncIterable; interface SitemapFetchOptions extends ParseSitemapDocumentOptions { fetcher?: typeof fetch; headers?: HeadersInit; signal?: AbortSignal; timeoutMs?: number; } type SitemapFetchResult = { _tag: 'ok'; url: string; document: Extract; } | { _tag: 'not_found'; url: string; status: 404 | 410; } | { _tag: 'http_error'; url: string; status: number; statusText: string; } | { _tag: 'network_error'; url: string; error: string; } | { _tag: 'document_error'; url: string; error: Exclude; }; interface DiscoverSitemapOptions extends SitemapFetchOptions { userAgent?: string; } interface SitemapDiscoveryFailure { url: string; kind: 'http' | 'network' | 'document'; detail: string; } type SitemapDiscoveryResult = { _tag: 'found'; url: string; source: 'common_path' | 'robots'; } | { _tag: 'not_found'; } | { _tag: 'incomplete'; failures: SitemapDiscoveryFailure[]; }; interface WalkSitemapsOptions extends SitemapFetchOptions { maxDepth?: number; maxDocuments?: number; maxUrls?: number; } interface FetchSitemapUrlsOptions extends DiscoverSitemapOptions { maxDepth?: number; limit?: number; } interface SitemapWalkFailure { url: string; depth: number; error: Exclude; } type SitemapWalkResult = { _tag: 'ok'; entries: SitemapUrlEntry[]; documentsRead: number; complete: boolean; failures: SitemapWalkFailure[]; } | { _tag: 'not_found'; } | { _tag: 'error'; failures: SitemapWalkFailure[]; }; type SitemapIdentityResult = { _tag: 'ok'; url: string; } | { _tag: 'invalid'; reason: 'empty' | 'invalid_url' | 'off_origin'; }; interface SitemapEvidenceRecord { path: string; lastDownloaded?: string | null; fetchedAt?: number | null; } interface ScopedSitemapRecords { sitemaps: Array; excludedCount: number; duplicateCount: number; } /** * Streaming sitemap parser backed by the same utility Nuxt Sitemap consumers * previously used. Expected failures are tagged values. * Entry limits produce a useful partial document with `meta.complete = false`; * byte limits fail closed because the document boundary was not observed. */ declare function parseSitemapDocument(body: SitemapBody, options?: ParseSitemapDocumentOptions): Promise; declare function fetchSitemapDocument(url: string, options?: SitemapFetchOptions): Promise; declare function parseRobotsSitemapUrls(robots: string, baseUrl?: string): string[]; declare function canonicalSitemapIdentity(path: string, site?: string): SitemapIdentityResult; declare function sameSitemapIdentity(left: string, right: string, site?: string): boolean; declare function scopeSitemapRecords(records: readonly T[], site?: string): ScopedSitemapRecords; /** * Discover a real sitemap document. A 200 HTML shell is rejected, and * transport failures remain distinguishable from an authoritative miss. */ declare function discoverSitemapResult(site: string, options?: DiscoverSitemapOptions): Promise; /** * Compatibility surface retained at the package root. New callers that need * explicit incomplete-discovery evidence should use `discoverSitemapResult`. */ declare function discoverSitemap(site: string, options?: DiscoverSitemapOptions): Promise; /** * Bounded sitemap and sitemap-index walk. Partial results are explicit through * `complete` and `failures`; callers must not infer removals from an incomplete * walk. */ declare function walkSitemaps(roots: string | readonly string[], options?: WalkSitemapsOptions): Promise; /** * Compatibility surface retained at the package root. The shared parser and * traversal own the work while the original string-array contract remains. */ declare function fetchSitemapUrls(sitemapUrl: string, options?: FetchSitemapUrlsOptions): Promise; declare function sitemapContentHash(entries: readonly Pick[]): Promise; export { DiscoverSitemapOptions, FetchSitemapUrlsOptions, ParseSitemapDocumentOptions, ScopedSitemapRecords, SitemapBody, SitemapDiscoveryFailure, SitemapDiscoveryResult, SitemapDocumentMeta, SitemapDocumentResult, SitemapEvidenceRecord, SitemapFetchOptions, SitemapFetchResult, SitemapIdentityResult, SitemapIndexEntry, SitemapUrlEntry, SitemapWalkFailure, SitemapWalkResult, WalkSitemapsOptions, canonicalSitemapIdentity, discoverSitemap, discoverSitemapResult, fetchSitemapDocument, fetchSitemapUrls, parseRobotsSitemapUrls, parseSitemapDocument, sameSitemapIdentity, scopeSitemapRecords, sitemapContentHash, walkSitemaps };