/** * Fjall default configuration helpers for Payload CMS. * * Provides sensible defaults for AWS Lambda deployments: * - CORS configuration based on environment * - CSRF configuration for security * - Environment detection helpers */ /** * Check if running during Next.js build phase. * * During build, there's no database connection available. Use this to skip * database queries in generateStaticParams and other build-time code. * * @example * ```typescript * import { isBuildTime } from '@fjall/payload' * * export async function generateStaticParams() { * if (isBuildTime()) { * return [] // Skip static generation - pages render on-demand * } * const payload = await getPayload({ config: configPromise }) * // ... fetch data * } * ``` */ export declare function isBuildTime(): boolean; /** * Check if running in a production AWS environment. * * Detection is based on the presence of MEDIA_BUCKET_NAME which is set * by Fjall infrastructure in Lambda environments. */ export declare function isProduction(): boolean; /** * Check if running in AWS Lambda. * * Uses AWS_LAMBDA_FUNCTION_NAME which is set by the Lambda runtime. */ export declare function isLambda(): boolean; /** * Fjall default configuration spread for Payload buildConfig. * * Provides: * - CORS: Locked to NEXT_PUBLIC_SERVER_URL in production, permissive otherwise * - CSRF: Enabled in production with NEXT_PUBLIC_SERVER_URL * * @example * ```typescript * import { fjallDefaults } from '@fjall/payload' * * export default buildConfig({ * ...fjallDefaults(), * // your config... * }) * ``` */ export declare function fjallDefaults(): { cors: string[]; csrf: string[]; }; /** * Get the conditional staticDir configuration for Media collections. * * In production (Lambda), S3 storage is used and staticDir should be omitted. * In local development, uploads go to the local filesystem. * * @param localPath - The local path for development (e.g., './public/media') * @returns Object with staticDir for local dev, empty object for production * * @example * ```typescript * import { conditionalStaticDir } from '@fjall/payload' * import path from 'path' * * export const Media: CollectionConfig = { * slug: 'media', * upload: { * ...conditionalStaticDir(path.resolve(__dirname, '../../public/media')), * // other upload config... * }, * } * ``` */ export declare function conditionalStaticDir(localPath: string): { staticDir: string; } | Record;