import type { APIResponse } from '../../checkout/types'; /** * Creates a standardized API response */ export declare function createApiResponse(success: boolean, data?: T, error?: { message: string; code?: string; details?: Record; }): APIResponse; /** * Creates a success response */ export declare function createSuccessResponse(data: T): APIResponse; /** * Creates an error response */ export declare function createErrorResponse(message: string, code?: string, details?: Record): APIResponse; /** * Validates required environment variables */ export declare function validateEnvironment(): void; /** * Validates request method */ export declare function validateMethod(req: any, allowedMethods: string[]): boolean; /** * Extracts and validates request body */ export declare function validateRequestBody(req: any, requiredFields: (keyof T)[]): T; /** * Safely parses JSON with error handling */ export declare function safeJsonParse(json: string): T | null; /** * Formats currency amount for display */ export declare function formatCurrency(amount: number, currency: string): string; /** * Converts currency amount to cents */ export declare function toCents(amount: number): number; /** * Converts cents to currency amount */ export declare function fromCents(cents: number): number; /** * Generates a unique order reference */ export declare function generateOrderReference(): string; /** * Validates email format */ export declare function isValidEmail(email: string): boolean; /** * Validates phone number format (basic validation) */ export declare function isValidPhone(phone: string): boolean; /** * Sanitizes string input to prevent XSS */ export declare function sanitizeString(input: string): string; /** * Rate limiting helper */ export declare class RateLimiter { private attempts; isAllowed(key: string, maxAttempts?: number, windowMs?: number): boolean; }