import { NextRequest, NextResponse } from 'next/server';
import React from 'react';

interface LogData {
    ip: string;
    userAgent: string;
    url: string;
    event: string;
    timestamp: string;
    method?: string;
    statusCode?: number;
    responseTime?: number;
    requestBody?: any;
    responseBody?: any;
    error?: any;
}
interface LogPayload {
    log: LogData;
    apiKey: string;
}
interface LoggerConfig {
    backendUrl: string;
    apiKey: string;
    enableConsoleLog?: boolean;
    customEvents?: string[];
}

declare class Logger {
    private static instance;
    private config;
    private constructor();
    static getInstance(config: LoggerConfig): Logger;
    private getUserIp;
    sendLog(event: Event | string, additionalData?: any): Promise<void>;
}

declare function createLoggerMiddleware(config: {
    backendUrl: string;
    apiKey: string;
}): (request: NextRequest) => Promise<NextResponse<unknown>>;

declare const LoggerWrapper: React.FC<LoggerConfig>;

export { type LogData, type LogPayload, Logger, type LoggerConfig, LoggerWrapper, createLoggerMiddleware };
