import { SentlyError } from "../core/errors.js"; import type { MailOptions, SendResult, Transport, VerifyResult } from "../core/types.js"; /** SendGrid API configuration. */ export interface SendGridConfig { /** SendGrid API key (Bearer token). */ apiKey: string; } /** Error thrown when the SendGrid API returns a non-success response. */ export declare class SendGridError extends SentlyError { readonly statusCode: number; readonly apiError: unknown; /** Creates a SendGrid API error with status code and response payload. */ constructor(message: string, statusCode: number, apiError: unknown); } /** * SendGrid v3 HTTP API transport. */ export declare class SendGridTransport implements Transport { readonly provider = "sendgrid"; /** SendGrid API key for Bearer authentication. */ private readonly apiKey; /** Creates a SendGrid transport with the given API key. */ constructor(config: SendGridConfig); /** Build a SendGrid personalization for one message. */ private buildPersonalization; /** Build SendGrid content parts from text/html options. */ private buildContent; /** Map a SendGrid response to a normalized SendResult for one message. */ private toSendResult; /** Sends an email via the SendGrid v3 HTTP API. */ send(options: MailOptions): Promise; /** Send multiple messages in one request using SendGrid personalizations. */ sendBatch(messages: MailOptions[]): Promise; /** Verifies the SendGrid API key by fetching the user profile. */ verify(): Promise; }