Skip to content

Commit

Permalink
updated component to work correctly with generated d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jannikac committed Apr 12, 2024
1 parent 4f7cb1a commit 822b5c0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/ical/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ const COMPONENT_INDEX = 2;
* properties.
*
* @class
* @alias ICAL.Component
*/
class Component {
/**
* Create an {@link ICAL.Component} by parsing the passed iCalendar string.
* Create an {@link Component} by parsing the passed iCalendar string.
*
* @param {String} str The iCalendar string to parse
*/
Expand All @@ -31,11 +30,11 @@ class Component {
}

/**
* Creates a new ICAL.Component instance.
* Creates a new Component instance.
*
* @param {Array|String} jCal Raw jCal component data OR name of new
* component
* @param {ICAL.Component} parent Parent component to associate
* @param {Component} parent Parent component to associate
*/
constructor(jCal, parent) {
if (typeof(jCal) === 'string') {
Expand Down Expand Up @@ -143,7 +142,7 @@ class Component {
* Finds first sub component, optionally filtered by name.
*
* @param {String=} name Optional name to filter by
* @return {?ICAL.Component} The found subcomponent
* @return {?Component} The found subcomponent
*/
getFirstSubcomponent(name) {
if (name) {
Expand Down Expand Up @@ -171,7 +170,7 @@ class Component {
* Finds all sub components, optionally filtering by name.
*
* @param {String=} name Optional name to filter by
* @return {ICAL.Component[]} The found sub components
* @return {Component[]} The found sub components
*/
getAllSubcomponents(name) {
let jCalLen = this.jCal[COMPONENT_INDEX].length;
Expand Down Expand Up @@ -359,8 +358,8 @@ class Component {
/**
* Adds a single sub component.
*
* @param {ICAL.Component} component The component to add
* @return {ICAL.Component} The passed in component
* @param {Component} component The component to add
* @return {Component} The passed in component
*/
addSubcomponent(component) {
if (!this._components) {
Expand All @@ -383,7 +382,7 @@ class Component {
* Removes a single component by name or the instance of a specific
* component.
*
* @param {ICAL.Component|String} nameOrComp Name of component, or component
* @param {Component|String} nameOrComp Name of component, or component
* @return {Boolean} True when comp is removed
*/
removeSubcomponent(nameOrComp) {
Expand Down

0 comments on commit 822b5c0

Please sign in to comment.