Commit Graph

84 Commits

Author SHA1 Message Date
Akihiko Odaki
8691cd12f7 Add missing maxFreeSockets property of Agent class in node (#27014) 2018-07-05 12:51:29 -07:00
Mine Starks
ee7ef14286
Merge pull request #26407 from r3nya/node-dns-lookup
[node] Add dns.lookupService method
2018-06-13 08:59:26 -07:00
Andrew Makarov
be6409bb59 Update tests 2018-06-10 23:08:28 +03:00
Andrew Makarov
9b615f3a76 Add dns.lookupService method 2018-06-09 23:09:07 +03:00
Sander Koenders
8b140f037c
Docs(name): Add my name to contributors list 2018-06-08 13:54:51 +02:00
Sander Koenders
bc22dd04a0
Test(Node 4): Alter test for ProcessEnv 2018-06-08 13:47:46 +02:00
Sander Koenders
03507a3fe6
Feat(Node 4): Add ProcessEnv interface 2018-06-08 13:00:08 +02:00
Ionut Botizan
1b2f3e2ba1 [node] Add debugPort to the Process interface
https://nodejs.org/api/process.html#process_process_debugport
2018-05-17 09:24:41 +03:00
Jérémie Astori
dd0d4ad0c4 Type spawn's args as a ReadonlyArray of string (#25487)
At the moment, this snippet:

```ts
const spawnArgs: ReadonlyArray<string> = ['foo', 'bar'];
spawn('foobar', spawnArgs);
```

fails with:

```
Argument of type 'ReadonlyArray<string>' is not assignable to parameter of type 'string[] | undefined'.
  Type 'ReadonlyArray<string>' is not assignable to type 'string[]'.
```

Looking at https://github.com/nodejs/node/blob/master/lib/child_process.js#L514-L535 and https://github.com/nodejs/node/blob/master/lib/internal/child_process.js#L286, it _looks_ like there is no mutation of the array. I am no expert so I'd be happy to be proven wrong, I just couldn't find sufficient evidence that a `ReadonlyArray` wouldn't be fine.
This is not a breaking change because passing a `string[]` is still valid.
2018-05-03 08:57:27 -07:00
Brian Crowell
edd9c31ed8 [node] Allow object-mode write and writev in WritableOptions (#25263)
Writable's write function accepts chunks of type any to permit object-mode
usage. The implementations you can provide to Writable's constructor should
do the same.
2018-04-30 09:14:16 -07:00
Alexander T
dcf3384ac2 Microsoft/TypeScript#23155 - Type error in Buffer.from() (#24966) 2018-04-13 08:50:15 -07:00
Blair Zajac
4bcf0f6866 node: assert.fail() has never return type. 2018-03-30 23:47:08 -07:00
Frank Schulz
a36a10b2bf Add tests 2018-03-21 12:53:58 +01:00
Frank Schulz
2b5cfcfb05 Fix https type 2018-03-21 12:37:33 +01:00
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Daniel Rosenwasser
86e2bc1cf0
Merge pull request #23486 from mentos1386/mentos1386-node-tty-class-fix
[NodeJS] TTY ReadStream Interface to Class fix
2018-02-13 10:31:42 -08:00
Ron Buckton
314132546a
Merge pull request #23374 from johan13/socket-return-types
[node] Fix return type of net.Socket methods
2018-02-08 20:10:45 -08:00
Tine Jozelj
20f76516d5 Merge branch 'master' into mentos1386-node-tty-class-fix 2018-02-07 17:31:26 +01:00
Andy
b890bf4556
Fix node tests to be compatible with --esModuleInterop (#23437) 2018-02-05 13:08:34 -08:00
Andy
bef4d2b27d
Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Johan Levin
28ac79260d Change return type of net.Socket methods 2018-02-04 21:54:49 +01:00
Evan Shortiss
98f1d85679 Fixed - nodejs core typing for path.resolve args (#22567)
* Fixed - nodejs core typing for path.resolve args

* fix in all versions
2018-01-03 17:03:06 -08:00
Olaf Tomalka
abb6cbad16 Fix Node's path.format() requiring all options (#22525)
* Fix Node's path.format() requiring all options

The bug manifested during use of path.win32 and path.posix submodules.
Both functions required all of the options to exist which is not
the case as some override others.
Further research indicated that previous Node versions were also
susceptible, up to v4.

I've used the Typescript's Partial<> type which makes all properties
optional, allowing for easier maintenance and readabillity at the cost
of now requiring Typescript 2.1, which I believe is a good trade-off.

* Revert the decision to use TS 2.1 in @types/node

Updating Typescript version would require to update
all other types that rely on Node, which may be quite a lot.
Fixing a bug is not a big enough reason to add new version to all
of those packages.
2018-01-03 14:44:18 -08:00
Arthur Ozga
b6b7d5308d
Merge pull request #22077 from Zarel/writable-end
[node] Support passing callback-only in writable.end()
2017-12-19 11:23:30 -08:00
Guangcong Luo
62f093e09c Support passing function only in Node writable.end() 2017-12-14 19:22:16 -06:00
Mine Starks
dc7448628c
Merge pull request #20725 from thewizarodofoz/master
fix Worker.id type
2017-12-13 14:46:37 -08:00
Mine Starks
736ebf768c
Merge pull request #22010 from GrabCAD/master
Add types for Error.prepareStackTrace()
2017-12-11 09:14:14 -08:00
Howard Mak
95b94efe8d Clean up comments for NodeJS.CallSite methods. Make "this" references clearer. 2017-12-07 13:46:40 -05:00
Howard Mak
4d1ff2f02e PR feedback: Tighten signatures for CallSite methods 2017-12-07 13:20:39 -05:00
Howard Mak
4950326dd4 PR feedback: Add test for tighter CallSite signatures 2017-12-07 12:56:37 -05:00
Howard Mak
a30bc16f3c Tighten signature for CallSite.getTypeName() 2017-12-05 14:54:29 -05:00
Howard Mak
75dabcb90f Fix some CallSite properties to be functions not boolean values 2017-12-05 14:43:26 -05:00
Howard Mak
658b8af522 Rename NodeJS.StackFrame -> CallSite to match documentation 2017-12-05 14:33:37 -05:00
Ari Aviran
2b4eb32abf
Reverting tslint changes 2017-12-05 08:40:44 +02:00
Howard Mak
e0ba98cf88 Add signature for Error.prepareStackTrace() as per https://github.com/v8/v8/wiki/Stack%20Trace%20API 2017-12-05 00:24:40 -05:00
Ari Aviran
dccfda5de4
[node] Add Buffer.alloc methods to node v4
Add `Buffer.alloc`, `Buffer.allocUnsafe` and `Buffer.allocUnsafeSlow`
class methods that were backported to node v4 (starting with v4.5).

In addition add tests to all node versions for these class methods and
fix tslint configuration to pass the tests
2017-12-04 12:02:43 +02:00
Sebastian Silbermann
df70a8d72c node: add documented highWaterMark option 2017-11-15 17:59:59 +01:00
Kevin Greene
d17893c89b Add specific properties to iIncomingHttpHeaders 2017-10-27 12:30:59 -07:00
Kevin Greene
293dc4c62a
Merge branch 'master' into node-client 2017-10-27 10:28:29 -07:00
Kevin Greene
d1fe542d52 Account for 'set-cookie' header in Node v8 types 2017-10-27 10:05:05 -07:00
Kevin Greene
df9c373de2 Make HttpHeader types more specific 2017-10-26 22:30:34 -07:00
Kevin Greene
06a8ff4a13 Add tests for RequestOptions and ClientRequestArgs 2017-10-24 11:14:44 -07:00
Kevin Greene
3a86a2b2c5 [node] Fix linting errors 2017-10-24 09:02:06 -07:00
Andy
165e2bf7b0 Fix no-redundant-jsdoc ignores -- include no-redundant-jsdoc-2 (#20954) 2017-10-24 08:53:43 -07:00
Kevin Greene
63e6236af8 Fix to just make ClientRequestArgs an alias of RequestOptions 2017-10-23 15:32:52 -07:00
Andy
a2c81182cf node: Fix lint (#20835) 2017-10-23 07:34:15 -07:00
Oz Weiss
2a51338ed9 worker.id is number, not string 2017-10-19 21:30:56 +03:00
Kevin Greene
bf50c9a7a7 [node] Update older node types (7,6,4) for more consistency with 8
* Specifically add interfaces for reqeust headers
  * Make the naming of client request options consistent (ClientRequestArgs)
2017-10-18 12:49:44 -07:00
Jeff Kenney
43a2660602 Fix node url and http/https request types (#18766)
* [node] url.format can take a string

* [node] http.request / https.request can take a string

* [node] reorder Url properties to match ordering in docs

* [node] DRY out the Url and UrlObject types

* [node] backport split Url / UrlObject types to v0 and v4

* remove 'any' union for UrlObject.query type
2017-10-17 12:00:46 -07:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00