Updated Node.js dgram.send() signature with recent changes in Node.js API#25664
Updated Node.js dgram.send() signature with recent changes in Node.js API#256642 commits merged intoDefinitelyTyped:masterfrom
Conversation
|
@nebrius Thank you for submitting this PR! 🔔 @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @ajafff - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
| export class Socket extends events.EventEmitter { | ||
| send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; | ||
| send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; | ||
| send(msg: Buffer | String | Uint8Array | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; |
There was a problem hiding this comment.
I think it should be string instead String here.
According to docs address is optional.
| send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; | ||
| send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; | ||
| send(msg: Buffer | String | Uint8Array | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; | ||
| send(msg: Buffer | String | Uint8Array | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; |
There was a problem hiding this comment.
docs tell If msg is an array, offset and length must not be specified. therefore I think | any[] should be removed here.
Flarna
left a comment
There was a problem hiding this comment.
Please apply the change also to Node 10.
|
@nebrius One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you! |
Whoops, my local branch was just barely out of date enough to not have the v10 docs yet, will fix. Everything else makes sense too. |
|
Looks like I spoke too soon, there doesn't appear to be v10 docs yet: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node |
|
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/index.d.ts is latest which is Node 10 since ~2 weeks. |
|
Ohhhh, thanks, I didn't pick up that the root index.d.ts was the most recent version. |
83720f7 to
2168b3f
Compare
|
All comments should be addressed. Note: I also marked the |
|
@nebrius The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
|
I agree that CI failure is unrelated. I have seen this recently in #25597 where retrigger CI (by closing and reopening) "solved" this - even log showed the following (see https://api.travis-ci.org/v3/job/376465088/log.txt): @Andy-MS Any hint regarding this spurious failures? |
|
A definition owner 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! |
|
I'll look into that soon -- need to improve the error message from "something went wrong" |
… API (DefinitelyTyped#25664) * Updated “send” signature with recent changse * Fixed some other issues with send() signature and added Node 10

Please fill in this template.
npm test.)npm run lint package-name(ortscif notslint.jsonis present).tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.