apify / got-scraping

HTTP client made for scraping based on got.
422 stars 32 forks source link

Type definitions for "gotScraping()" are wrong/missing methods: #90

Closed rmzg closed 9 months ago

rmzg commented 1 year ago
  1 import { gotScraping } from "got-scraping";
  2
  3 async function main() {
  4   let x = gotScraping("https://www.example.com");
  5
 >>   console.log(x.then);  Property 'then' does not exist on type 'CancelableRequest<Response<string>>'.
  7 }
  8
  9 main();
rmzg commented 1 year ago

Adding the following seems to help:

  3 declare module "got-scraping" {
  4   interface CancelableRequest<T> extends Promise<T> {}
  5 }