Skip to content

Commit

Permalink
docs: Fix spec objects parameter definitions (#2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Feb 16, 2024
1 parent ff78b51 commit 4378173
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 25 deletions.
14 changes: 10 additions & 4 deletions lib/shim/specs/class.js
Expand Up @@ -7,6 +7,15 @@

const WrapSpec = require('./wrap')

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} ClassWrapSpecParams
* @mixes WrapSpecParams
* @property {boolean} [es6]
* @property {function} [pre]
* @property {function} [post]
*/

/**
* Pre/post constructor execution hook for wrapping classes.
*
Expand Down Expand Up @@ -74,10 +83,7 @@ class ClassWrapSpec extends WrapSpec {

/* eslint-disable jsdoc/require-param-description */
/**
* @param {object} params
* @param {boolean} [params.es6]
* @param {function} [params.pre]
* @param {function} [params.post]
* @param {ClassWrapSpecParams} params
*/
constructor(params) {
super(params)
Expand Down
2 changes: 1 addition & 1 deletion lib/shim/specs/message-subscribe.js
Expand Up @@ -10,7 +10,7 @@ const MessageSpec = require('./message')
/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} MessageSubscribeSpecParams
* @augments MessageSpecParams
* @mixes MessageSpecParams
* @property {number|null} [consumer]
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/shim/specs/message.js
Expand Up @@ -10,7 +10,7 @@ const RecorderSpec = require('./recorder')
/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} MessageSpecParams
* @augments RecorderSpecParams
* @mixes RecorderSpecParams
* @property {number|string} [destinationName]
* @property {string|null} [destinationType]
* @property {Object<string, string>|null} [headers]
Expand Down
12 changes: 9 additions & 3 deletions lib/shim/specs/middleware-mounter.js
Expand Up @@ -40,6 +40,14 @@ const MiddlewareSpec = require('./middleware')
* @see WebFrameworkShim#recordParamware
*/

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} MiddlewareMounterSpecParams
* @mixes MiddlewareSpecParams
* @property {RouteParserFunction|string|number|null} [route]
* @property {MiddlewareWrapperFunction} [wrapper]
*/

