Skip to content

Commit

Permalink
add: jsdoc comments on Blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
benchambule committed Aug 24, 2024
1 parent d0296be commit b07fa44
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class Blueprint {
__infos = Object.create(null);
__forms = Object.create(null);

/**
*
* @param {string} location
* @param {Message|Message} result
* @returns {Blueprint}
*/
info(location, result){
if(typeof location !== "string" || !location){
throw new Error("location must be a non-empty string");
Expand All @@ -49,18 +55,36 @@ class Blueprint {
throw new Error("func must be a function or Message");
}

/**
*
* @param {string} location
* @param {Message|Message} result
* @returns {Blueprint}
*/
get(location, result){
this.info(location, result);

return this;
}

/**
*
* @param {string} location
* @param {Message|Message} result
* @returns {Blueprint}
*/
information(location, result){
this.info(location, result);

return this;
}

/**
*
* @param {string} location
* @param {Message|Message} result
* @returns {Blueprint}
*/
form(location, result){
if(typeof location !== "string" || !location){
throw new Error("location must be a non-empty string");
Expand All @@ -74,25 +98,45 @@ class Blueprint {
throw new Error("result must be a function or Message");
}

/**
*
* @param {string} location
* @param {Message|Function} result
* @returns {Blueprint}
*/
post(location, result){
this.form(location, result);

return this;
}

/**
*
* @param {string} location
* @param {Message|Function} info
* @param {Message|Function} proc
* @returns {Blueprint}
*/
at(location, info, proc){
this.info(location, info);
this.form(location, proc);

return this;
}

/**
*
* @returns {object}
*/
get_forms(){
return this.__forms;
}

/**
*
* @returns {object}
*/
get_infos(){
console.log("get_infos");
return this.__infos;
}
}
Expand Down

0 comments on commit b07fa44

Please sign in to comment.