UNPKG

vite-plugin-react-server

Version:
46 lines 1.85 kB
/** * Standard environment variable keys that should be prefixed */ export declare const ENV_KEYS: { readonly MODE: "MODE"; readonly DEV: "DEV"; readonly PROD: "PROD"; readonly SSR: "SSR"; readonly BASE_URL: "BASE_URL"; readonly PUBLIC_ORIGIN: "PUBLIC_ORIGIN"; }; export type EnvKey = keyof typeof ENV_KEYS; /** * Gets the full environment variable name with the configured prefix * @param key The environment variable key (e.g., "MODE", "DEV", "BASE_URL") * @param prefix The environment prefix (defaults to user config or "VITE_") * @returns The full environment variable name (e.g., "VITE_MODE", "CUSTOM_PREFIX_DEV") */ export declare function getEnvKey(key: EnvKey, prefix?: string): string; /** * Gets the environment variable value with the configured prefix * @param key The environment variable key * @param prefix The environment prefix (optional) * @returns The environment variable value or undefined */ export declare function getEnvValue(key: EnvKey, prefix?: string): string | undefined; /** * Sets an environment variable with the configured prefix * @param key The environment variable key * @param value The value to set * @param prefix The environment prefix (optional) */ export declare function setEnvValue(key: EnvKey, value: string, prefix?: string): void; /** * Checks if the SSR environment variable is enabled * @param prefix The environment prefix (optional) * @returns true if SSR is enabled, false otherwise */ export declare function isSsrEnabled(prefix?: string): boolean; /** * Creates an object with all standard environment variable keys for the given prefix * @param prefix The environment prefix * @returns Object with all environment variable names */ export declare function getEnvKeys(prefix?: string): Record<EnvKey, string>; //# sourceMappingURL=getEnvKey.d.ts.map