import { CalendarDateOrTime } from '../date'; import { CalendarDuration } from '../duration'; import { AlarmTriggerRelationship, CalendarUserType, Encoding, FreeBusyTimeType, ParticipationRole, ParticipationStatus, RecurrenceIdentifierRange, RelationshipType, RsvpExpectation } from './parameter'; import { AllowedValueType, KnownValueType } from './valueType'; /** * Represents a property of a calendar component as described by RFC 5545 in * Section 3.5. */ export declare class Property { private _name; get name(): string; set name(value: string); value: string; private _parameters; get parameters(): Map; constructor(name: string, value: string, params?: { [k: string]: string | string[]; }); static fromDate(name: string, value: CalendarDateOrTime): Property; static fromDuration(name: string, value: CalendarDuration): Property; /** * Get the value of this property, converted into the appropriate class if possible. * @returns The value as a string or appropriate class. */ getValue(): string | CalendarDateOrTime | CalendarDuration; /** * Set the value of this property and change the value type if a class is used. * @param value The new value as a string or class. */ setValue(value: string | CalendarDateOrTime | CalendarDuration): void; setParameter(name: string, value: string | string[]): void; /** * Get the values of a parameter on this property. * @param name The name of the parameter to get the values of. * @returns The values of the parameter, or undefined if the parameter is unset. */ getParameter(name: string): string[] | undefined; /** * Get the first value of a parameter. * @param name The name of the parameter to get the value of. * @returns The first value of the parameter if the parameter is set, else undefined. */ getFirstParameter(name: string): string | undefined; /** * Remove all values of a parameter. * @param name The name of the parameter to remove. */ removeParameter(name: string): void; /** * Check whether this property has a parameter. * @param name The parameter name to check. * @returns Whether the parameter is present. */ hasParameter(name: string): boolean; /** * Serialize this property into a contennt line. * @returns The serialized content line. */ serialize(): string; /** * Set the value type of this property. * @param valueType The new value of the VALUE parameter. */ setValueType(valueType: AllowedValueType): void; /** * Remove the explicit value type of this property. * * Note that this will not remove the inferred value type of this property. */ removeValueType(): void; /** * Get the value type of this property. If the `VALUE` parameter is unset * the type will be inferred based on {@link name} or default to 'TEXT' if * the property is unknown. * @returns The value type of this property. */ getValueType(): AllowedValueType; /** * Get the value type of this property. * @returns The value type of this property, or `undefined` if unset. */ getExplicitValueType(): AllowedValueType | undefined; /** * Get the default value type for this property. * @returns The default value type based on the name of this property. */ getDefaultValueType(): KnownValueType; /** * Check whether this property has an explicit value type set. * @returns Whether this property has the VALUE parameter. */ hasValueType(): boolean; /** * Set the `ALTREP` parameter for this property. * @param uri A URI that points to an alternate representation for a textual property value. */ setAlternateTextRepresentation(uri: string): void; /** * Get the `ALTREP` parameter for this property. * @returns The value of the `ALTREP` parameter, or undefined if unset. */ getAlternateTextRepresentation(): string | undefined; /** * Remove the `ALTREP` parameter for this property. */ removeAlternateTextRepresentation(): void; /** * Set the `CN` parameter for this property. * @param commonName The common name to be associated with the calendar user specified by this property. */ setCommonName(commonName: string): void; /** * Get the `CN` parameter for this property. * @returns The value of the `CN` parameter, or undefined if unset. */ getCommonName(): string | undefined; /** * Remove the `CN` parameter for this property. */ removeCommonName(): void; /** * Set the `CUTYPE` parameter for this property. * @param userType The type of calendar user specified by the property. */ setCalendarUserType(userType: CalendarUserType): void; /** * Get the `CUTYPE` parameter for this property. * @returns The value of the `CUTYPE` parameter, or undefined if unset. */ getCalendarUserType(): CalendarUserType | undefined; /** * Remove the `CUTYPE` parameter for this property. */ removeCalendarUserType(): void; /** * Set the `DELEGATED-FROM` parameter for this property. * @param delegators Calendar users whom have been delegated participation in a group-scheduled event or to-do by the calendar user specified by the property. */ setDelegators(...delegators: string[]): void; /** * Get the `DELEGATED-FROM` parameter for this property. * @returns The value of the `DELEGATED-FROM` parameter, or undefined if unset. */ getDelegators(): string[] | undefined; /** * Remove the `DELEGATED-FROM` parameter for this property. */ removeDelegators(): void; /** * Set the `DIR` parameter for this property. * @param uri A directory entry associated with the calendar user specified by this property. */ setDirectoryEntryReference(uri: string): void; /** * Get the `DIR` parameter for this property. * @returns The value of the `DIR` parameter, or undefined if unset. */ getDirectoryEntryReference(): string | undefined; /** * Remove the `DIR` parameter for this property. */ removeDirectoryEntryReference(): void; /** * Set the `ENCODING` parameter for this property. * @param encoding An alternate inline encoding for this property value. */ setEncoding(encoding: Encoding): void; /** * Get the `ENCODING` parameter for this property. * @returns The value of the `ENCODING` parameter, or undefined if unset. */ getEncoding(): Encoding | undefined; /** * Remove the `ENCODING` parameter for this property. */ removeEncoding(): void; /** * Set the `FMTTYPE` parameter for this property. * @param contentType The content type of a referenced object as "type/subtype". * @example * property.setFormatType('application/msword') */ setFormatType(contentType: string): void; /** * Get the `FMTTYPE` parameter for this property. * @returns The value of the `FMTTYPE` parameter, or undefined if unset. */ getFormatType(): string | undefined; /** * Remove the `FMTTYPE` parameter for this property. */ removeFormatType(): void; /** * Set the `FBTYPE` parameter for this property. * @param freeBusy The free or busy time type. */ setFreeBusyTimeType(freeBusy: FreeBusyTimeType): void; /** * Get the `FBTYPE` parameter for this property. * @returns The value of the `FBTYPE` parameter, or undefined if unset. */ getFreeBusyTimeType(): FreeBusyTimeType | undefined; /** * Remove the `FBTYPE` parameter for this property. */ removeFreeBusyTimeType(): void; /** * Set the `LANGUAGE` parameter for this property. * @param language The language tag identifying the language of text values on this property. */ setLanguage(language: string): void; /** * Get the `LANGUAGE` parameter for this property. * @returns The value of the `LANGUAGE` parameter, or undefined if unset. */ getLanguage(): string | undefined; /** * Remove the `LANGUAGE` parameter for this property. */ removeLanguage(): void; /** * Set the `MEMBER` parameter for this property. * @param groups The group or list memberships of the calendar user specified by this property. * @example * const property = new ComponentProperty('ATTENDEE', 'mailto:user@example.org') * property.setMembership('mailto:group@example.org') */ setMembership(...groups: string[]): void; /** * Get the `MEMBER` parameter for this property. * @returns The value of the `MEMBER` parameter, or undefined if unset. */ getMembership(): string[] | undefined; /** * Remove the `MEMBER` parameter for this property. */ removeMembership(): void; /** * Set the `PARTSTAT` parameter for this property. * @param status The participation status for the calendar user specified by this property. */ setParticipationStatus(status: ParticipationStatus): void; /** * Get the `PARTSTAT` parameter for this property. * @returns The value of the `PARTSTAT` parameter, or undefined if unset. */ getParticipationStatus(): ParticipationStatus | undefined; /** * Remove the `PARTSTAT` parameter for this property. */ removeParticipationStatus(): void; /** * Set the `RANGE` parameter for this property. * @param range The effective range of recurrence instances from the instance specified by the recurrence identifier specified by this property. */ setRecurrenceIdentifierRange(range: RecurrenceIdentifierRange): void; /** * Get the `RANGE` parameter for this property. * @returns The value of the `RANGE` parameter, or undefined if unset. */ getRecurrenceIdentifierRange(): RecurrenceIdentifierRange | undefined; /** * Remove the `RANGE` parameter for this property. */ removeRecurrenceIdentifierRange(): void; /** * Set the `RELATED` parameter for this property. * @param relationship The relationship of the alarm trigger with respect to the start or end of the calendar component. */ setAlarmTriggerRelationship(relationship: AlarmTriggerRelationship): void; /** * Get the `RELATED` parameter for this property. * @returns The value of the `RELATED` parameter, or undefined if unset. */ getAlarmTriggerRelationship(): AlarmTriggerRelationship | undefined; /** * Remove the `RELATED` parameter for this property. */ removeAlarmTriggerRelationship(): void; /** * Set the `RELTYPE` parameter for this property. * @param relationship The type of hierarchical relationship associated with the calendar component specified by the property. * @example * const property = new ComponentProperty('RELATED-TO', 'vevent-uid') * property.setRelationshipType('SIBLING') */ setRelationshipType(relationship: RelationshipType): void; /** * Get the `RELTYPE` parameter for this property. * @returns The value of the `RELTYPE` parameter, or undefined if unset. */ getRelationshipType(): RelationshipType | undefined; /** * Remove the `RELTYPE` parameter for this property. */ removeRelationshipType(): void; /** * Set the `ROLE` parameter for this property. * @param role The participation role for the calendar user specified by this property. * @example * const property = new ComponentProperty('ATTENDEE', 'mailto:chair@example.org') * property.setParticipationRole('CHAIR') */ setParticipationRole(role: ParticipationRole): void; /** * Get the `ROLE` parameter for this property. * @returns The value of the `ROLE` parameter, or undefined if unset. */ getParticipationRole(): ParticipationRole | undefined; /** * Remove the `ROLE` parameter for this property. */ removeParticipationRole(): void; /** * Set the `RSVP` parameter for this property. * @param rsvp Whether there is an expectation of a favor of a reply from the calendar user specified by this property value. * @example * const property = new ComponentProperty('ATTENDEE', 'mailto:user@example.org') * property.setRsvpExpectation('TRUE') */ setRsvpExpectation(rsvp: RsvpExpectation): void; /** * Get the `RSVP` parameter for this property. * @returns The value of the `RSVP` parameter, or undefined if unset. */ getRsvpExpectation(): RsvpExpectation | undefined; /** * Remove the `RSVP` parameter for this property. */ removeRsvpExpectation(): void; /** * Set the `SENT-BY` parameter for this property. * @param sentBy The calendar user that is acting on behalf of the calendar user specified by the property. * @example * const property = new ComponentProperty('ORGANIZER', 'malto:jsmith@example.com') * property.setSentBy('mailto:sray@example.com') */ setSentBy(sentBy: string): void; /** * Get the `SENT-BY` parameter for this property. * @returns The value of the `SENT-BY` parameter, or undefined if unset. */ getSentBy(): string | undefined; /** * Remove the `SENT-BY` parameter for this property. */ removeSentBy(): void; /** * Set the `TZID` parameter for this property. * @param sentBy The identifier for the time zone definition for a time component in this property value. * @example * const property = new ComponentProperty('DTSTART', '20250101T120000') * property.setTimeZone('Europe/Stockholm') */ setTimeZone(sentBy: string): void; /** * Get the `TZID` parameter for this property. * @returns The value of the `TZID` parameter, or undefined if unset. */ getTimeZone(): string | undefined; /** * Remove the `TZID` parameter for this property. */ removeTimeZone(): void; } //# sourceMappingURL=Property.d.ts.map