import { SandBoxContextOptions } from "./parseFileContent.js";
import { TranspileOptions } from "./transpileTSToCJS.js";
import { IntlayerConfig } from "@intlayer/types/config";

//#region src/loadExternalFile/loadExternalFile.d.ts
type LoadExternalFileOptions = {
  configuration?: IntlayerConfig;
  buildOptions?: TranspileOptions;
  logError?: boolean;
  /**
   * Key-value pairs to temporarily set on the main Node.js `globalThis` for the
   * synchronous duration of `parseFileContent` / `runInNewContext`. External modules
   * loaded via `require()` inside the VM (e.g. `@intlayer/core`'s `file()` helper)
   * run in the main context and read from the real `globalThis`, not the VM sandbox.
   * Values are restored (or deleted) after `runInNewContext` returns.
   */
  preloadGlobals?: Record<string, unknown>;
} & SandBoxContextOptions;
/**
 * Load the content declaration from the given path
 *
 * Accepts JSON, JS, MJS and TS files as configuration
 */
declare const loadExternalFileSync: (filePath: string, options?: LoadExternalFileOptions) => any | undefined;
/**
 * Load the content declaration from the given path
 *
 * Accepts JSON, JS, MJS and TS files as configuration
 */
declare const loadExternalFile: (filePath: string, options?: LoadExternalFileOptions) => Promise<any | undefined>;
//#endregion
export { LoadExternalFileOptions, loadExternalFile, loadExternalFileSync };
//# sourceMappingURL=loadExternalFile.d.ts.map