import { ContactFormData, EmailSubscriptionOptions } from '../types'; import { EventService } from './eventService'; import { ApiResponse } from '@towncryerio/towncryer-js-api-client'; /** * Utility Service * * Provides utility operations for common tasks in the Towncryer SDK, such as * handling contact form submissions and email subscriptions, by publishing * events to the Towncryer platform through the EventService. */ export declare class UtilityService { private eventService; constructor(eventService: EventService); /** * Submit a contact form to Towncryer * * Processes a contact form submission by creating an event with the form data * and publishing it via the EventService. This allows the Towncryer platform * to process the submission according to configured workflows. * * @param formData - Object containing contact form data * @returns Promise resolving to an ApiResponse * @throws TowncryerAPIError if the event publishing fails */ submitContactForm(formData: ContactFormData): Promise; /** * Subscribe an email address to communications * * Creates and publishes an email subscription event to the Towncryer platform. * The event includes customer data derived from the provided email and options, * along with subscription preferences and metadata. * * @param email - Email address to subscribe * @param options - Optional subscription configuration with additional details * @returns Promise resolving to an ApiResponse * @throws TowncryerAPIError if the event publishing fails */ subscribeToEmails(email: string, options?: EmailSubscriptionOptions): Promise; }