import type { ClientMessage, ContactComponent } from "../types"; export type BuiltContact = { name: Name; birthday?: string; org?: Organization; addresses?: Address[]; phones?: Phone[]; emails?: Email[]; urls?: Url[]; [key: string]: any; }; /** * Contacts API object * * @group Contacts */ export declare class Contacts implements ClientMessage { /** * The contacts of the message */ component: BuiltContact[]; get _type(): "contacts"; /** * Create a Contacts object for the API * * @param contact - Array of contact's components * @throws If contact is not provided * @throws If contact contains multiple of the same components and _many is set to false (for example, Name, Birthday and Organization) */ constructor(...contact: Array
[]); _build(): string; } /** * Address API object * * @group Contacts */ export declare class Address implements ContactComponent { /** * The country of the address */ country?: string; /** * The country code of the address */ country_code?: string; /** * The state of the address */ state?: string; /** * The city of the address */ city?: string; /** * The street of the address */ street?: string; /** * The zip code of the address */ zip?: string; /** * The type of the address */ type?: string; get _many(): boolean; get _type(): "addresses"; /** * Builds an address object for a contact. * A contact can contain multiple addresses objects. * * @param country - Full country name * @param country_code - Two-letter country abbreviation * @param state - State abbreviation * @param city - City name * @param street - Street number and name * @param zip - ZIP code * @param type - Address type. Standard Values: HOME, WORK */ constructor(country?: string, country_code?: string, state?: string, city?: string, street?: string, zip?: string, type?: string); _build(): this; } /** * Birthday API object * * @group Contacts */ export declare class Birthday implements ContactComponent { /** * The birthday of the contact */ birthday: string; get _many(): boolean; get _type(): "birthday"; /** * Builds a birthday object for a contact * * @param year - Year of birth (YYYY) * @param month - Month of birth (MM) * @param day - Day of birth (DD) * @throws If the year, month, or day don't have a valid length */ constructor(year: string, month: string, day: string); _build(): string; } /** * Email API object * * @group Contacts */ export declare class Email implements ContactComponent { /** * The email of the contact */ email?: string; /** * The type of the email */ type?: string; get _many(): boolean; get _type(): "emails"; /** * Builds an email object for a contact. * A contact can contain multiple emails objects. * * @param email - Email address * @param type - Email type. Standard Values: HOME, WORK */ constructor(email?: string, type?: string); _build(): this; } /** * Name API object * * @group Contacts */ export declare class Name implements ContactComponent { /** * The formatted name of the contact */ formatted_name: string; /** * The first name of the contact */ first_name?: string; /** * The last name of the contact */ last_name?: string; /** * The middle name of the contact */ middle_name?: string; /** * The suffix of the contact */ suffix?: string; /** * The prefix of the contact */ prefix?: string; get _many(): boolean; get _type(): "name"; /** * Builds a name object for a contact, required for contacts. * The object requires a formatted_name and at least another property. * * @param formatted_name - Full name, as it normally appears * @param first_name - First name * @param last_name - Last name * @param middle_name - Middle name * @param suffix - Name suffix * @param prefix - Name prefix * @throws If no other component apart from formatted_name is defined */ constructor(formatted_name: string, first_name?: string, last_name?: string, middle_name?: string, suffix?: string, prefix?: string); _build(): this; } /** * Organization API object * * @group Contacts */ export declare class Organization implements ContactComponent { /** * The company of the contact */ company?: string; /** * The department of the contact */ department?: string; /** * The title of the contact */ title?: string; get _many(): boolean; get _type(): "org"; /** * Builds an organization object for a contact * * @param company - Name of the contact's company * @param department - Name of the contact's department * @param title - Contact's business title */ constructor(company?: string, department?: string, title?: string); _build(): this; } /** * Phone API object * * @group Contacts */ export declare class Phone implements ContactComponent { /** * The phone number of the contact */ phone?: string; /** * The type of the phone number */ type?: string; /** * The WhatsApp ID of the contact */ wa_id?: string; get _many(): boolean; get _type(): "phones"; /** * Builds a phone object for a contact. * A contact can contain multiple phones objects. * * @param phone - Phone number, automatically populated with the wa_id value as a formatted phone number * @param type - Phone type. Standard Values: CELL, MAIN, IPHONE, HOME, WORK * @param wa_id - WhatsApp ID */ constructor(phone?: string, type?: string, wa_id?: string); _build(): this; } /** * Url API object * * @group Contacts */ export declare class Url implements ContactComponent { /** * The URL of the contact */ url?: string; /** * The type of the URL */ type?: string; get _many(): boolean; get _type(): "urls"; /** * Builds an url object for a contact. * A contact can contain multiple urls objects. * * @param url - URL * @param type - URL type. Standard Values: HOME, WORK */ constructor(url?: string, type?: string); _build(): this; } //# sourceMappingURL=contacts.d.ts.map