Commit Graph

83 Commits

Author SHA1 Message Date
Kevin Greene
c4d7629e1b Merge remote-tracking branch 'upstream/master' into node-client 2017-11-13 16:06:34 -08:00
Oliver Joseph Ash
a8e88654be Node: path.format input properties are optional (#21003)
* Node: `path.format` input properties are optional

If `base` does not exist, `name` and `ext` will be used to compute it.

http://devdocs.io/node/path#path_path_format_pathobject

* Node: `FormatInputPathObject`: all properties are optional

* Node: add myself as author

* Avoid usage of `Partial`
2017-11-10 07:37:12 -08:00
Andy
9413f9cb41
node types don't really require TypeScript@2.2 (#21283) 2017-11-06 11:28:30 -08:00
Teppei Sato
a68863ebbd node: improve util.promisify (#21253) 2017-11-06 07:03:48 -08: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
6d2a1ad814 [node] Fix linting errors in node v8 2017-10-27 10:09:18 -07:00
Kevin Greene
d1fe542d52 Account for 'set-cookie' header in Node v8 types 2017-10-27 10:05:05 -07:00
Jinwoo Lee
b15672e837 Node http2: Fix types of statCheck() and getTrailers() (#20729)
The `headers` parameter of statCheck() and the `trailers` parameter of
getTrailers() must be OutgoingHttpHeaders, not IncomingHttpHeaders, because they
are to be updated by statCheck()/getTrailers() before being sent to the opposite
endpoint.
2017-10-23 14:58:48 -07:00
Flarna
eba2b89b3c [node] Some fixes for net and https (#20662)
Sync Lookup function type in net, tls and dgram.
2017-10-23 13:17:14 -07:00
Jinwoo Lee
e86a56d0cc Node http2: statCheck() may also return false. (#20692)
* Node http2: statCheck() may also return `false`.

https://nodejs.org/dist/latest-v8.x/docs/api/http2.html#http2_http2stream_respondwithfile_path_headers_options
says:
The options.statCheck function may also be used to cancel the send operation by
returning false

Related node code:
  - https://github.com/nodejs/node/blob/master/lib/internal/http2/core.js#L1621
  - https://github.com/nodejs/node/blob/master/lib/internal/http2/core.js#L1671

* add tests for returning false from statCheck()

* change `void|false` to `void|boolean`

* fix lint error
2017-10-19 10:22:12 -07:00
Oliver Joseph Ash
0960f82a0b Correct type of Node url.query (#20650)
* Correct type of Node url.query

https://nodejs.org/api/url.html#url_urlobject_query

* Add null

* Node url.query: query value as array of strings

* Node: narrow query type to fix tests
2017-10-18 08:56:47 -07:00
Jinwoo Lee
63605aa515 Node: respondWithFile()'s options can have onError. (#20659)
* respondWithFile()'s `options` can have onError.

See the Node document:
https://nodejs.org/dist/latest-v8.x/docs/api/http2.html#http2_http2stream_respondwithfile_path_headers_options

And also the code:
https://github.com/nodejs/node/blob/master/lib/internal/http2/core.js#L1698

* update test
2017-10-18 08:54:49 -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
Alessandro Vergani
d518490227 Add O_DSYNC flag (#20638) 2017-10-17 09:17:47 -07:00
Alessandro Vergani
52f686b9db Add lookup to dgram SocketOptions (#20636) 2017-10-17 09:16:06 -07:00
Jinwoo Lee
fb93c75e47 Fix type of createPushResponse() in node http2. (#20510)
* Fix type of createPushResponse() in node http2.

From https://github.com/nodejs/node/blob/master/lib/internal/http2/compat.js#L628:
`callback` is required to be a function. And its second argument is an `Http2ServerResponse`.

* `err` is nullable.

* delete redundant tests that have partial arguments
2017-10-17 08:35:55 -07:00
Alessandro Vergani
0905b3d2f9 Add copyFile to node file system (#20185) 2017-10-17 08:00:05 -07:00
Piotr Roszatycki
8ef0c39ccf node: process.stdin is a stream.Readable and process.stdout is a stream.Writable (#20493)
* Readable.wrap returns this

* Add missing properties to interface ReadableStream and WritableStream; change interfaces in fs, dgram and net into classes

* Move all additional properties from ReadableStream interface to ReadStream interface (and Write...)

* hexo-fs should re-export classes from 'fs'

* process.stdin._destroy is a function
2017-10-17 07:44:21 -07:00
Jarrad Whitaker
d7f5d8fa90 @types/node: Asynchooks promiseResolve and AsyncResource (#20540)
* add promiseResolve hook

* add AsyncResource

* AsyncResource jsdoc fixes

* test remaining AsyncResource methods
2017-10-16 13:42:29 -07:00
Piotr Roszatycki
173d1d4e9e node: dgram buffer size options and methods for Node 8.7.0 (#20535)
* dgram buffer size options and methods

* Verify type returned by dgram.*BufferSize methods
2017-10-16 13:40:56 -07:00
kazuyamamoto
ea8b7af8c6 [node] Add tls.getCiphers() and tls.DEFAULT_ECDH_CURVE (#20482)
https://nodejs.org/api/tls.html#tls_tls_getciphers
https://nodejs.org/api/tls.html#tls_tls_default_ecdh_curve
2017-10-16 13:16:08 -07:00
Robert K. Bell
547c7fd610 [types/node] Add final option to Stream WritableOptions (#20477)
* fix: add `final` option for WritableStreams

* fix: use more accurate type for `final()`

* typo: whitespace

* test: add `final` option

as documented here:
https://nodejs.org/docs/latest/api/stream.html#stream_constructor_new_stream_writable_options

* fix: cb is mandatory, error is optional
2017-10-16 13:15:22 -07:00
Flarna
2466ddbcff [node] Add Buffer.poolSize() and correct Buffer.byteLength() (#20419)
* [node] Add Buffer.poolSize

* [node] Allow more types for Buffer.byteLength()

* fix lint issue
2017-10-16 11:18:42 -07:00
Alessandro Vergani
0e7cad3271 Add setMulticastInterface to node dgram (#20186) 2017-10-16 10:39:48 -07:00
Martijn Schrage
55a284355b Add missing method readline.emitKeypressEvents to package node (#19733) 2017-10-16 08:47:24 -07:00
Rogier Schouten
ca3ec2cfe8 fix Node net.createConnection() and Socket#connect() signatures. (#19456)
* fix net.createConnection() and Socket#connect() signatures.

* fix lint errors.

* Fix review comments.
2017-10-16 08:26:29 -07:00
Alvis Tang
1aefe0126e node: add the definition for util.callbackify (#19114)
* fix(node): add the definition for util.callbackify

* test(node): add an unit test for util.callbackify
2017-10-06 11:26:17 -07:00
Nathan Shively-Sanders
b8ea87c68e Strict function variance fixes round 1 2017-10-02 15:50:34 -07:00
Flarna
616c84c0e7 [node] Allow augmentation of module (#19612)
* [node] Allow augmentation of module
- move class Module into NodeJS namespace
- add Module.Module

* update according to review findings
2017-09-28 13:36:21 -07:00
Alessandro Vergani
dde28abe03 Add execFile tests 2017-09-21 17:36:51 +02:00
Andy
f344702d8e node: Add ability to promisify setTimeout and setImmediate (#19488)
* node: Add ability to promisify setTimeout and setImmediate

* Support providing a value
2017-09-08 12:51:56 -07:00
Kelvin Jin
7809b0138f [node] Add inspector type definitions (#19330)
* Add inspector types

* Move inspector to separate file

* Add tests and various updates

* substitute object with empty object

* fix copy-paste lapse

* use protocol definition bundled with Node 8.4.0

* Add inspector type def generator script

* fix issues from rebase

* address comments
2017-09-06 14:40:47 -07:00
Yaroslav Admin
5636098e03 Added more types for Node (#19465) 2017-09-06 08:07:35 -07:00
Kelvin Jin
a56c93add1 [node] Add http2 type definitions (#18952)
* [node] Add http2 type definitions

* More restrictive headers type

* Split Headers into incoming and outgoing

* Small changes

* Add tests and make corrections that surfaced while writing them

* Use spread operator instead of Object.assign

* Address comments
2017-08-23 14:33:31 -07:00
Marc Ghorayeb
ad093c1036 [node] homogenize zlib input to Buffer or string and results to Buffer 2017-08-15 14:36:40 +02:00
Dimitri Benin
5a3249593e [node] improve util.deprecate() typings, fix tests in v4 & v6 for TS >=2.3 (#18903)
* [node] improve util.deprecate() typings, fix tests in v4 & v6 for TS >=2.3

* [react-measure, react-svg-pan-zoom] fix lint errors

* [node] change deprecate() typings in v7, too
2017-08-14 11:18:10 -07:00
Flarna
34d4afebc1 [node] Update async_hooks according to renaming done in 8.2.0 (#18530)
- currentId() => executionAsyncId()
- triggerId() => triggerAsyncId()

see https://github.com/nodejs/node/pull/13490
2017-08-01 10:49:41 -07:00
Deividas Bakanas
417f73ad32 [node] undefined type added to properties of dictionaries. Some TSLint TODOs resolved. (#18372)
* `undefined` type added to properties of dictionaries;
Formatting fixed;
TSLint TODOs resolved:
- adjacent-overload-signatures;
- align;
- array-type;
- callable-types;
- comment-format;
- dt-header;
- import-spacing;
- interface-over-type-literal;
- jsdoc-format;
- no-consecutive-blank-lines;
- no-padding;
- no-string-throw;
- object-literal-shorthand;
- one-line;
- only-arrow-functions;
- semicolon;
- whitespace.

* `NodeRequireFunction` `type` reverted to `interface`.
2017-07-31 13:57:11 -07:00
william chang(張仲威)
b269ac560f [node] http.server add property keepAliveTimeout (#18385) 2017-07-25 12:42:02 -07:00
Andy
af8b0d1294 FIx new lint errors (#18382) 2017-07-25 10:34:23 -07:00
william chang(張仲威)
dfda34b1c2 [node] net.Server, http.Server, http.ServerRequest, http.ServerResponse, http.ClientRequest, http.IncomingMessage, http.ClientResponse fix from interface to class and add constructors. (#18281)
* [node] net.Server, http.Server, http.ServerRequest, http.ServerResponse, http.ClientRequest, http.IncomingMessage, http.ClientResponse, http.Server fix from interface to class and add constructors.

* add http constructor tests

* fix lint

* add author

* fix: remove rejectUnauthorized,
createConnection callback make more detailed,
http.Server requestListener more detailed,
add export OutgoingMessage, ServerResponse and ClientRequest extends OutgoingMessage.
combine the constructors in ClientRequest

* add more http tests

* remove trailing space

* remove deprecated apis, private props not documented, seperate httpHeaders to incoming and outgoing, fix rejectUnauthorized prop misplaced, use () => void for callback

* typo

* settimeout return this
2017-07-24 10:37:46 -07:00
Daniel Imms
527914c2a3 node: Fix net.Socket definition (#18275)
v0.12.x: https://nodejs.org/docs/latest-v0.12.x/api/net.html#net_new_net_socket_options
v4: https://nodejs.org/dist/latest-v4.x/docs/api/net.html#net_new_net_socket_options
v6: https://nodejs.org/dist/latest-v6.x/docs/api/net.html#net_new_net_socket_options
v7: https://nodejs.org/dist/latest-v7.x/docs/api/net.html#net_new_net_socket_options
v8: https://nodejs.org/api/net.html#net_new_net_socket_options
2017-07-21 09:41:56 -07:00
Ron Buckton
d00f967ff8 Improve types for node 'fs' module (#18052) 2017-07-20 15:54:19 -07:00
Ryan Cavanaugh
000e7a1135 Merge pull request #17978 from cjbarth/node/read-file-sync
NODE: Correct signature for readFileSync
2017-07-13 19:03:26 -07:00
Ryan Cavanaugh
60a364df1d Merge pull request #17959 from achugaev93/master
node: Updated definitions and tests for ChildProcess#send method
2017-07-13 16:46:48 -07:00
Barth, Christopher
4b8d8cea4d Update tests 2017-07-13 10:38:41 -04:00
Barth, Christopher
e373c4db6c Add tests and include readFile changes 2017-07-13 09:07:38 -04:00
Ryan Cavanaugh
ab73c5c1a3 Merge pull request #17528 from mwiktorczyk/master
Node.js v8.0.0 Stream - types/node/index.d.ts
2017-07-12 14:10:27 -07:00
Alex Chugaev
b9897281e3 Merge branch 'master' into master 2017-07-12 02:20:13 +03:00