Class Property

Provides a layer on top of the raw jCal object for manipulating a single property, with its parameters and value.

Alias

ICAL.Property

Hierarchy

  • Property

Constructors

  • Creates a new ICAL.Property instance.

    It is important to note that mutations done in the wrapper directly mutate the jCal object used to initialize.

    Can also be used to create new properties by passing the name of the property (as a String).

    Parameters

    • jCal: string | any[]

      Raw jCal representation OR the new name of the property

    • Optional parent: Component

      Parent component

    Returns Property

Properties

_parent: null | Component
_values?: unknown[]
isDecorated?: boolean
isMultiValue?: boolean
isStructuredValue?: boolean
jCal: any[]

Accessors

  • get _designSet(): DesignSet
  • The design set for this property, e.g. icalendar vs vcard

    Returns DesignSet

  • get name(): string
  • The name of this property, in lowercase.

    Returns string

  • get type(): string
  • The value type for this property

    Returns string

Methods

  • Private

    Decorate a single value, returning its wrapped object. This is used by the hydrate function to actually wrap the value.

    Parameters

    • value: any

      The value to decorate

    Returns any

    The decorated value

  • Private

    Hydrate a single value. The act of hydrating means turning the raw jCal value into a potentially wrapped object, for example ICAL.Time.

    Parameters

    • index: number

      The index of the value to hydrate

    Returns any

    The decorated value.

  • Private

    Sets the value at the given index while also hydrating it. The passed value can either be a decorated or undecorated value.

    Parameters

    • value: any

      The value to set

    • index: number

      The index to set it at

    Returns void

  • Private

    Undecorate a single value, returning its raw jCal data.

    Parameters

    • value: any

      The value to undecorate

    Returns any

    The undecorated value

  • Private

    Updates the type metadata from the current jCal type and design set.

    Returns void

  • Get the default type based on this property's name.

    Returns string

    The default type for this property

  • Gets first parameter on the property.

    Parameters

    • name: string

      Parameter name (lowercase)

    Returns undefined | string

    Parameter value

  • Gets a parameter on the property.

    Type Parameters

    • T = string | any[]

    Parameters

    • name: string

      Parameter name (lowercase)

    Returns undefined | T

    Parameter value

  • Gets all values on the property.

    NOTE: this creates an array during each call.

    Returns any[]

    List of values

  • Removes all values from this property

    Returns void

  • Removes a parameter

    Parameters

    • name: string

      The parameter name

    Returns void

  • Sets type of property and clears out any existing values of the current type.

    Parameters

    • type: string

      New iCAL type (see design.*.values)

    Returns void

  • Sets a parameter on the property.

    Parameters

    • name: string

      The parameter name

    • value: string | any[]

      The parameter value

    Returns void

  • Sets the current value of the property. If this is a multi-value property, all other values will be removed.

    Parameters

    • value: null | string | Record<string, any>

      New property value.

    Returns void

  • Sets the values of the property. Will overwrite the existing values. This can only be used for multi-value properties.

    Parameters

    • values: any[]

      An array of values

    Returns void

  • The string representation of this component.

    Returns string

  • Returns the Object representation of this component. The returned object is a live jCal object and should be cloned if modified.

    Returns Record<string, any>

  • Create an ICAL.Property by parsing the passed iCalendar string.

    Parameters

    • str: string

      The iCalendar string to parse

    • designSet: DesignSet

      The design data to use for this property

    Returns Property

    The created iCalendar property

Generated using TypeDoc