docs: use optional instead of nullable
This commit is contained in:
parent
a9a21fe480
commit
5c981309df
|
@ -30,7 +30,7 @@ var popkey = require("./_util").popkey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Bitmessage address object.
|
* Create a new Bitmessage address object.
|
||||||
* @param {?Object} opts - Address options
|
* @param {Object=} opts - Address options
|
||||||
* @param {number} opts.version - Version number (4 by default)
|
* @param {number} opts.version - Version number (4 by default)
|
||||||
* @param {number} opts.stream - Stream number (1 by default)
|
* @param {number} opts.stream - Stream number (1 by default)
|
||||||
* @param {Object} opts.behavior - [Pubkey features]{@link module:bitmessage/structs.PubkeyBitfield} (`DOES_ACK` by default)
|
* @param {Object} opts.behavior - [Pubkey features]{@link module:bitmessage/structs.PubkeyBitfield} (`DOES_ACK` by default)
|
||||||
|
@ -248,7 +248,7 @@ Address.prototype.encode = function() {
|
||||||
/**
|
/**
|
||||||
* Create a new Bitmessage address with random encryption and signing
|
* Create a new Bitmessage address with random encryption and signing
|
||||||
* private keys.
|
* private keys.
|
||||||
* @param {?Object} opts - Address options
|
* @param {Object=} opts - Address options
|
||||||
* @param {number} opts.ripeLength - Required length of the short RIPEMD
|
* @param {number} opts.ripeLength - Required length of the short RIPEMD
|
||||||
* hash (19 by default)
|
* hash (19 by default)
|
||||||
* @param {number} opts.version - Version number (4 by default)
|
* @param {number} opts.version - Version number (4 by default)
|
||||||
|
@ -287,11 +287,11 @@ Address.fromRandom = function(opts) {
|
||||||
* Create a new Bitmessage address from passphrase.
|
* Create a new Bitmessage address from passphrase.
|
||||||
* @param {(string|Object)} opts - Passphrase or address options
|
* @param {(string|Object)} opts - Passphrase or address options
|
||||||
* @param {string} opts.passphrase - Passphrase to generate address from
|
* @param {string} opts.passphrase - Passphrase to generate address from
|
||||||
* @param {?number} opts.ripeLength - Required length of the short
|
* @param {number=} opts.ripeLength - Required length of the short
|
||||||
* RIPEMD hash (19 by default)
|
* RIPEMD hash (19 by default)
|
||||||
* @param {?number} opts.version - Version number (4 by default)
|
* @param {number=} opts.version - Version number (4 by default)
|
||||||
* @param {?number} opts.stream - Stream number (1 by default)
|
* @param {number=} opts.stream - Stream number (1 by default)
|
||||||
* @param {?Object} opts.behavior - [Pubkey features]{@link module:bitmessage/structs.PubkeyBitfield} (`DOES_ACK` by default)
|
* @param {Object=} opts.behavior - [Pubkey features]{@link module:bitmessage/structs.PubkeyBitfield} (`DOES_ACK` by default)
|
||||||
* @return {Address} New address object.
|
* @return {Address} New address object.
|
||||||
*/
|
*/
|
||||||
Address.fromPassphrase = function(opts) {
|
Address.fromPassphrase = function(opts) {
|
||||||
|
|
|
@ -63,7 +63,7 @@ BaseTransport.prototype.listen = function() {
|
||||||
* Send [message]{@link module:bitmessage/structs.message} over the
|
* Send [message]{@link module:bitmessage/structs.message} over the
|
||||||
* wire (client mode only).
|
* wire (client mode only).
|
||||||
* @param {(Buffer|string)} msg - Encoded message or command string
|
* @param {(Buffer|string)} msg - Encoded message or command string
|
||||||
* @param {?Buffer} payload - Message payload (used if the first
|
* @param {Buffer=} payload - Message payload (used if the first
|
||||||
* argument is a string)
|
* argument is a string)
|
||||||
* @abstract
|
* @abstract
|
||||||
*/
|
*/
|
||||||
|
@ -75,7 +75,7 @@ BaseTransport.prototype.send = function() {
|
||||||
* Send [message]{@link module:bitmessage/structs.message} to all
|
* Send [message]{@link module:bitmessage/structs.message} to all
|
||||||
* connected clients (server mode only).
|
* connected clients (server mode only).
|
||||||
* @param {(Buffer|string)} msg - Encoded message or command string
|
* @param {(Buffer|string)} msg - Encoded message or command string
|
||||||
* @param {?Buffer} payload - Message payload (used if the first
|
* @param {Buffer=} payload - Message payload (used if the first
|
||||||
* argument is a string)
|
* argument is a string)
|
||||||
* @abstract
|
* @abstract
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -24,7 +24,7 @@ var unmap = BaseTransport._unmap;
|
||||||
/**
|
/**
|
||||||
* TCP transport class. Implements
|
* TCP transport class. Implements
|
||||||
* [base transport interface]{@link module:bitmessage/net/base.BaseTransport}.
|
* [base transport interface]{@link module:bitmessage/net/base.BaseTransport}.
|
||||||
* @param {?Object} opts - Transport options
|
* @param {Object=} opts - Transport options
|
||||||
* @param {Array} opts.seeds - Bootstrap nodes (none by default)
|
* @param {Array} opts.seeds - Bootstrap nodes (none by default)
|
||||||
* @param {Array} opts.dnsSeeds - Bootstrap DNS nodes (none by default)
|
* @param {Array} opts.dnsSeeds - Bootstrap DNS nodes (none by default)
|
||||||
* @param {Object} opts.services -
|
* @param {Object} opts.services -
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
throw new Error("Not implemented");
|
|
|
@ -1 +0,0 @@
|
||||||
throw new Error("Not implemented");
|
|
|
@ -25,7 +25,7 @@ var unmap = BaseTransport._unmap;
|
||||||
/**
|
/**
|
||||||
* WebSocket transport class. Implements
|
* WebSocket transport class. Implements
|
||||||
* [base transport interface]{@link module:bitmessage/net/base.BaseTransport}.
|
* [base transport interface]{@link module:bitmessage/net/base.BaseTransport}.
|
||||||
* @param {?Object} opts - Transport options
|
* @param {Object=} opts - Transport options
|
||||||
* @param {Array} opts.seeds - Bootstrap nodes (none by default)
|
* @param {Array} opts.seeds - Bootstrap nodes (none by default)
|
||||||
* @param {Object} opts.services -
|
* @param {Object} opts.services -
|
||||||
* [Service features]{@link module:bitmessage/structs.ServicesBitfield}
|
* [Service features]{@link module:bitmessage/structs.ServicesBitfield}
|
||||||
|
|
|
@ -104,7 +104,7 @@ var getpubkey = exports.getpubkey = {
|
||||||
/**
|
/**
|
||||||
* Decode `getpubkey` object message.
|
* Decode `getpubkey` object message.
|
||||||
* @param {Buffer} buf - Message
|
* @param {Buffer} buf - Message
|
||||||
* @param {?Object} opts - Decoding options
|
* @param {Object=} opts - Decoding options
|
||||||
* @return {Promise.<Object>} A promise that contains decoded
|
* @return {Promise.<Object>} A promise that contains decoded
|
||||||
* `getpubkey` object structure when fulfilled.
|
* `getpubkey` object structure when fulfilled.
|
||||||
*/
|
*/
|
||||||
|
@ -119,7 +119,7 @@ var getpubkey = exports.getpubkey = {
|
||||||
/**
|
/**
|
||||||
* Decode `getpubkey` object message payload.
|
* Decode `getpubkey` object message payload.
|
||||||
* @param {Buffer} buf - Message payload
|
* @param {Buffer} buf - Message payload
|
||||||
* @param {?Object} opts - Decoding options
|
* @param {Object=} opts - Decoding options
|
||||||
* @return {Promise.<Object>} A promise that contains decoded
|
* @return {Promise.<Object>} A promise that contains decoded
|
||||||
* `getpubkey` object structure when fulfilled.
|
* `getpubkey` object structure when fulfilled.
|
||||||
*/
|
*/
|
||||||
|
@ -245,7 +245,7 @@ var pubkey = exports.pubkey = {
|
||||||
/**
|
/**
|
||||||
* Decode `pubkey` object message.
|
* Decode `pubkey` object message.
|
||||||
* @param {Buffer} buf - Message
|
* @param {Buffer} buf - Message
|
||||||
* @param {?Object} opts - Decoding options
|
* @param {Object=} opts - Decoding options
|
||||||
* @return {Promise.<Object>} A promise that contains decoded `pubkey`
|
* @return {Promise.<Object>} A promise that contains decoded `pubkey`
|
||||||
* object structure when fulfilled.
|
* object structure when fulfilled.
|
||||||
*/
|
*/
|
||||||
|
@ -260,7 +260,7 @@ var pubkey = exports.pubkey = {
|
||||||
/**
|
/**
|
||||||
* Decode `pubkey` object message payload.
|
* Decode `pubkey` object message payload.
|
||||||
* @param {Buffer} buf - Message payload
|
* @param {Buffer} buf - Message payload
|
||||||
* @param {?Object} opts - Decoding options
|
* @param {Object=} opts - Decoding options
|
||||||
* @return {Promise.<Object>} A promise that contains decoded `pubkey`
|
* @return {Promise.<Object>} A promise that contains decoded `pubkey`
|
||||||
* object structure when fulfilled.
|
* object structure when fulfilled.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -247,7 +247,7 @@ var object = exports.object = {
|
||||||
* Decode `object` message.
|
* Decode `object` message.
|
||||||
* NOTE: `nonce` and `objectPayload` are copied.
|
* NOTE: `nonce` and `objectPayload` are copied.
|
||||||
* @param {Buffer} buf - Message
|
* @param {Buffer} buf - Message
|
||||||
* @param {?Object} opts - Decoding options
|
* @param {Object=} opts - Decoding options
|
||||||
* @return {Object} Decoded `object` structure.
|
* @return {Object} Decoded `object` structure.
|
||||||
*/
|
*/
|
||||||
decode: function(buf, opts) {
|
decode: function(buf, opts) {
|
||||||
|
@ -260,7 +260,7 @@ var object = exports.object = {
|
||||||
* Decode `object` message payload.
|
* Decode `object` message payload.
|
||||||
* NOTE: `nonce` and `objectPayload` are copied.
|
* NOTE: `nonce` and `objectPayload` are copied.
|
||||||
* @param {Buffer} buf - Message payload
|
* @param {Buffer} buf - Message payload
|
||||||
* @param {?Object} opts - Decoding options
|
* @param {Object=} opts - Decoding options
|
||||||
* @return {Object} Decoded `object` structure.
|
* @return {Object} Decoded `object` structure.
|
||||||
*/
|
*/
|
||||||
decodePayload: function(buf, opts) {
|
decodePayload: function(buf, opts) {
|
||||||
|
@ -639,7 +639,7 @@ exports.net_addr = {
|
||||||
/**
|
/**
|
||||||
* Decode `net_addr`.
|
* Decode `net_addr`.
|
||||||
* @param {Buffer} buf - A buffer that contains encoded `net_addr`
|
* @param {Buffer} buf - A buffer that contains encoded `net_addr`
|
||||||
* @param {?Object} opts - Decoding options; use `short` option to
|
* @param {Object=} opts - Decoding options; use `short` option to
|
||||||
* decode `net_addr` from
|
* decode `net_addr` from
|
||||||
* [version message]{@link module:bitmessage/messages.version}
|
* [version message]{@link module:bitmessage/messages.version}
|
||||||
* @return {Object} Decoded `net_addr` structure.
|
* @return {Object} Decoded `net_addr` structure.
|
||||||
|
@ -803,9 +803,9 @@ var Bitfield = function(size) {
|
||||||
/**
|
/**
|
||||||
* Service features bitfield (MSB 0).
|
* Service features bitfield (MSB 0).
|
||||||
* @see {@link https://bitmessage.org/wiki/Protocol_specification#version}
|
* @see {@link https://bitmessage.org/wiki/Protocol_specification#version}
|
||||||
* @param {?Buffer} buf - A 8-byte bitfield buffer (will be created if
|
* @param {Buffer=} buf - A 8-byte bitfield buffer (will be created if
|
||||||
* not provided or will be copied if `opts.copy` is `true`)
|
* not provided or will be copied if `opts.copy` is `true`)
|
||||||
* @param {?Object} opts - Options
|
* @param {Object=} opts - Options
|
||||||
* @constructor
|
* @constructor
|
||||||
* @static
|
* @static
|
||||||
* @example
|
* @example
|
||||||
|
@ -846,9 +846,9 @@ var ServicesBitfield = exports.ServicesBitfield = objectAssign(Bitfield(64), {
|
||||||
/**
|
/**
|
||||||
* Pubkey features bitfield (MSB 0).
|
* Pubkey features bitfield (MSB 0).
|
||||||
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Pubkey_bitfield_features}
|
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Pubkey_bitfield_features}
|
||||||
* @param {?Buffer} buf - A 4-byte bitfield buffer (will be created if
|
* @param {Buffer=} buf - A 4-byte bitfield buffer (will be created if
|
||||||
* not provided or will be copied if `opts.copy` is `true`)
|
* not provided or will be copied if `opts.copy` is `true`)
|
||||||
* @param {?Object} opts - Options
|
* @param {Object=} opts - Options
|
||||||
* @constructor
|
* @constructor
|
||||||
* @example
|
* @example
|
||||||
* var PubkeyBitfield = require("bitmessage").structs.PubkeyBitfield;
|
* var PubkeyBitfield = require("bitmessage").structs.PubkeyBitfield;
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
"browser": {
|
"browser": {
|
||||||
"./lib/platform.js": "./lib/platform.browser.js",
|
"./lib/platform.js": "./lib/platform.browser.js",
|
||||||
"./lib/net/tcp.js": "./lib/net/tcp.browser.js",
|
"./lib/net/tcp.js": "./lib/net/tcp.browser.js",
|
||||||
"./lib/net/ws.js": "./lib/net/ws.browser.js",
|
"./lib/net/ws.js": "./lib/net/ws.browser.js"
|
||||||
"./lib/net/webrtc.js": "./lib/net/webrtc.browser.js"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "node-gyp rebuild || exit 0",
|
"install": "node-gyp rebuild || exit 0",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user