import { Campaign } from '../campaign'; import * as Field from '../classes/field.js'; import { IFields, IHasFields, ModuleClass, OnInit } from '../interfaces/index.js'; export declare type IFieldNames = 'firstName' | 'lastName' | 'email' | 'emailVerify' | 'country' | 'city' | 'state' | 'street' | 'zip'; export declare type IAddMemberFieldCreators = { [key in IFieldNames]: () => Field.Class; }; export interface IBillingOptions { billingToken: string; billingMethod: IRecurlyPaymentMethod; ccType?: string; ccYear?: string; ccMonth?: string; ccFirstSix?: string; ccLastFour?: string; } export interface ICountryData { id: number; name: string; capital: string; currency: string; iso2: string; iso3: string; phoneCode: string; } export interface IStateData { id: number; name: string; countryId: number; } export declare type IRecurlyPaymentMethod = 'credit_card'; export interface IRecurlyTokenResponse { id: string; type: IRecurlyPaymentMethod; } export interface IAddMemberModuleOptions { recurly: { active: boolean; css: boolean; configure: { publicKey: string; fields: { number: { selector: string; style: { placeholder: { content: string; }; }; }; month: { selector: string; style: { placeholder: { content: string; }; }; }; year: { selector: string; style: { placeholder: { content: string; }; }; }; }; }; }; } export declare class AddMember extends ModuleClass implements OnInit, IHasFields { campaign: Campaign; static moduleName: string; defaults: { country: string; state: string; }; data: { countries: ICountryData[]; states: IStateData[]; }; /** * Map of HTML input fields. */ existingFields: IFields; fieldCreators: IAddMemberFieldCreators; constructor(campaign: Campaign); /** * Funtion called when module is ready. */ onInit(options?: Partial): Promise; /** * Load recurly library. */ loadRecurly(mergedOptions: IAddMemberModuleOptions): Promise; /** * Populates country select with available countries. */ populateCountry(): Promise; /** * Populates states with states from selected country. */ populateState(): Promise; /** * Get recurly token. */ getRecurlyToken(): Promise; /** * Performs AddMember request to API. * @param e MouseEvent on clicked submit button. */ addMember(e?: MouseEvent): Promise; addProspect(e?: MouseEvent): Promise; getBody(): { context: { app: { name: string; version: string; build: string; }; campaign: { source: string | null; medium: string | null; term: string | null; content: string | null; name: string | null; }; }; options: { addressFieldVisibility: boolean; currency: string; landingPageId: null; productSKU: string; }; person: { firstName: string | null; lastName: string | null; addressInfo: { addressType: string; street: string | null; city: string | null; state: string | null; zip: string | null; country: string | null; isPrimary: boolean; }[]; email: string | null; }; }; } export default AddMember;