You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a typed router is used, the route map now also types the request inputs:
- handler context: `ctx.addRequests` and `ctx.enqueueLinks` require the
`userData` shape matching the request's `label` (and reject unknown labels);
this is driven by the router, so it works for every crawler type.
- crawler instance: `Routes` is inferred from the `requestHandler` option and
used to type `crawler.addRequests`/`crawler.run` for the HTTP-based crawlers
(Basic/Http/Cheerio/JSDOM/LinkeDOM).
Unlabeled requests keep loose `userData` (they hit the default handler). All
typing is backwards compatible via the open-map default.
Note: crawler-instance `addRequests` typing is not yet wired for the browser
crawlers (Playwright/Puppeteer/Stagehand) — their `requestHandler` is redefined
in BrowserCrawlerOptions which breaks generic inference through the hierarchy;
their handler-context methods are still fully typed via the router.
RequireContextPipeline<CrawlingContext,Context>={}asany,// cast because the constructor logic handles missing `contextPipelineBuilder` - the type is just for DX
0 commit comments