Class ComponentParser

The ComponentParser is used to process a String or jCal Object, firing callbacks for various found components, as well as completion.

Example

var options = {
// when false no events will be emitted for type
parseEvent: true,
parseTimezone: true
};

var parser = new ICAL.ComponentParser(options);

parser.onevent(eventComponent) {
//...
}

// ontimezone, etc...

parser.oncomplete = function() {

};

parser.process(stringOrComponent);

Hierarchy

  • ComponentParser

Constructors

  • Creates a new ICAL.ComponentParser instance.

    Parameters

    • options: {
          parseEvent?: boolean;
          parseTimezone?: boolean;
      } = {}

      Component parser options

      • Optional parseEvent?: boolean

        Whether events should be parsed

      • Optional parseTimezone?: boolean

        Whether timezones should be parsed

    Returns ComponentParser

Properties

oncomplete: (() => void) = ...

Type declaration

    • (): void
    • Fired when parsing is complete

      Returns void

parseEvent: boolean = true

When true, parse events

parseTimezone: boolean = true

When true, parse timezones

Methods

  • Fired if an error occurs during parsing.

    Parameters

    • err: Error

      details of error

    Returns void

  • Fired when a top level component (VEVENT) is found.

    Parameters

    • component: Event

      Top level component

    Returns void

  • Fired when a top level component (VTIMEZONE) is found

    Parameters

    Returns void

  • Process a string or parse ical object. This function itself will return nothing but will start the parsing process.

    Events must be registered prior to calling this method.

    Parameters

    • ical: string | Component | ParseComponent

      The component to process, either in its final form, as a jCal Object, or string representation

    Returns void

Generated using TypeDoc