import type { AutoDerivedEmailFields } from "./auto-fields.type.js"; /** * Minimal request shape required by Forge's auto-derived fields. * * Framework adapters should map their native request object to this shape. * Forge internals remain independent of Express, Fastify, etc. */ export interface MinimalRequest { ip?: string | undefined; ips?: string[] | undefined; headers: Record; socket?: { remoteAddress?: string | null | undefined; }; connection?: { remoteAddress?: string | null | undefined; }; } /** * Client IP address. * * Priority: * * 1. x-forwarded-for * 2. framework-resolved req.ip * 3. req.socket.remoteAddress * 4. req.connection.remoteAddress * * NOTE: * x-forwarded-for should only be trusted when your application is behind * a trusted proxy/load balancer and proxy trust is configured correctly. */ export declare function getClientIp(req: MinimalRequest): string; /** * Human-readable device name derived from User-Agent. * * This intentionally uses lightweight detection so Forge does not need * a UA parsing dependency. */ export declare function getDeviceName(req: MinimalRequest): string; /** * Get a human-readable location for an IP. * * Localhost: * ::1 / 127.0.0.1 -> "Localhost" * * Private LAN: * 192.168.x.x * 10.x.x.x * 172.16.x.x - 172.31.x.x * * These addresses cannot be geolocated because they are not globally * routable. We therefore return a useful development/network label. * * Public IPs require a GeoIP provider/database. */ export declare function getLocationFromIp(ip: string): Promise; /** Current year for email footer/copyright fields. */ export declare function getCurrentYear(): number; /** * Current date/time formatted for human-readable email fields. */ export declare function getFormattedNow(locale?: string, timeZone?: string): string; /** * Compute all automatically-derived email fields. */ export declare function getAutoDerivedFields(req: MinimalRequest): Promise; //# sourceMappingURL=auto-fields.d.ts.map