import type fs from 'node:fs'; import type { ImportMap, SpecifierMap } from '@esmx/import'; import type { ParsedModuleConfig } from '../module-config'; /** * Get the list of statically imported module names from JS code. Maybe cannot handle multiple concurrent calls, not tested. * @param code JS code * @returns `Promise` List of statically imported module names */ export declare function getImportsFromJsCode(code: string): Promise; /** * Get the list of statically imported module names from a JS file. * @param filepath JS file path * @returns `Promise` List of statically imported module names */ export declare function getImportsFromJsFile(filepath: fs.PathLike | fs.promises.FileHandle): Promise; export type ImportPreloadInfo = SpecifierMap; /** * Get import preload information. * @param specifier Module name * @param importMap Import map object * @param moduleConfig Module configuration * @returns * - `Promise<{ [specifier: string]: ImportPreloadPathString }>` Mapping object of module names to file paths * - `null` specifier does not exist */ export declare function getImportPreloadInfo(specifier: string, importMap: ImportMap, moduleConfig: ParsedModuleConfig): Promise<{ [k: string]: string; } | null>;