/*! * Configuration System for Fingerprint OSS * Copyright (c) 2025 Akshat Kotpalliwar (alias IntegerAlex on GitHub) * Licensed under LGPL-3.0 */ import { FingerprintWarning } from './errors.js'; /** * Environment types supported by the configuration system */ export type Environment = 'TEST' | 'DEV' | 'STAGING' | 'PROD'; /** * Log levels for structured logging */ export type LogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug'; export declare const DEFAULT_GEO_TIMEOUT_MS = 4500; /** * Configuration interface for environment-aware settings */ export interface FingerprintConfig { /** Current environment */ environment: Environment; /** Enable verbose logging for testing */ verbose: boolean; /** Enable transparency mode for GDPR compliance */ transparency: boolean; /** Custom message for data collection transparency */ message?: string; /** Log level for structured logging */ logLevel: LogLevel; /** Enable console output */ enableConsoleLogging: boolean; /** Enable performance metrics logging */ enablePerformanceLogging: boolean; /** Timeout for geolocation requests (ms) */ geoTimeout: number; } /** * Detects the current environment based on various indicators */ export declare function detectEnvironment(): Environment; /** * Initializes the configuration system with environment detection */ export declare function initializeConfig(customConfig?: Partial, warnings?: FingerprintWarning[]): FingerprintConfig; /** * Gets the current configuration, initializing if necessary */ export declare function getConfig(): FingerprintConfig; /** * Updates the current configuration */ export declare function updateConfig(updates: Partial): FingerprintConfig; /** * Checks if verbose logging is enabled for the current environment */ export declare function isVerboseEnabled(): boolean; /** * Checks if a log level should be output based on current configuration */ export declare function shouldLog(level: LogLevel): boolean; /** * Structured logger with environment-aware controls */ export declare class StructuredLogger { private static formatMessage; static error(operation: string, message: string, data?: any): void; static warn(operation: string, message: string, data?: any): void; static info(operation: string, message: string, data?: any): void; static verbose(operation: string, message: string, data?: any): void; static debug(operation: string, message: string, data?: any): void; /** * Logs a block operation with timing information */ static logBlock(operation: string, description: string, block: () => T | Promise): T | Promise; } /** * Performance timing utility for development environments */ export declare class PerformanceTimer { private static timers; static start(label: string): void; static end(label: string): number; }