/** * Type representing an email address as a string. * * @semanticType * @semanticTopic email * @semanticTopic contact * @semanticTopic string */ export type EmailAddress = string; /** * Interface representing a pair of a name and an email address. */ export interface NameEmailPair { name?: string; email: EmailAddress; } /** * Type representing an email participant with a name and email address. * Alias for NameEmailPair for semantic clarity in email-related contexts. */ export type EmailParticipant = NameEmailPair; /** * Email participant string. Starts with the email, followed by the name if available. * * @semanticType * @semanticTopic email * @semanticTopic contact * @semanticTopic string */ export type EmailParticipantString = string; /** * Converts an EmailParticipant object to a formatted string representation. * The format is: "name" or "" if no name is provided. * * @param participant - The email participant to convert. * @returns A formatted string representation of the participant. * * @dbxUtil * @dbxUtilCategory contact * @dbxUtilTags email, participant, convert, format, serialize, name * @dbxUtilRelated convert-email-participant-string-to-participant, coerce-to-email-participants */ export declare function convertParticipantToEmailParticipantString(participant: EmailParticipant): EmailParticipantString; /** * Converts a formatted participant string into an EmailParticipant object. * Parses strings in the format "name" or "". * * @param participantString - Serialized participant in `name` or `` form. * @returns Parsed participant pairing the optional display name with the extracted address. * * @dbxUtil * @dbxUtilCategory contact * @dbxUtilTags email, participant, parse, deserialize, name, address * @dbxUtilRelated convert-participant-to-email-participant-string, coerce-to-email-participants */ export declare function convertEmailParticipantStringToParticipant(participantString: EmailParticipantString): EmailParticipant; /** * Combines an array of EmailParticipants with an array of email addresses. * Email addresses that don't already exist in the participants array are converted to EmailParticipant objects. * * @param options - Object containing participants and/or emails arrays. * @param options.participants - Array of existing EmailParticipant objects. * @param options.emails - Array of email addresses to include. * @returns A combined array of EmailParticipant objects. * * @dbxUtil * @dbxUtilCategory contact * @dbxUtilTags email, participant, merge, combine, dedupe, coerce, normalize * @dbxUtilRelated convert-participant-to-email-participant-string, convert-email-participant-string-to-participant */ export declare function coerceToEmailParticipants({ participants, emails }: { participants?: EmailParticipant[]; emails?: EmailAddress[]; }): EmailParticipant[];