SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
335 stars 105 forks source link

Typescript issue not perfectly fixed #38

Closed euberdeveloper closed 1 year ago

euberdeveloper commented 2 years ago

Hi, I've just tried. It fixes all of those errors but one:

node_modules/puppeteer-stream/dist/PuppeteerStream.d.ts:8:5 - error TS2416: Property 'destroy' in type 'Stream' is not assignable to the same property in base type 'Readable'.
  Type '() => Promise<void>' is not assignable to type '(error?: Error | undefined) => this'.
    Type 'Promise<void>' is not assignable to type 'this'.
      'this' could be instantiated with an arbitrary type which could be unrelated to 'Promise<void>'.

8     destroy(): Promise<void>;
      ~~~~~~~

Found 1 error.

I can't reopen the issue so I create a new one.

Originally posted by @euberdeveloper in https://github.com/Flam3rboy/puppeteer-stream/issues/36#issuecomment-1030717161

SamuelScheit commented 2 years ago

I'll fix it, but when you build your project, typescript shouldn't type check node_module dependencies. You can configure it inside tsconfig.json.

euberdeveloper commented 2 years ago

Thanks!

But to be checked are not the .ts but the .d.ts, shouldn't the type declarations that are used be checked?

euberdeveloper commented 2 years ago

I tried it, it could be convenient, the transpilation takes half of the time👍🏻

SamuelScheit commented 1 year ago

Done in c420bc4