Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Typescript typings for http2.createSecureServer: missing streamResetBurst and streamResetRate in options #57220

Closed
gunters63 opened this issue Feb 26, 2025 · 2 comments
Labels
wrong repo Issues that should be opened in another repository.

Comments

@gunters63
Copy link

Version

v23.8.0

Platform

Linux taubenus 6.12.16-1-cachyos-lts #1 SMP PREEMPT_DYNAMIC Sat, 22 Feb 2025 00:45:10 +0000 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

See also: #57169

With this merge request the docs were fixed, but the typings are still wrong.

To reproduce the problem:

import fs from 'node:fs';
import http2 from 'node:http2';

const key = fs.readFileSync('server.key');
const cert = fs.readFileSync('server.crt');

const server = http2.createSecureServer({
  key,
  cert,
  // Uncomment the following line to see the issue
  // @ts-expect-error missing types
  streamResetBurst: Number.MAX_SAFE_INTEGER,
  streamResetRate: Number.MAX_SAFE_INTEGER,
});

If you leave out the // @ts-expect-error comment Typescript will flag an error

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

The typings should be correct and the typescript error suppression comment not needed

What do you see instead?

Typescript flags an error about the documented and valid properties streamResetBurst and streamResetRate

Additional information

No response

@gunters63 gunters63 changed the title Wrong typings for http2.createSecureServer: missing streamResetBurst and streamResetRate in options Wrong Typescript typings for http2.createSecureServer: missing streamResetBurst and streamResetRate in options Feb 26, 2025
@jakecastelli
Copy link
Member

The PR fix towards #57169 was only a doc fix, if you want to fix the typing issue, you might need to fix here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/http2.d.ts instead

@gunters63
Copy link
Author

Ok, so I should close this issue and open one at DefinitelyTyped?

@aduh95 aduh95 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2025
@aduh95 aduh95 added the wrong repo Issues that should be opened in another repository. label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

3 participants