refactor: jsdoc in utils & minor changes (#1377)

* refactor: jsdoc in utils & minor changes

* chore: jsdoc Card class

* chore: jsdoc for getStyles
This commit is contained in:
Anurag Hazra
2021-10-10 20:41:40 +05:30
committed by GitHub
parent d0ab2ff030
commit 02ebd3243b
7 changed files with 143 additions and 41 deletions
+25
View File
@@ -2,6 +2,16 @@ const { getAnimations } = require("../getStyles");
const { flexLayout, encodeHTML } = require("../common/utils");
class Card {
/**
* @param {object} args
* @param {number?=} args.width
* @param {number?=} args.height
* @param {number?=} args.border_radius
* @param {string?=} args.customTitle
* @param {string?=} args.defaultTitle
* @param {string?=} args.titlePrefixIcon
* @param {ReturnType<import('../common/utils').getCardColors>?=} args.colors
*/
constructor({
width = 100,
height = 100,
@@ -38,14 +48,23 @@ class Card {
this.animations = false;
}
/**
* @param {string} value
*/
setCSS(value) {
this.css = value;
}
/**
* @param {boolean} value
*/
setHideBorder(value) {
this.hideBorder = value;
}
/**
* @param {boolean} value
*/
setHideTitle(value) {
this.hideTitle = value;
if (value) {
@@ -53,6 +72,9 @@ class Card {
}
}
/**
* @param {string} text
*/
setTitle(text) {
this.title = text;
}
@@ -114,6 +136,9 @@ class Card {
: "";
}
/**
* @param {string} body
*/
render(body) {
return `
<svg