/** * `sitemap.xml` + `robots.txt` builders - pure, edge-safe string generators (no I/O, no runtime deps). * Wire them to a route on any runtime: * * app.get("/sitemap.xml", () => * new Response(sitemap([{ url: "/" }, { url: "/about", priority: 0.8 }], { hostname: "https://x.com" }), { * headers: { "content-type": "application/xml; charset=utf-8" }, * })) * * app.get("/robots.txt", () => * new Response(robots({ rules: [{ userAgent: "*", disallow: ["/admin"] }], sitemap: "https://x.com/sitemap.xml" }), { * headers: { "content-type": "text/plain; charset=utf-8" }, * })) */ export type SitemapChangeFreq = "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"; export interface SitemapEntry { /** An absolute URL, or a path that `hostname` will make absolute. */ readonly url: string; /** Last-modified - a `Date` (serialized as ISO 8601) or a pre-formatted W3C-datetime string. */ readonly lastmod?: string | Date; readonly changefreq?: SitemapChangeFreq; /** Crawl priority, `0.0`-`1.0`. */ readonly priority?: number; } export interface SitemapOptions { /** Prepended to path-only `url`s (e.g. `"https://example.com"`). Sitemaps require absolute URLs. */ readonly hostname?: string; } /** Build a `` sitemap XML document from `entries`. Throws on out-of-spec input (dev-time data). */ export declare function sitemap(entries: readonly SitemapEntry[], options?: SitemapOptions): string; export interface RobotsRule { /** A single user-agent token (`"*"`, `"Googlebot"`, …) or several sharing the same directives. */ readonly userAgent: string | readonly string[]; readonly allow?: readonly string[]; readonly disallow?: readonly string[]; /** Seconds between requests (honored by some crawlers). */ readonly crawlDelay?: number; } export interface RobotsOptions { readonly rules: readonly RobotsRule[]; /** One or more absolute `Sitemap:` URLs. */ readonly sitemap?: string | readonly string[]; /** A `Host:` directive (preferred mirror). */ readonly host?: string; } /** Build a `robots.txt` body from grouped rules plus optional `Sitemap:`/`Host:` lines. */ export declare function robots(options: RobotsOptions): string; //# sourceMappingURL=seo.d.ts.map