-
-
Save whoisryosuke/152c0f84bfebae046ad5aa56d30a73ac to your computer and use it in GitHub Desktop.
JSDoc/Documentation.js examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A success callback for {@link ResultProvider} that receives the result from | |
* the {@link documents#probe}. | |
* @callback documents#probeResult | |
* @since 1.0 | |
* @param {documents.DocumentDescriptor} document - a sparse document descriptor with an exists | |
* property that identifies whether the document exists | |
*/ | |
/** | |
* Probes whether a document exists; takes a configuration | |
* object with the following named parameters or, as a shortcut, | |
* a uri string. | |
* @method documents#probe | |
* @since 1.0 | |
* @param {string} uri - the uri for the database document | |
* @returns {ResultProvider} an object whose result() function takes | |
* a {@link documents#probeResult} success callback. | |
*/ | |
Documents.prototype.probe = function probeDocument() { | |
return probeDocumentsImpl.call(this, false, mlutil.asArray.apply(null, arguments)); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A {@link ChildOfParent} extends {@link Parent} with functionality | |
* specific to… | |
* | |
* @class ChildOfParent | |
* @augments Parent | |
* @function | |
* @param {Object} thing - Factory constructor input | |
* @returns {ChildOfParent} - A new {@link ChildOfParent} | |
* @throws {TypeError} - If `thing` is the wrong type | |
*/ | |
function ChildOfParent(thing) { | |
if(!(thing instanceof Object)) { | |
throw new TypeError('Can only wrap an Object'); | |
} | |
if(!this) { return new ChildOfParent(thing); } | |
return Parent.call(this, thing); | |
} | |
// @function is needed to make it a static constructor, i.e. without `new` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Description goes here | |
* @typedef {object} ns.Type | |
* @since 1.0 | |
* @property {string} param - descrip | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment