/** * ESM Globals - CommonJS-like Globals for ES Modules * * This module provides CommonJS-like __filename and __dirname functionality * for ES modules, with special handling for Jest test environments. * * Problem Solved: * ES modules don't have access to __filename and __dirname globals that * are available in CommonJS. This module provides safe alternatives that * work in both production and test environments. * * Jest Compatibility: * - Avoids top-level import.meta usage; uses guarded import.meta access in a try/catch * - Provides fallback paths for Jest environment detection * - Avoids top-level import.meta usage that can cause Jest failures */ /** * Get the current module's filename (ESM equivalent of __filename) * Uses guarded import.meta access to avoid Jest/static-analysis pitfalls * @returns Absolute path to the current module file */ export declare function getThisFilename(): string; /** * Get the current module's directory (ESM equivalent of __dirname) * @returns Absolute path to the current module's directory */ export declare function getThisDirname(): string; export declare function __filename(): string; export declare function __dirname(): string; /** * Get filename for a specific module using its import.meta.url * @param importMetaUrl - The import.meta.url from the calling module * @returns Absolute path to the specified module file */ export declare function getModuleFilename(importMetaUrl: string): string; /** * Get directory for a specific module using its import.meta.url * @param importMetaUrl - The import.meta.url from the calling module * @returns Absolute path to the specified module's directory */ export declare function getModuleDirname(importMetaUrl: string): string; //# sourceMappingURL=esm-globals.d.ts.map