Skip to content

Instantly share code, notes, and snippets.

@fubar
Created March 5, 2018 22:05
Show Gist options
  • Save fubar/369e8e87489611588f8687381c0be09d to your computer and use it in GitHub Desktop.
Save fubar/369e8e87489611588f8687381c0be09d to your computer and use it in GitHub Desktop.
restify: Adds type-hinting for unresolved properties and functions of restify's RestifyRequest class
const RestifyRequest = require('restify/lib/request');
/**
* The purpose of this class is to add type-hinting for unresolved properties and functions.
*
* restify's Request class is an extension of Node's http.IncomingMessage
*
* @class Request
*/
class Request extends RestifyRequest {
/** @member {Object} Request#body Requires use of the bodyParser plugin. See http://restify.com/docs/plugins-api/#bodyparser */
/** @member {Object} Request#headers */
/** @member {String} Request#method HTTP method */
/** @member {Object} Request#params Contains URL-placeholders. Query string parameters and those present in a JSON body are parsed into query and body, respectively. */
/** @member {Object} Request#query Requires use of the queryParser plugin. See http://restify.com/docs/plugins-api/#queryparser */
/** @member {String} Request#url */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment