import { FormState, SubmitOptions, SubscribeResult } from '../types'; export declare const NewsletterErrorCode: { /** The email address is already subscribed to the newsletter */ readonly ALREADY_SUBSCRIBED: "ALREADY_SUBSCRIBED"; /** The request was malformed, e.g. a missing email or an invalid newsletter id */ readonly INVALID_REQUEST: "INVALID_REQUEST"; /** The page origin is not in the newsletter's list of allowed domains */ readonly ORIGIN_NOT_ALLOWED: "ORIGIN_NOT_ALLOWED"; /** No newsletter exists with the given id */ readonly NEWSLETTER_NOT_FOUND: "NEWSLETTER_NOT_FOUND"; /** Any other error, e.g. a server or network error */ readonly UNKNOWN: "UNKNOWN"; }; export type NewsletterErrorCode = typeof NewsletterErrorCode[keyof typeof NewsletterErrorCode]; export declare class NewsletterSubscriptionError extends Error { /** Numeric error code from the API, -1 if none was given */ errorCode: number; /** HTTP status of the response, 0 if the request was rejected before it was sent */ status: number; code: NewsletterErrorCode; constructor(message: string, errorCode: number, status: number, code?: NewsletterErrorCode); get isAlreadySubscribed(): boolean; } export declare function isAlreadySubscribedError(error: unknown): error is NewsletterSubscriptionError; export declare function submitSubscription(newsletterId: string, payload: FormState, options?: SubmitOptions): Promise;