@@ -34,10 +34,11 @@ export type JSDOMErrorHandler<
3434> = ErrorHandler < JSDOMCrawlingContext < UserData , JSONData > > ;
3535
3636export interface JSDOMCrawlerOptions <
37- ExtendedContext extends JSDOMCrawlingContext = JSDOMCrawlingContext ,
37+ ContextExtension = Dictionary < never > ,
38+ ExtendedContext extends JSDOMCrawlingContext = JSDOMCrawlingContext & ContextExtension ,
3839 UserData extends Dictionary = any , // with default to Dictionary we cant use a typed router in untyped crawler
3940 JSONData extends Dictionary = any , // with default to Dictionary we cant use a typed router in untyped crawler
40- > extends HttpCrawlerOptions < JSDOMCrawlingContext < UserData , JSONData > , ExtendedContext > {
41+ > extends HttpCrawlerOptions < JSDOMCrawlingContext < UserData , JSONData > , ContextExtension , ExtendedContext > {
4142 /**
4243 * Download and run scripts.
4344 */
@@ -177,10 +178,10 @@ const resources = new ResourceLoader({
177178 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' ,
178179} ) ;
179180
180- export class JSDOMCrawler < ExtendedContext extends JSDOMCrawlingContext = JSDOMCrawlingContext > extends HttpCrawler <
181- JSDOMCrawlingContext ,
182- ExtendedContext
183- > {
181+ export class JSDOMCrawler <
182+ ContextExtension = Dictionary < never > ,
183+ ExtendedContext extends JSDOMCrawlingContext = JSDOMCrawlingContext & ContextExtension ,
184+ > extends HttpCrawler < JSDOMCrawlingContext , ContextExtension , ExtendedContext > {
184185 protected static override optionsShape = {
185186 ...HttpCrawler . optionsShape ,
186187 runScripts : ow . optional . boolean ,
@@ -191,7 +192,7 @@ export class JSDOMCrawler<ExtendedContext extends JSDOMCrawlingContext = JSDOMCr
191192 protected hideInternalConsole : boolean ;
192193 protected virtualConsole : VirtualConsole | null = null ;
193194
194- constructor ( options : JSDOMCrawlerOptions < ExtendedContext > = { } , config ?: Configuration ) {
195+ constructor ( options : JSDOMCrawlerOptions < ContextExtension , ExtendedContext > = { } , config ?: Configuration ) {
195196 const { runScripts = false , hideInternalConsole = false , ...httpOptions } = options ;
196197
197198 super (
0 commit comments