UNPKG

@intlayer/config

Version:

Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.

29 lines (28 loc) 1.13 kB
import { LoadEnvFileOptions } from "../loadEnvFile.js"; import { Context } from "node:vm"; //#region src/loadExternalFile/parseFileContent.d.ts type SandBoxContextOptions = { envVarOptions?: LoadEnvFileOptions; projectRequire?: NodeJS.Require; additionalEnvVars?: Record<string, string>; /** * Map of specifier -> mocked export to be returned when code in the VM calls require(specifier). * Example: * mocks: { * '@intlayer/config/built': { getConfig: () => ({}), Locales: {} } * } */ mocks?: Record<string, any>; /** * Optional alias map if you want to redirect specifiers. * Useful when user code imports a subpath you want to collapse. * Example: * aliases: { '@intlayer/config/built': '@intlayer/config' } */ aliases?: Record<string, string>; }; declare const getSandBoxContext: (options?: SandBoxContextOptions) => Context; declare const parseFileContent: <T>(fileContentString: string, options?: SandBoxContextOptions) => T | undefined; //#endregion export { SandBoxContextOptions, getSandBoxContext, parseFileContent }; //# sourceMappingURL=parseFileContent.d.ts.map