puppeteer-stream icon indicating copy to clipboard operation
puppeteer-stream copied to clipboard

Typescript issue not perfectly fixed

Open euberdeveloper opened this issue 3 years ago • 3 comments

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

euberdeveloper avatar Feb 06 '22 00:02 euberdeveloper

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.

SamuelScheit avatar Feb 06 '22 18:02 SamuelScheit

Thanks!

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

euberdeveloper avatar Feb 06 '22 18:02 euberdeveloper

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

euberdeveloper avatar Feb 06 '22 18:02 euberdeveloper

Done in c420bc4

SamuelScheit avatar Mar 06 '23 01:03 SamuelScheit