slicejs-web-framework 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -544,6 +544,11 @@ export default class Controller {
544
544
  });
545
545
  }
546
546
 
547
+ /**
548
+ * Get a registered component by sliceId.
549
+ * @param {string} sliceId
550
+ * @returns {HTMLElement|undefined}
551
+ */
547
552
  getComponent(sliceId) {
548
553
  return this.activeComponents.get(sliceId);
549
554
  }
@@ -565,6 +570,14 @@ export default class Controller {
565
570
  return this.componentCategories.get(componentSliceId);
566
571
  }
567
572
 
573
+ /**
574
+ * Fetch component resources (html, css, styles, theme).
575
+ * @param {string} componentName
576
+ * @param {'html'|'css'|'theme'|'styles'} resourceType
577
+ * @param {string} [componentCategory]
578
+ * @param {string} [customPath]
579
+ * @returns {Promise<string>}
580
+ */
568
581
  async fetchText(componentName, resourceType, componentCategory, customPath) {
569
582
  try {
570
583
  const baseUrl = window.location.origin;
@@ -619,6 +632,12 @@ export default class Controller {
619
632
  }
620
633
  }
621
634
 
635
+ /**
636
+ * Apply props to a component using static defaults and setters.
637
+ * @param {HTMLElement} component
638
+ * @param {Object} props
639
+ * @returns {void}
640
+ */
622
641
  setComponentProps(component, props) {
623
642
  const ComponentClass = component.constructor;
624
643
  const componentName = ComponentClass.name;