UNPKG

@spoolcms/nextjs

Version:

The beautiful headless CMS for Next.js developers

38 lines (37 loc) 1.09 kB
/** * Environment detection utilities for Spool CMS * Provides reliable detection of server vs client context and environment settings */ export interface EnvironmentContext { isServer: boolean; isClient: boolean; isDevelopment: boolean; isProduction: boolean; isReactStrictMode: boolean; } /** * Detect the current execution environment * This function works reliably in both server and client contexts */ export declare function detectEnvironment(): EnvironmentContext; /** * Check if we're running in a server context */ export declare function isServerContext(): boolean; /** * Check if we're running in a client context */ export declare function isClientContext(): boolean; /** * Check if we're in development mode */ export declare function isDevelopmentMode(): boolean; /** * Check if we're in production mode */ export declare function isProductionMode(): boolean; /** * Get a cache key suffix based on environment * This helps prevent cache collisions between different environments */ export declare function getEnvironmentCacheKey(): string;