diff --git a/buffer.js b/buffer.js index 5547046..f14fd15 100644 --- a/buffer.js +++ b/buffer.js @@ -36,7 +36,6 @@ var buffer = {}; /** * @param {...*} var_args * @constructor - * @extends Array * @nosideeffects */ buffer.Buffer = function(var_args) {}; @@ -107,7 +106,6 @@ buffer.Buffer.prototype.length; * @param {number=} sourceStart * @param {number=} sourceEnd * @return {buffer.Buffer} - * @nosideeffects */ buffer.Buffer.prototype.copy = function(targetBuffer, targetStart, sourceStart, sourceEnd){}; diff --git a/child_process.js b/child_process.js index a846bd8..d881932 100644 --- a/child_process.js +++ b/child_process.js @@ -90,8 +90,8 @@ child_process.ChildProcess.spawn = function(command, args, options) {}; /** * @param {string} command - * @param {child_process.Options|function(Error, Buffer, Buffer)=} options - * @param {function(Error, Buffer, Buffer)=} callback + * @param {child_process.Options|function(Error, buffer.Buffer, buffer.Buffer)=} options + * @param {function(Error, buffer.Buffer, buffer.Buffer)=} callback * @return {child_process.ChildProcess} */ child_process.exec = function(command, options, callback) {}; @@ -100,7 +100,7 @@ child_process.exec = function(command, options, callback) {}; * @param {string} file * @param {Array.} args * @param {child_process.Options} options - * @param {function(Error, Buffer, Buffer)} callback + * @param {function(Error, buffer.Buffer, buffer.Buffer)} callback * @return {child_process.ChildProcess} */ child_process.execFile = function(file, args, options, callback) {}; @@ -108,7 +108,7 @@ child_process.execFile = function(file, args, options, callback) {}; /** * @param {string} modulePath * @param {Array.=} args - * @param {child_process.Options} options + * @param {child_process.Options=} options * @return {child_process.ChildProcess} */ child_process.fork = function(modulePath, args, options) {}; diff --git a/cluster.js b/cluster.js index 7e0a4b0..0e5b4a9 100644 --- a/cluster.js +++ b/cluster.js @@ -29,9 +29,9 @@ */ /** - * @extends events.EventEmitter + * @type events.EventEmitter */ -var cluster = function() {}; +var cluster; /** * @typedef {{exec: string, args: Array., silent: boolean}} diff --git a/contrib/Preprocessor.js b/contrib/Preprocessor.js index e8bbb2e..c241206 100644 --- a/contrib/Preprocessor.js +++ b/contrib/Preprocessor.js @@ -63,7 +63,7 @@ Preprocessor.indent = function(str, indent) {}; Preprocessor.nlToStr = function(str) {}; /** - * @param {object.} defines + * @param {Object.} defines * @param {string} expr * @return {*} * @throws {Error} @@ -72,7 +72,7 @@ Preprocessor.nlToStr = function(str) {}; Preprocessor.evaluate = function(defines, expr) {}; /** - * @param {object.} directives + * @param {Object.} directives * @return {string} */ Preprocessor.prototype.process = function(directives) {}; diff --git a/contrib/ProtoBuf.js b/contrib/ProtoBuf.js index 30dd113..b218f74 100644 --- a/contrib/ProtoBuf.js +++ b/contrib/ProtoBuf.js @@ -27,7 +27,7 @@ */ /** - * {@type object.} + * {@type Object.} */ var ProtoBuf = {}; @@ -38,7 +38,7 @@ var ProtoBuf = {}; ProtoBuf.VERSION = "0.9.2"; /** - * @type {!object.} + * @type {!Object.} * @const */ ProtoBuf.WIRE_TYPES = {}; @@ -81,7 +81,7 @@ ProtoBuf.WIRE_TYPES.BITS32 = 5; /** * @dict - * @type {!object.} + * @type {!Object.} * @const */ ProtoBuf.TYPES = { @@ -136,12 +136,12 @@ ProtoBuf.TYPES = { }; /** - * @type {!object.} + * @type {!Object.} */ ProtoBuf.Lang = {}; /** - * @type {!object.} + * @type {!Object.} */ ProtoBuf.DotProto = {}; @@ -162,7 +162,7 @@ ProtoBuf.DotProto.Tokenizer.prototype.source; ProtoBuf.DotProto.Tokenizer.prototype.index; /** - * @type {array.} + * @type {Array.} */ ProtoBuf.DotProto.Tokenizer.prototype.stack; diff --git a/contrib/Ws.js b/contrib/Ws.js index e4c761e..c7f1f6a 100644 --- a/contrib/Ws.js +++ b/contrib/Ws.js @@ -48,7 +48,7 @@ ws.Server = function(options, callback) {}; ws.Server.prototype.close = function(code, data) {}; /** - * @param {http.ServerRequest} request + * @param {http.IncomingMessage} request * @param {net.Socket} socket * @param {string} upgradeHead * @param {function(...)} callback @@ -57,7 +57,7 @@ ws.Server.prototype.handleUpgrade = function(request, socket, upgradeHead, callb /** * @param {string} address - * @param {object.=} options + * @param {Object.=} options * @constructor * @extends events.EventEmitter */ @@ -84,7 +84,7 @@ ws.WebSocket.prototype.protocolVersion; ws.WebSocket.prototype.url; /** - * @type {object.} + * @type {Object.} */ ws.WebSocket.prototype.supports; @@ -100,14 +100,14 @@ ws.WebSocket.prototype.pause = function() {}; /** * @param {*=} data - * @param {object.=} options + * @param {Object.=} options * @param {boolean=} dontFailWhenClosed */ ws.WebSocket.prototype.ping = function(data, options, dontFailWhenClosed) {}; /** * @param {*=}data - * @param {object.=} options + * @param {Object.=} options * @param {boolean=} dontFailWhenClosed */ ws.WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) {}; @@ -118,13 +118,13 @@ ws.WebSocket.prototype.resume = function() {}; /** * @param {*} data - * @param {object.=} options + * @param {Object.=} options * @param {function(...[*])=} callback */ ws.WebSocket.prototype.send = function(data, options, callback) {}; /** - * @param {object.|function(string, boolean)} options + * @param {Object.|function(string, boolean)} options * @param {function(string, boolean)=} callback */ ws.WebSocket.prototype.stream = function(options, callback) {}; @@ -149,6 +149,6 @@ ws.WebSocket.prototype.onerror = function(error) {}; ws.WebSocket.prototype.onclose = function(code, message) {}; /** - * @type {?function(*, object.)} + * @type {?function(*, Object.)} */ ws.WebSocket.prototype.onmessage = function(data, flags) {}; diff --git a/core.js b/core.js index 70f87dc..3167e88 100644 --- a/core.js +++ b/core.js @@ -22,10 +22,6 @@ * @author Daniel Wirtz */ -/** - */ -Object.prototype.inspect = function() {}; - /** * @param name * @return {*} @@ -73,7 +69,7 @@ var exports; module.exports; /** - * @type {require} + * @type {function(string)} */ module.require; diff --git a/crypto.js b/crypto.js index 6d963a9..28e9a8f 100644 --- a/crypto.js +++ b/crypto.js @@ -57,7 +57,7 @@ crypto.createHash = function(algorithm) {}; /** * @param {string} algorithm - * @param {Object} options + * @param {Object=} options * @constructor * @extends stream.Transform */ @@ -85,7 +85,7 @@ crypto.createHmac = function(algorithm, key) {}; /** * @param {string} hmac * @param {string|buffer.Buffer} key - * @param {Object} options + * @param {Object=} options * @constructor * @extends stream.Transform */ @@ -112,14 +112,14 @@ crypto.createCipher = function(algorithm, password) {}; * @param {string} algorithm * @param {string|buffer.Buffer} key * @param {string|buffer.Buffer} iv - * @return {crypto.Cipher} + * @return {crypto.Cipheriv} */ crypto.createCipheriv = function(algorithm, key, iv) {}; /** * @param {string|buffer.Buffer} cipher * @param {string} password - * @param {Object} options + * @param {Object=} options * @constructor * @extends stream.Transform */ @@ -135,11 +135,10 @@ crypto.Cipher.prototype.update = function(data, input_encoding, output_encoding) /** * @name crypto.Cipher.prototype.final - * @function * @param {string} output_encoding * @return {string|buffer.Buffer} */ -// crypto.Cipher.prototype.final = function(output_encoding) {}; +crypto.Cipher.prototype['final'] = function(output_encoding) {}; /** * @param {boolean=} auto_padding @@ -147,14 +146,37 @@ crypto.Cipher.prototype.update = function(data, input_encoding, output_encoding) crypto.Cipher.prototype.setAutoPadding = function(auto_padding) {}; /** - * @param {string|crypto.Cipheriv} cipher + * Note: Cipheriv mixes update, final, and setAutoPadding from Cipher but + * doesn't inherit directly from Cipher. + * + * @param {string} cipher * @param {string|buffer.Buffer} key * @param {string|buffer.Buffer} iv * @constructor - * @extends crypto.Cipher + * @extends stream.Transform */ crypto.Cipheriv = function(cipher, key, iv) {}; +/** + * @param {string|buffer.Buffer} data + * @param {string=} input_encoding + * @param {string=} output_encoding + * @return {string|buffer.Buffer} + */ +crypto.Cipheriv.prototype.update = function(data, input_encoding, output_encoding) {}; + +/** + * @name crypto.Cipheriv.prototype.final + * @param {string} output_encoding + * @return {string|buffer.Buffer} + */ +crypto.Cipheriv.prototype['final'] = function(output_encoding) {}; + +/** + * @param {boolean=} auto_padding + */ +crypto.Cipheriv.prototype.setAutoPadding = function(auto_padding) {}; + /** * @param {string} algorithm * @param {string|buffer.Buffer} password @@ -166,14 +188,17 @@ crypto.createDecipher = function(algorithm, password) {}; * @param {string} algorithm * @param {string|buffer.Buffer} key * @param {string|buffer.Buffer} iv - * @return {crypto.Decipher} + * @return {crypto.Decipheriv} */ crypto.createDecipheriv = function(algorithm, key, iv) {}; /** - * @param {string|buffer.Buffer|crypto.Decipher} cipher + * Note: Decipher mixes update, final, and setAutoPadding from Cipher but + * doesn't inherit directly from Cipher. + * + * @param {string|buffer.Buffer} cipher * @param {string|buffer.Buffer} password - * @param {Object} options + * @param {Object=} options * @constructor * @extends stream.Transform */ @@ -189,11 +214,16 @@ crypto.Decipher.prototype.update = function(data, input_encoding, output_encodin /** * @name crypto.Decipher.prototype.final - * @function * @param {string} output_encoding * @return {string|buffer.Buffer} */ -// crypto.Decipher.prototype.final = function(output_encoding) {}; +crypto.Decipher.prototype['final'] = function(output_encoding) {}; + +/** + * @param {string} output_encoding + * @return {string|buffer.Buffer} + */ +crypto.Decipher.prototype.finaltol = function(output_encoding) {}; /** * @param {boolean=} auto_padding @@ -201,29 +231,53 @@ crypto.Decipher.prototype.update = function(data, input_encoding, output_encodin crypto.Decipher.prototype.setAutoPadding = function(auto_padding) {}; /** + * Note: Decipheriv mixes update, final, and setAutoPadding from Cipher but + * doesn't inherit directly from Cipher. + * * @param {string|buffer.Buffer|crypto.Decipheriv} cipher * @param {string|buffer.Buffer} key * @param {string|buffer.Buffer} iv - * @param {Object} options + * @param {Object=} options * @constructor - * @extends crypto.Cipher + * @extends stream.Transform */ crypto.Decipheriv = function(cipher, key, iv, options) {}; /** - * @type {crypto.Cipher.prototype.final} + * @param {string|buffer.Buffer} data + * @param {string=} input_encoding + * @param {string=} output_encoding + * @return {string|buffer.Buffer} + */ +crypto.Decipheriv.prototype.update = function(data, input_encoding, output_encoding) {}; + +/** + * @name crypto.Decipheriv.prototype.final + * @param {string} output_encoding + * @return {string|buffer.Buffer} + */ +crypto.Decipheriv.prototype['final'] = function(output_encoding) {}; + +/** + * @param {string} output_encoding + * @return {string|buffer.Buffer} */ -crypto.Decipheriv.prototype.finaltol; +crypto.Decipheriv.prototype.finaltol = function(output_encoding) {}; + +/** + * @param {boolean=} auto_padding + */ +crypto.Decipheriv.prototype.setAutoPadding = function(auto_padding) {}; /** * @param {string} algorithm - * @return {crypto.Signer} + * @return {crypto.Sign} */ crypto.createSign = function(algorithm) {}; /** * @param {string} algorithm - * @param {Object} options + * @param {Object=} options * @constructor * @extends stream.Writable */ @@ -241,11 +295,6 @@ crypto.Sign.prototype.update = function(data) {}; */ crypto.Sign.prototype.sign = function(private_key, output_format) {}; -/** - * @type {crypto.Sign} - */ -crypto.Signer; // Not sure about API docs / source diff - /** * @param {string} algorithm * @return crypto.Verify @@ -254,17 +303,12 @@ crypto.createVerify = function(algorithm) {}; /** * @param {string} algorithm - * @param {Object} options + * @param {Object=} options * @constructor * @extends stream.Writable */ crypto.Verify = function(algorithm, options) {}; -/** - * @type {crypto.Sign._write} - */ -crypto.Verify.prototype._write; - /** * @param {string|buffer.Buffer} data */ @@ -287,7 +331,7 @@ crypto.createDiffieHellman = function(prime, encoding) {}; /** * @param {number} sizeOrKey - * @param {string} encoding + * @param {string=} encoding * @constructor */ crypto.DiffieHellman = function(sizeOrKey, encoding) {}; @@ -345,70 +389,111 @@ crypto.DiffieHellman.prototype.setPublicKey = function(key, encoding) {}; crypto.DiffieHellman.prototype.setPrivateKey = function(key, encoding) {}; /** + * Note: DiffieHellmanGroup mixes DiffieHellman but doesn't inherit directly. + * * @param {string} name * @constructor */ crypto.DiffieHellmanGroup = function(name) {}; /** - * TODO: Not sure if this works. + * @param {string=} encoding + * @return {string|buffer.Buffer} + */ +crypto.DiffieHellmanGroup.prototype.generateKeys = function(encoding) {}; + +/** + * @param {string|buffer.Buffer} key + * @param {string=} inEnc + * @param {string=} outEnc + * @return {string|buffer.Buffer} + */ +crypto.DiffieHellmanGroup.prototype.computeSecret = function(key, inEnc, outEnc) {}; + +/** + * @param {string=} encoding + * @return {string|buffer.Buffer} */ -crypto.DiffieHellmanGroup.prototype.generateKeys = crypto.DiffieHellman.prototype.generateKeys; +crypto.DiffieHellmanGroup.prototype.getPrime = function(encoding) {}; /** - * TODO: Not sure if this works. + * @param {string=} encoding + * @return {string|buffer.Buffer} */ -crypto.DiffieHellmanGroup.prototype.computeSecret = crypto.DiffieHellman.prototype.computeSecret; +crypto.DiffieHellmanGroup.prototype.getGenerator = function(encoding) {}; /** - * @type {crypto.DiffieHellman.prototype.getPrime} + * @param {string=} encoding + * @return {string|buffer.Buffer} */ -crypto.DiffieHellmanGroup.prototype.getPrime = crypto.DiffieHellman.prototype.getPrime; +crypto.DiffieHellmanGroup.prototype.getPublicKey = function(encoding) {}; /** - * @type {crypto.DiffieHellman.prototype.getGenerator} + * @param {string} encoding + * @return {string|buffer.Buffer} + */ +crypto.DiffieHellmanGroup.prototype.getPrivateKey = function(encoding) {} + +/** + * @param {string|buffer.Buffer} key + * @param {string=} encoding + * @return {crypto.DiffieHellmanGroup} */ -crypto.DiffieHellmanGroup.prototype.getGenerator = crypto.DiffieHellman.prototype.getGenerator; +crypto.DiffieHellmanGroup.prototype.setPublicKey = function(key, encoding) {}; /** - * @type {crypto.DiffieHellman.prototype.getPublicKey} + * @param {string|buffer.Buffer} key + * @param {string=} encoding + * @return {crypto.DiffieHellmanGroup} */ -crypto.DiffieHellmanGroup.prototype.getPublicKey = crypto.DiffieHellman.prototype.getPublicKey; +crypto.DiffieHellmanGroup.prototype.setPrivateKey = function(key, encoding) {}; /** - * @type {crypto.DiffieHellman.prototype.getPrivateKey} + * @param {string} group_name + * @return {crypto.DiffieHellmanGroup} */ -crypto.DiffieHellmanGroup.prototype.getPrivateKey = crypto.DiffieHellman.prototype.getPrivateKey; +crypto.getDiffieHellman = function(group_name) {}; /** - * @type {crypto.DiffieHellman.prototype.setPublicKey} + * @param {string|buffer.Buffer} password + * @param {string|buffer.Buffer} salt + * @param {number} iterations + * @param {number} keylen + * @param {function(*, string)} callback */ -crypto.DiffieHellmanGroup.prototype.setPublicKey = crypto.DiffieHellman.prototype.setPublicKey; +crypto.pbkdf2 = function(password, salt, iterations, keylen, callback) {}; /** - * @type {crypto.DiffieHellman.prototype.setPrivateKey} + * @param {string|buffer.Buffer} password + * @param {string|buffer.Buffer} salt + * @param {number} iterations + * @param {number} keylen */ -crypto.DiffieHellmanGroup.prototype.setPrivateKey = crypto.DiffieHellman.prototype.setPrivateKey; +crypto.pbkdf2Sync = function(password, salt, iterations, keylen) {}; /** - * @type {*} + * @param {number} size + * @param {function(Error, buffer.Buffer)=} callback */ -crypto.randomBytes; +crypto.randomBytes = function(size, callback) {}; /** - * @type {*} + * @param {number} size + * @param {function(Error, buffer.Buffer)=} callback */ -crypto.pseudoRandomBytes; +crypto.pseudoRandomBytes = function(size, callback) {}; /** - * @type {crypto.randomBytes} + * @param {number} size + * @param {function(Error, buffer.Buffer)=} callback */ -crypto.rng = crypto.randomBytes; +crypto.rng = function(size, callback) {}; /** - * @type {crypto.pseudoRandomBytes} + * @param {number} size + * @param {function(Error, buffer.Buffer)=} callback */ -crypto.prng = crypto.pseudoRandomBytes; +crypto.prng = function(size, callback) {}; /** * @return {Array.} diff --git a/domain.js b/domain.js index 5064e58..3349561 100644 --- a/domain.js +++ b/domain.js @@ -54,7 +54,7 @@ domain.Domain.prototype.run = function(fn) {}; domain.Domain.prototype.members; /** - * @param {events.Emitter} emitter + * @param {events.EventEmitter} emitter */ domain.Domain.prototype.add = function(emitter) {}; diff --git a/fs.js b/fs.js index bd646cc..33b0442 100644 --- a/fs.js +++ b/fs.js @@ -143,7 +143,6 @@ fs.lchmodSync = function(path, mode) {}; /** * @param {string} path * @param {function(string, fs.Stats)=} callback - * @nosideeffects */ fs.stat = function(path, callback) {}; @@ -157,7 +156,6 @@ fs.statSync = function(path) {} /** * @param {*} fd * @param {function(string, fs.Stats)=} callback - * @nosideeffects */ fs.fstat = function(fd, callback) {}; @@ -171,7 +169,6 @@ fs.fstatSync = function(fd) {} /** * @param {string} path * @param {function(string, fs.Stats)=} callback - * @nosideeffects */ fs.lstat = function(path, callback) {}; @@ -213,7 +210,6 @@ fs.symlinkSync = function(srcpath, dstpath, type) {}; /** * @param {string} path * @param {function(string, string)=} callback - * @nosideeffects */ fs.readlink = function(path, callback) {}; @@ -226,15 +222,14 @@ fs.readlinkSync = function(path) {}; /** * @param {string} path - * @param {object.|function(string, string)=} cache + * @param {Object.|function(string, string)=} cache * @param {function(string, string)=} callback - * @nosideeffects */ fs.realpath = function(path, cache, callback) {}; /** * @param {string} path - * @param {object.=} cache + * @param {Object.=} cache * @return {string} * @nosideeffects */ @@ -277,14 +272,13 @@ fs.mkdirSync = function(path, mode) {}; /** * @param {string} path - * @param {function(string,array.)=} callback - * @nosideeffects + * @param {function(string,Array.)=} callback */ fs.readdir = function(path, callback) {}; /** * @param {string} path - * @return {array.} + * @return {Array.} * @nosideeffects */ fs.readdirSync = function(path) {}; @@ -305,7 +299,6 @@ fs.closeSync = function(fd) {}; * @param {string} flags * @param {number=} mode * @param {function(string, *)=} callback - * @nosideeffects */ fs.open = function(path, flags, mode, callback) {}; @@ -320,34 +313,32 @@ fs.openSync = function(path, flags, mode) {}; /** * @param {string} path - * @param {number} atime - * @param {number} mtime + * @param {number|Date} atime + * @param {number|Date} mtime * @param {function(...)=} callback - * @nosideeffects */ fs.utimes = function(path, atime, mtime, callback) {}; /** * @param {string} path - * @param {number} atime - * @param {number} mtime + * @param {number|Date} atime + * @param {number|Date} mtime * @nosideeffects */ fs.utimesSync = function(path, atime, mtime) {}; /** * @param {*} fd - * @param {number} atime - * @param {number} mtime + * @param {number|Date} atime + * @param {number|Date} mtime * @param {function(...)=} callback - * @nosideeffects */ fs.futimes = function(fd, atime, mtime, callback) {}; /** * @param {*} fd - * @param {number} atime - * @param {number} mtime + * @param {number|Date} atime + * @param {number|Date} mtime * @nosideeffects */ fs.futimesSync = function(fd, atime, mtime) {}; @@ -390,7 +381,6 @@ fs.writeSync = function(fd, buffer, offset, length, position) {}; * @param {number} length * @param {number} position * @param {function(string, number, *)=} callback - * @nosideeffects */ fs.read = function(fd, buffer, offset, length, position, callback) {}; @@ -409,7 +399,6 @@ fs.readSync = function(fd, buffer, offset, length, position) {}; * @param {string} filename * @param {string|function(string, *)=}encoding * @param {function(string, *)=} callback - * @nosideeffects */ fs.readFile = function(filename, encoding, callback) {}; @@ -475,7 +464,6 @@ fs.watch = function(filename, options, listener) {}; /** * @param {string} path * @param {function(boolean)} callback - * @nosideeffects */ fs.exists = function(path, callback) {}; @@ -585,17 +573,17 @@ fs.Stats.prototype.blocks = 0; /** * @type {Date} */ -fs.Stats.prototype.atime = 0; +fs.Stats.prototype.atime; /** * @type {Date} */ -fs.Stats.prototype.mtime = 0; +fs.Stats.prototype.mtime; /** * @type {Date} */ -fs.Stats.prototype.ctime = 0; +fs.Stats.prototype.ctime; /** * @param {string} path diff --git a/http.js b/http.js index c332d4b..fa36537 100644 --- a/http.js +++ b/http.js @@ -30,7 +30,7 @@ END_NODE_INCLUDE var http = {}; /** - * @typedef {function(http.ServerRequest, http.ServerResponse)} + * @typedef {function(http.IncomingMessage, http.ServerResponse)} */ http.requestListener; @@ -60,63 +60,65 @@ http.Server.prototype.close = function() {}; /** * @constructor - * @extends events.EventEmitter - * @private + * @extends stream.Readable */ -http.ServerRequest = function() {}; +http.IncomingMessage = function() {}; /** - * @type {string} + * @type {?string} * */ -http.ServerRequest.prototype.method; +http.IncomingMessage.prototype.method; /** - * @type {string} + * @type {?string} */ -http.ServerRequest.prototype.url; +http.IncomingMessage.prototype.url; /** * @type {Object} * */ -http.ServerRequest.prototype.headers; +http.IncomingMessage.prototype.headers; /** * @type {Object} * */ -http.ServerRequest.prototype.trailers; +http.IncomingMessage.prototype.trailers; /** * @type {string} */ -http.ServerRequest.prototype.httpVersion; +http.IncomingMessage.prototype.httpVersion; /** * @type {string} */ -http.ServerRequest.prototype.httpVersionMajor; +http.IncomingMessage.prototype.httpVersionMajor; /** * @type {string} */ -http.ServerRequest.prototype.httpVersionMinor; +http.IncomingMessage.prototype.httpVersionMinor; /** - * @param {?string} encoding + * @type {*} */ -http.ServerRequest.prototype.setEncoding = function(encoding) {}; +http.IncomingMessage.prototype.connection; /** + * @type {?number} */ -http.ServerRequest.prototype.pause = function() {}; +http.IncomingMessage.prototype.statusCode; /** + * @type {net.Socket} */ -http.ServerRequest.prototype.resume = function() {}; +http.IncomingMessage.prototype.socket; /** - * @type {*} + * @param {number} msecs + * @param {function()} callback */ -http.ServerRequest.prototype.connection; +http.IncomingMessage.prototype.setTimeout = function(msecs, callback) {}; /** * @constructor @@ -159,7 +161,7 @@ http.ServerResponse.prototype.getHeader = function(name) {}; http.ServerResponse.prototype.removeHeader = function(name) {}; /** - * @param {string|Array|Buffer} chunk + * @param {string|Array|buffer.Buffer} chunk * @param {string=} encoding */ http.ServerResponse.prototype.write = function(chunk, encoding) {}; @@ -170,7 +172,7 @@ http.ServerResponse.prototype.write = function(chunk, encoding) {}; http.ServerResponse.prototype.addTrailers = function(headers) {}; /** - * @param {(string|Array|Buffer)=} data + * @param {(string|Array|buffer.Buffer)=} data * @param {string=} encoding */ http.ServerResponse.prototype.end = function(data, encoding) {}; @@ -183,13 +185,13 @@ http.ServerResponse.prototype.end = function(data, encoding) {}; http.ClientRequest = function() {}; /** - * @param {string|Array|Buffer} chunk + * @param {string|Array|buffer.Buffer} chunk * @param {string=} encoding */ http.ClientRequest.prototype.write = function(chunk, encoding) {}; /** - * @param {(string|Array|Buffer)=} data + * @param {(string|Array|buffer.Buffer)=} data * @param {string=} encoding */ http.ClientRequest.prototype.end = function(data, encoding) {}; @@ -198,66 +200,16 @@ http.ClientRequest.prototype.end = function(data, encoding) {}; */ http.ClientRequest.prototype.abort = function() {}; -/** - * @constructor - * @extends events.EventEmitter - * @private - */ -http.ClientResponse = function() {}; - -/** - * @type {number} - */ -http.ClientResponse.prototype.statusCode; - -/** - * @type {string} - */ -http.ClientResponse.prototype.httpVersion; - -/** - * @type {string} - */ -http.ClientResponse.prototype.httpVersionMajor; - -/** - * @type {string} - */ -http.ClientResponse.prototype.httpVersionMinor; - -/** - * @type {Object} - * */ -http.ClientResponse.prototype.headers; - -/** - * @type {Object} - * */ -http.ClientResponse.prototype.trailers; - -/** - * @param {?string} encoding - */ -http.ClientResponse.prototype.setEncoding = function(encoding) {}; - -/** - */ -http.ClientResponse.prototype.pause = function() {}; - -/** - */ -http.ClientResponse.prototype.resume = function() {}; - /** * @param {Object} options - * @param {function(http.ClientResponse)} callback + * @param {function(http.IncomingMessage)} callback * @return {http.ClientRequest} */ http.request = function(options, callback) {}; /** * @param {Object} options - * @param {function(http.ClientResponse)} callback + * @param {function(http.IncomingMessage)} callback * @return {http.ClientRequest} */ http.get = function(options, callback) {}; diff --git a/https.js b/https.js index af31516..8d129b3 100644 --- a/https.js +++ b/https.js @@ -47,7 +47,7 @@ https.Server.prototype.close = function(callback) {}; /** * @param {tls.CreateOptions} options - * @param {function(https.Request, https.Response)=} requestListener + * @param {function(http.IncomingMessage, http.ServerResponse)=} requestListener */ https.createServer = function(options, requestListener) {}; @@ -58,14 +58,14 @@ https.ConnectOptions; /** * @param {https.ConnectOptions|string} options - * @param {function(http.ClientResponse)} callback + * @param {function(http.IncomingMessage)} callback * @return {http.ClientRequest} */ https.request = function(options, callback) {}; /** * @param {https.ConnectOptions|string} options - * @param {function(http.ClientResponse)} callback + * @param {function(http.IncomingMessage)} callback * @return {http.ClientRequest} */ https.get = function(options, callback) {}; diff --git a/net.js b/net.js index d38d582..57bf9d0 100644 --- a/net.js +++ b/net.js @@ -72,7 +72,7 @@ net.Server = function() {}; /** * - * @param {mumber|*} port + * @param {number|*} port * @param {(string|number|function(...))=} host * @param {(number|function(...))=} backlog * @param {function(...)=} callback @@ -107,7 +107,7 @@ net.Server.prototype.connections; net.Socket = function(options) {}; /** - * @param {number|string|function(..)} port + * @param {number|string|function(...)} port * @param {(string|function(...))=} host * @param {function(...)=} connectListener */ diff --git a/os.js b/os.js index 01d06c8..71cfa0e 100644 --- a/os.js +++ b/os.js @@ -72,7 +72,7 @@ os.release = function() {}; os.uptime = function() {}; /** - * @return {array.} + * @return {Array.} * @nosideeffects */ os.loadavg = function() {}; @@ -95,7 +95,7 @@ os.freemem = function() {}; var osCpusInfo; /** - * @return {array.} + * @return {Array.} * @nosideeffects */ os.cpus = function() {}; @@ -106,7 +106,7 @@ os.cpus = function() {}; var osNetworkInterfacesInfo; /** - * @return {object.} + * @return {Object.} * @nosideeffects */ os.networkInterfaces = function() {}; diff --git a/process.js b/process.js index 9dcfd15..b1592f4 100644 --- a/process.js +++ b/process.js @@ -43,7 +43,7 @@ process.stdout; process.stderr; /** - * @type {array.} + * @type {Array.} */ process.argv; @@ -68,7 +68,7 @@ process.chdir = function(directory) {}; process.cwd = function() {}; /** - * @type {object.} + * @type {Object.} */ process.env; @@ -110,7 +110,7 @@ process.version; process.versions; /** - * @type {object.} + * @type {Object.} */ process.config; @@ -141,7 +141,7 @@ process.arch; process.platform; /** - * @return {object.} + * @return {Object.} * @nosideeffects */ process.memoryUsage = function() {}; diff --git a/repl.js b/repl.js index b7864b7..02f0bc6 100644 --- a/repl.js +++ b/repl.js @@ -34,7 +34,7 @@ var repl = {}; /** - * @param {{prompt: ?string, input: ?stream, output: ?stream, terminal: ?boolean, eval: ?function(string), useColors: ?boolean, useGlobal: ?boolean, ignoreUndefined: ?boolean, writer: ?function(string)}} options + * @param {{prompt: ?string, input: ?stream.Readable, output: ?stream.Writable, terminal: ?boolean, eval: ?function(string), useColors: ?boolean, useGlobal: ?boolean, ignoreUndefined: ?boolean, writer: ?function(string)}} options * @return {repl.REPLServer} */ repl.start = function(options) {}; diff --git a/stream.js b/stream.js index 4130cce..c0a645c 100644 --- a/stream.js +++ b/stream.js @@ -28,16 +28,21 @@ END_NODE_INCLUDE */ +var stream = {}; + /** * @constructor + * @param {Object=} options * @extends events.EventEmitter */ -var stream = function() {}; +stream.Stream = function(options) {}; /** - * @type {stream} + * @param {stream.Writable} dest + * @param {{end: boolean}=} pipeOpts + * @return {stream.Writable} */ -stream.Stream = function() {}; +stream.Stream.prototype.pipe = function(dest, pipeOpts) {}; /** * @constructor @@ -75,16 +80,17 @@ stream.WritableStream.prototype.drain = function() {}; stream.WritableStream.prototype.writable; /** - * @param {string|buffer} buffer + * @param {string|buffer.Buffer} buffer * @param {string=} encoding */ stream.WritableStream.prototype.write = function(buffer, encoding) {}; /** - * @param {string|buffer} buffer + * @param {string|buffer.Buffer=} buffer * @param {string=} encoding + * @param {function(*=)=} cb */ -stream.WritableStream.prototype.end = function(buffer, encoding) {}; +stream.WritableStream.prototype.end = function(buffer, encoding, cb) {}; /** */ @@ -99,23 +105,25 @@ stream.WritableStream.prototype.destroySoon = function() {}; /** * @constructor * @param {Object=} options - * @extends stream + * @extends stream.Stream */ stream.Readable = function(options) {}; /** * @type {boolean} + * @deprecated */ stream.Readable.prototype.readable; /** - * @param {string|buffer.Buffe} chunk + * @protected + * @param {string|buffer.Buffer|null} chunk * @return {boolean} */ stream.Readable.prototype.push = function(chunk) {}; /** - * @param {string|buffer.Buffer} chunk + * @param {string|buffer.Buffer|null} chunk * @return {boolean} */ stream.Readable.prototype.unshift = function(chunk) {}; @@ -126,26 +134,19 @@ stream.Readable.prototype.unshift = function(chunk) {}; stream.Readable.prototype.setEncoding = function(enc) {}; /** - * @param {number} n - * @return {buffer.Buffer} + * @param {number=} n + * @return {buffer.Buffer|string|null} */ stream.Readable.prototype.read = function(n) {}; /** + * @protected * @param {number} n - * @return {?buffer.Buffer} */ stream.Readable.prototype._read = function(n) {}; /** - * @param {stream.Writable} dest - * @param {{end: boolean}=} pipeOpts - * @return {stream.Writable} - */ -stream.Readable.prototype.pipe = function(dest, pipeOpts) {}; - -/** - * @param {stream.Writable} dest + * @param {stream.Writable=} dest * @return {stream.Readable} */ stream.Readable.prototype.unpipe = function(dest) {}; @@ -159,46 +160,44 @@ stream.Readable.prototype.resume = function() {}; stream.Readable.prototype.pause = function() {}; /** - * @param {stream} stream + * @param {stream.Stream} stream + * @return {stream.Readable} */ stream.Readable.prototype.wrap = function(stream) {}; /** * @constructor * @param {Object=} options - * @extends stream + * @extends stream.Stream */ stream.Writable = function(options) {}; /** + * @deprecated * @type {boolean} */ stream.Writable.prototype.writable; -/** - */ -stream.Writable.prototype.pipe = function() {}; - /** * @param {string|buffer.Buffer} chunk - * @param {(string|function(...))=} encoding - * @param {function(...)=} cb + * @param {string=} encoding + * @param {function(*=)=} cb * @return {boolean} */ stream.Writable.prototype.write = function(chunk, encoding, cb) {}; /** + * @protected * @param {string|buffer.Buffer} chunk - * @param {(string|function(...))=} encoding - * @param {function(...)=} cb + * @param {string} encoding + * @param {function(*=)} cb */ stream.Writable.prototype._write = function(chunk, encoding, cb) {}; /** - * @param {string|buffer.Buffer} chunk - * @param {(string|function(...))=} encoding - * @param {function(...)=} cb - * @return {boolean} + * @param {string|buffer.Buffer=} chunk + * @param {string=} encoding + * @param {function(*=)=} cb */ stream.Writable.prototype.end = function(chunk, encoding, cb) {}; @@ -206,7 +205,7 @@ stream.Writable.prototype.end = function(chunk, encoding, cb) {}; * @constructor * @param {Object=} options * @extends stream.Readable - * @implements stream.Writable + * Xextends stream.Writable */ stream.Duplex = function(options) {}; @@ -224,11 +223,18 @@ stream.Duplex.prototype.allowHalfOpen; stream.Transform = function(options) {}; /** + * @protected * @param {string|buffer.Buffer} chunk - * @param {*} output + * @param {string} encoding + * @param {function(*=)} cb + */ +stream.Transform._transform = function(chunk, encoding, cb) {}; + +/** + * @protected * @param {function(*=)} cb */ -stream.Transform._transform = function(chunk, output, cb) {}; +stream.Transform._flush = function(cb) {}; /** * @param {Object=} options diff --git a/tls.js b/tls.js index 5d181a2..0d3980f 100644 --- a/tls.js +++ b/tls.js @@ -81,41 +81,15 @@ tls.SecurePair = function() {}; */ tls.Server = function() {}; -/** - * @param {number} port - * @param {(string|function(...))=} host - * @param {function(...)=} callback - */ -tls.Server.prototype.listen = function(port, host, callback) {}; - -/** - */ -tls.Server.prototype.close = function() {}; - -/** - * @return {{port: number, family: string, address: string}} - */ -tls.Server.prototype.address = function() {}; - /** * @param {string} hostname * @param {string|buffer.Buffer} credentials */ tls.Server.prototype.addContext = function(hostname, credentials) {}; -/** - * @type {number} - */ -tls.Server.prototype.maxConnections; - -/** - * @type {number} - */ -tls.Server.prototype.connections; - /** * @constructor - * @extends stream + * @extends stream.Duplex */ tls.CleartextStream = function() {}; diff --git a/zlib.js b/zlib.js index 2bd9eab..30b95b7 100644 --- a/zlib.js +++ b/zlib.js @@ -42,7 +42,7 @@ zlib.Options; /** * @constructor - * @extends stream.WriteStream + * @extends stream.Transform */ zlib.Zlib = function() {}; @@ -122,7 +122,7 @@ zlib.createInflate = function(options) {}; /** * @param {zlib.Options} options - * @return {zlib.ReflateRaw} + * @return {zlib.DeflateRaw} */ zlib.createDeflateRaw = function(options) {};