export interface Options { out?: string; origin?: string; notFoundPath?: string; } /** The outcome of crawling a single path. */ export interface VisitResult { /** The path that was crawled. */ path: string; /** The status the path answered with. */ status: number; /** * Whether the path was crawled without error. `false` means a page was * expected here and failed to render, so nothing was written for it. A * successful visit may still write no file — a redirect the crawler cannot * resolve, or a success status with no page to prerender. */ ok: boolean; /** Absolute path of the file written, when the visit produced one. */ file?: string; } /** The visits of a crawl, bucketed by outcome. */ export interface CrawlResults { /** Paths crawled without error, including those with nothing to prerender. */ success: VisitResult[]; /** Paths that answered with a redirect. */ redirect: VisitResult[]; /** Paths that answered `404`, other than the crawled 404 page itself. */ notFound: VisitResult[]; /** Paths a page was expected at that failed to render. */ failure: VisitResult[]; /** * Paths listed under the logged summary — every path in `notFound`, plus * every path whose status `visit` has no handling for. Overlaps the other * buckets. */ records: VisitResult[]; } export interface Crawler { crawl(paths: string[]): Promise; } export default function createCrawler(makeRequest: (request: Request) => Promise, opts?: Options): Crawler;