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

[node] Update http2 definitions for 9.4 #23330

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

kjin
Copy link
Contributor

@kjin kjin commented Jan 31, 2018

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Jan 31, 2018
@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 31, 2018

@kjin Thank you for submitting this PR!

🔔 @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added the Author is Owner The author of this PR is a listed owner of the package. label Jan 31, 2018
readonly destroyed: boolean;
readonly encrypted?: boolean;
goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer): void; // TODO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is missing to remove the TODO?

Also: doc mentions <Buffer> | <TypedArray> | <DataView> for opaqueData.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah -- that was exactly it... it was supposed to be a reminder to myself to change the type. Will fix.

Good catch!

Copy link
Contributor

@Flarna Flarna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that callback type in http2stream.pushStream is also not correct. Should be (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void

readonly remoteSettings: Settings;
rstStream(stream: Http2Stream, code?: number): void;
setTimeout(msecs: number, callback?: () => void): void;
shutdown(callback?: () => void): void;
shutdown(options: SessionShutdownOptions, callback?: () => void): void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As shutdown is gone also SessionShutdownOptions can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -6181,15 +6181,10 @@ declare module "http2" {

export interface Http2Stream extends stream.Duplex {
readonly aborted: boolean;
close(code: number, callback?: () => void): void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

readonly destroyed: boolean;
readonly encrypted?: boolean;
goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView /*| TypedArray*/): void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a TypedArray alias in the meantime until typescript offers a built-in solution in one of their lib files?

type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;

-- Microsoft/TypeScript#15402

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that going to cause re-definition issues when the built-in TypedArray becomes available? If so maybe it's better to either not include, or have a type with a different name. Since other places use TypedArray as well, it shouldn't be difficult to substitute all in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as it's not defined in the global scope, you should be okay.

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Feb 6, 2018
@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 6, 2018

A definition author has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@typescript-bot typescript-bot removed the Unmerged The author did not merge the PR when it was ready. label Feb 12, 2018
@DanielRosenwasser DanielRosenwasser merged commit 4219597 into DefinitelyTyped:master Feb 13, 2018
KSXGitHub pushed a commit to KSXGitHub/DefinitelyTyped that referenced this pull request May 12, 2018
[node] Update http2 definitions for 9.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author is Owner The author of this PR is a listed owner of the package. Popular package This PR affects a popular package (as counted by NPM download counts).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants