import { extractClientKeys, extractSharedKeys } from "@arkenv/build"; //#region src/config.d.ts /** * Configuration options for the ArkEnv Next.js integration. * * @example * ```ts * const configOptions: ArkEnvConfigOptions = { * schemaPath: "./src/env.ts", * outputPath: "./src/generated/env.gen.ts" * }; * ``` */ type ArkEnvConfigOptions = { /** * Specify the path to the schema definition file. * * Defaults to searching for `"src/env.ts"` or `"env.ts"` in the project root. * * @default "src/env.ts" * @example * ```ts * export default withArkEnv(nextConfig, { * schemaPath: "./src/env.ts" * }); * ``` */ schemaPath?: string; /** * Specify the path where the generated file (`env.gen.ts`) should be written. * * Defaults to `"generated/env.gen.ts"` in the same directory as the schema file. * * @default "[schemaDirectory]/generated/env.gen.ts" * @example * ```ts * export default withArkEnv(nextConfig, { * outputPath: "./src/generated/env.gen.ts" * }); * ``` */ outputPath?: string; /** * Specify the configuration layout. * * - `"flat"` (default): A single `env.ts` schema file. * - `"strict"`: A split schema layout (`env/client.ts`, `env/server.ts`, and optionally `env/internal/shared.ts`). * * @default "flat" */ layout?: "flat" | "strict" /** @deprecated Use `"flat"` instead. `"simple"` will be removed in the next major version. */ | "simple"; /** * Enable or disable build-time environment variable validation during build/dev startup. * * @default true */ validate?: boolean; /** * Enable or disable automatic code generation of the `env.gen.ts` file. * * @default true */ codegen?: boolean; }; /** * Run ArkEnv codegen and setup without wrapping nextConfig. * * @param options Optional configuration paths for schema and output files * @param internalOptions Optional configuration for internal testing hooks * @throws An error if the schema file cannot be found or if code generation fails */ declare function setupArkEnv(options?: ArkEnvConfigOptions, internalOptions?: { _jitiAliases?: Record; }): void; /** * Wrap a Next.js configuration object to automatically generate the `runtimeEnv` block in `env.gen.ts`. * * @param nextConfig The Next.js configuration object or function * @param options Optional configuration paths for schema and output files * @returns The Next.js configuration object unchanged * @throws An error if the schema file cannot be found or if code generation fails */ declare function withArkEnv(nextConfig: T, options?: ArkEnvConfigOptions): T; /** * Run code generation to read the schema file and generate the env.gen.ts factory. * * @param schemaPath The absolute path to the schema file or directory * @param outputPath The absolute path to the generated output file * @param layoutOption The explicit layout to use; auto-detected from the filesystem when omitted * @throws An error if strict layout files are missing when `layoutOption` is `"strict"` */ declare function runCodegen(schemaPath: string, outputPath: string, layoutOption?: ArkEnvConfigOptions["layout"]): void; /** * Statically extract client and shared keys from the schema content using NEXT_PUBLIC_ prefix. * * @param content The schema file string content * @returns An object containing the extracted client and shared keys */ declare function extractKeys(content: string): { clientKeys: string[]; sharedKeys: string[]; serverKeys: string[]; isLegacy?: boolean; }; //#endregion export { ArkEnvConfigOptions, extractClientKeys, extractKeys, extractSharedKeys, runCodegen, setupArkEnv, withArkEnv }; //# sourceMappingURL=config.d.cts.map