class MiddlewareMounterSpec extends MiddlewareSpec {
/**
* Indicates which argument specifies the mounting path for the other
Expand All @@ -62,9 +70,7 @@ class MiddlewareMounterSpec extends MiddlewareSpec {

/* eslint-disable jsdoc/require-param-description */
/**
* @param {object} params
* @param {RouteParserFunction|string|number|null} [params.route]
* @param {MiddlewareWrapperFunction} [params.wrapper]
* @param {MiddlewareMounterSpecParams} params
*/
constructor(params) {
super(params)
Expand Down
3 changes: 2 additions & 1 deletion lib/shim/specs/middleware.js
Expand Up @@ -45,7 +45,7 @@ const RecorderSpec = require('./recorder')
/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} MiddlewareSpecParams
* @augments RecorderSpecParams
* @mixes RecorderSpecParams
* @property {boolean} [appendPath]
* @property {number|RouteNextFunction} [next]
* @property {RouteParameterFunction|null} [params]
Expand Down Expand Up @@ -121,6 +121,7 @@ class MiddlewareSpec extends RecorderSpec {
*/
type

/* eslint-disable jsdoc/require-param-description */
/**
* @param {MiddlewareSpecParams} constructorParams
*/
Expand Down
12 changes: 9 additions & 3 deletions lib/shim/specs/operation.js
Expand Up @@ -23,6 +23,14 @@ const RecorderSpec = require('./recorder')
* The name of the database being queried or operated on.
*/

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} OperationSpecParams
* @mixes RecorderSpecParams
* @property {DatastoreParameters|null} [parameters]
* @property {boolean} [record]
*/

/**
* Spec that describes an operation, e.g. connecting to a database.
*/
Expand All @@ -44,9 +52,7 @@ class OperationSpec extends RecorderSpec {

/* eslint-disable jsdoc/require-param-description */
/**
* @param {object} params
* @param {DatastoreParameters|null} [params.parameters]
* @param {boolean} [params.record]
* @param {OperationSpecParams} params
*/
constructor(params) {
super(params)
Expand Down
10 changes: 8 additions & 2 deletions lib/shim/specs/query.js
Expand Up @@ -18,6 +18,13 @@ const OperationSpec = require('./operation')
* @returns {string} The query string from the arguments list.
*/

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} QuerySpecParams
* @mixes OperationSpecParams
* @property {number|string|QueryFunction} [query]
*/

/**
* Spec that describes a database query operation.
*/
Expand All @@ -34,8 +41,7 @@ class QuerySpec extends OperationSpec {

/* eslint-disable jsdoc/require-param-description */
/**
* @param {object} params
* @param {number|string|QueryFunction} [params.query]
* @param {QuerySpecParams} params
*/
constructor(params) {
super(params)
Expand Down
6 changes: 5 additions & 1 deletion lib/shim/specs/recorder.js
Expand Up @@ -10,7 +10,7 @@ const WrapSpec = require('./wrap')
/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} RecorderSpecParams
* @augments SegmentSpecParams
* @mixes SegmentSpecParams
* @property {SpecAfterFunction} [after]
* @property {number|CallbackBindFunction} [callback]
* @property {boolean} [callbackRequired]
Expand Down Expand Up @@ -108,6 +108,10 @@ class RecorderSpec extends WrapSpec {
*/
stream

/* eslint-disable jsdoc/require-param-description */
/**
* @param {RecorderSpecParams} params
*/
constructor(params) {
super(params)

Expand Down
7 changes: 4 additions & 3 deletions lib/shim/specs/render.js
Expand Up @@ -10,8 +10,8 @@ const { ARG_INDEXES } = require('./constants')

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} RecorderSpecParams
* @augments RecorderSpecParams
* @typedef {object} RenderSpecParams
* @mixes RecorderSpecParams
* @property {number} [view]
*/

Expand All @@ -29,8 +29,9 @@ class RenderSpec extends RecorderSpec {
*/
view

/* eslint-disable jsdoc/require-param-description */
/**
* @param {RecorderSpecParams} params
* @param {RenderSpecParams} params
*/
constructor(params) {
super(params)
Expand Down
12 changes: 9 additions & 3 deletions lib/shim/specs/transaction.js
Expand Up @@ -7,6 +7,14 @@

const SegmentSpec = require('./segment')

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} TransactionSpecParams
* @mixes SegmentSpecParams
* @property {boolean} [nest]
* @property {string} [type]
*/

/**
* Spec that describes the type of agent transaction to be created by the
* function being wrapped by {@link TransactionShim.bindCreateTransaction}.
Expand All @@ -33,9 +41,7 @@ class TransactionSpec extends SegmentSpec {

/* eslint-disable jsdoc/require-param-description */
/**
* @param {object} params
* @param {boolean} [params.nest]
* @param {string} [params.type]
* @param {TransactionSpecParams} params
*/
constructor(params) {
super(params)
Expand Down
12 changes: 9 additions & 3 deletions lib/shim/specs/wrap.js
Expand Up @@ -7,6 +7,14 @@

const SegmentSpec = require('./segment')

/* eslint-disable jsdoc/require-property-description */
/**
* @typedef {object} WrapSpecParams
* @mixes SegmentSpecParams
* @property {boolean} [matchArity]
* @property {function} [wrapper]
*/

/**
* Provides configuration for wrapping functions.
*
Expand Down Expand Up @@ -42,9 +50,7 @@ class WrapSpec extends SegmentSpec {
* wrapper. Otherwise, the parameters must be an object with a `wrapper`
* property set to the function that should be the wrapper.
*
* @param {object|function} params
* @param {boolean} [params.matchArity]
* @param {function} [params.wrapper]
* @param {WrapSpecParams|function} params
*/
constructor(params) {
super(params)
Expand Down

0 comments on commit 4378173

Please sign in to comment.