import { ContextData, ContextAdapter } from './baseContext.js'; /** * Configure the storage adapter for the context system. * * @param adapter - The storage adapter instance to use * * @example * ```ts * import { configureAdapter, ReactContextAdapter } from '@optimizely/cms-sdk/react/server'; * configureAdapter(new ReactContextAdapter()); * * // Future: Using Vue (hypothetical) * import { configureAdapter, VueContextAdapter } from '@optimizely/cms-sdk/vue'; * configureAdapter(new VueContextAdapter()); */ export declare function configureAdapter(adapter: ContextAdapter): void; /** * Get the current storage adapter. * Use this to access context data in your components. * * @throws {Error} If the adapter has not been configured * * @example * ```ts * import { getAdapter } from '@optimizely/cms-sdk/react/server'; * * const adapter = getAdapter(); * const previewToken = adapter.getData()?.preview_token; * const locale = adapter.getData()?.locale; * ``` */ export declare function getAdapter(): ContextAdapter; /** * Check if a context adapter is currently configured. * * @returns true if an adapter has been configured, false otherwise * @internal */ export declare function hasAdapter(): boolean; /** * Initialize the request context using the configured adapter. * Clears any existing context data to start fresh for a new request. * Typically called by the withContext HOC in React applications. * * @internal */ export declare const initializeRequestContext: () => void; /** * Retrieve current context data for this request. * * @returns Context data for the current request, or undefined if no context exists * @internal */ export declare const getContext: () => ContextData | undefined; /** * Update/merge context data for the current request. * * @param value - Partial context data to merge into the current context * @internal */ export declare const setContext: (value: Partial) => void; /** * Set a specific piece of context data by key. * * @param key - The key to set in the context * @param value - The value to set for the specified key * @internal */ export declare const setContextData: (key: K, value: ContextData[K]) => void; /** * Get a specific piece of context data by key. * * @param key - The key to retrieve from the context * @returns The value for the specified key, or undefined if not found * @internal */ export declare const getContextData: (key: K) => ContextData[K] | undefined;