/** * Shopify Sitemap Parser * Client-side sitemap.xml parser for discovering store routes * Handles both sitemap indexes and direct URL sets */ /** * Sitemap data structure */ export interface SitemapData { type: "index" | "urlset"; sitemaps?: SitemapEntry[]; urls?: UrlEntry[]; } /** * Sitemap entry (for indexes) */ export interface SitemapEntry { url: string; lastModified?: Date; type: "sitemap"; } /** * URL entry (for URL sets) */ export interface UrlEntry { url: string; lastModified?: Date; priority?: number; } /** * Sitemap parser for Shopify stores * Parses sitemap.xml to discover all public routes * * @example * ```ts * const parser = new SitemapParser(); * const sitemapData = await parser.parseSitemap('https://mystore.com'); * console.log('Found URLs:', sitemapData.urls); * ``` */ export declare class SitemapParser { private cache; private readonly CACHE_DURATION; constructor(); /** * Parse sitemap for a given store * Automatically handles sitemap indexes and URL sets * Results are cached for 15 minutes * * @param urlOrBaseUrl - Complete sitemap URL or store base URL (e.g., "https://store.com/sitemap.xml" or "https://store.com") * @returns Parsed sitemap data */ parseSitemap(urlOrBaseUrl: string): Promise; /** * Normalize sitemap URL - handles both complete URLs and base URLs * * @param urlOrBaseUrl - Complete sitemap URL or store base URL * @returns Normalized sitemap URL */ private normalizeSitemapUrl; /** * Parse XML text into structured data * Handles both sitemap indexes and URL sets * * @param xmlText - Raw XML content * @returns Parsed sitemap data */ private parseXML; /** * Parse sitemap index (contains links to child sitemaps) * * @param xmlDoc - Parsed XML document * @returns Index data with child sitemap references */ private parseSitemapIndex; /** * Parse URL set (direct list of URLs) * * @param xmlDoc - Parsed XML document * @returns URL set data with all URLs */ private parseUrlset; /** * Get cache statistics for debugging * * @returns Cache statistics */ getCacheStats(): { size: number; entries: string[]; }; /** * Clear the sitemap cache * Useful for forcing a refresh of sitemap data */ clearCache(): void; } //# sourceMappingURL=sitemap.d.ts.map