export interface MXrouteApiCredentials { server: string; username: string; apiKey: string; } interface FetchResponse { ok: boolean; status: number; statusText?: string; headers: { get(name: string): string | null; }; text(): Promise; } type FetchLike = (url: string, init: Record) => Promise; interface ClientOptions { fetch?: FetchLike; timeoutMs?: number; sleep?: (milliseconds: number) => Promise; maxReadRetries?: number; now?: () => number; writeIntervalMs?: number; readLimitPerMinute?: number; } interface ApiErrorBody { error?: { code?: string; message?: string; field?: string; }; } export declare class MXrouteApiError extends Error { readonly status: number; readonly code?: string; readonly field?: string; readonly retryAfter?: number; constructor(response: FetchResponse, body?: ApiErrorBody); } export interface MXrouteForwarder { alias: string; email?: string; destinations: string[]; } export interface MXrouteEmailAccount { username: string; email?: string; quota?: number; usage?: number; limit?: number; sent?: number; suspended?: boolean; } export interface CreateEmailAccountInput { username: string; password: string; quota?: number; limit?: number; } export interface UpdateEmailAccountInput { password?: string; quota?: number; limit?: number; } export interface MXrouteDomain { domain?: string; mail_hosting?: boolean; ssl_enabled?: boolean; pointers?: string[]; } export interface MXrouteDomainPointer { pointer: string; type?: 'alias' | 'redirect'; target?: string; } export interface MXrouteCatchAll { type: 'fail' | 'blackhole' | 'address'; address?: string | null; description?: string; } export interface MXrouteDnsInfo { mx_records?: Array<{ priority?: number; hostname?: string; description?: string; }>; spf?: { type?: string; name?: string; value?: string; }; dkim?: { type?: string; name?: string; value?: string; } | null; verification?: { type?: string; name?: string; value?: string; description?: string; } | null; } export interface MXrouteQuota { username?: string; total_used?: number; total_limit?: number; percent_used?: number; breakdown?: Record; grace_period?: { days_remaining?: number; deadline?: string; } | null; updated_at?: string; } export interface MXrouteApiClient { listDomains(): Promise; getDomain(domain: string): Promise; listEmailAccounts(domain: string): Promise; getEmailAccount(domain: string, username: string): Promise; createEmailAccount(domain: string, input: CreateEmailAccountInput): Promise; updateEmailAccount(domain: string, username: string, input: UpdateEmailAccountInput): Promise; deleteEmailAccount(domain: string, username: string): Promise; listForwarders(domain: string): Promise; createForwarder(domain: string, alias: string, destinations: string[]): Promise; deleteForwarder(domain: string, alias: string): Promise; listDomainPointers(domain: string): Promise; createDomainPointer(domain: string, pointer: string): Promise; deleteDomainPointer(domain: string, pointer: string): Promise; getCatchAll(domain: string): Promise; updateCatchAll(domain: string, catchAll: MXrouteCatchAll): Promise; getDnsInfo(domain: string): Promise; getQuota(): Promise; } export declare function createMXrouteApiClient(credentials: MXrouteApiCredentials, options?: ClientOptions): MXrouteApiClient; export {};