/**
 * @module plugins/logging
 * Logging plugin for xBind plugin system
 *
 * Captures send, receive, encrypt, and decrypt events for debugging and audit trails.
 */
import type { Result } from '@private.me/shared';
import type { Plugin, PluginContext, HookResult } from '../plugin-system.js';
import type { AnyTransportEnvelope } from '../envelope.js';
/**
 * Log level enum.
 */
export declare enum LogLevel {
    DEBUG = "debug",
    INFO = "info",
    WARN = "warn",
    ERROR = "error"
}
/**
 * Log entry structure.
 */
export interface LogEntry {
    timestamp: string;
    level: LogLevel;
    event: 'send' | 'receive' | 'encrypt' | 'decrypt';
    agent: string;
    recipient?: string;
    scope?: string;
    payloadSize?: number;
    metadata?: Record<string, unknown>;
}
/**
 * Logging plugin options.
 */
export interface LoggingPluginOptions {
    /** Log level threshold (default: INFO) */
    level?: LogLevel;
    /** Include payload sizes in logs (default: true) */
    includeSize?: boolean;
    /** Include metadata in logs (default: false) */
    includeMetadata?: boolean;
    /** Custom log handler (default: console.log) */
    logHandler?: (entry: LogEntry) => void;
    /** Filter function to exclude certain logs */
    filter?: (entry: LogEntry) => boolean;
}
/**
 * Logging plugin implementation.
 * Captures all message processing events and outputs structured logs.
 */
export declare class LoggingPlugin implements Plugin {
    readonly name = "logging";
    readonly version = "1.0.0";
    readonly description = "Captures message processing events for debugging and audit trails";
    readonly priority = 10;
    private options;
    private logs;
    constructor(options?: LoggingPluginOptions);
    onInit(): Result<void, string>;
    onDestroy(): Result<void, string>;
    onSend(payload: unknown, context: PluginContext): Result<HookResult<unknown>, string>;
    onReceive(envelope: AnyTransportEnvelope, context: PluginContext): Result<HookResult<AnyTransportEnvelope>, string>;
    onEncrypt(plaintext: Uint8Array, context: PluginContext): Result<HookResult<Uint8Array>, string>;
    onDecrypt(plaintext: Uint8Array, context: PluginContext): Result<HookResult<Uint8Array>, string>;
    /**
     * Get all captured logs.
     */
    getLogs(): readonly LogEntry[];
    /**
     * Clear all logs.
     */
    clearLogs(): void;
    /**
     * Get logs filtered by criteria.
     */
    getFilteredLogs(filter: (entry: LogEntry) => boolean): LogEntry[];
    private log;
    private shouldLog;
    private estimateSize;
}
/**
 * Create a logging plugin with options.
 */
export declare function createLoggingPlugin(options?: LoggingPluginOptions): LoggingPlugin;
