/** * Context creation and management. * * @packageDocumentation */ import { Mode, Context } from './types.js'; export type { Context }; /** * Create an evaluation context for directives. * * @remarks * Uses {@link findRoots} to only access state keys that the expression * actually references, enabling precise dependency tracking with the * reactive system. * * Supports scoped values via `get()` for things like $component, $renderingChain. * Create child contexts with `child()` for nested scopes. * * @param mode - Execution mode (server or client) * @param state - The reactive state object * @param scope - Optional scoped values (for context-specific data) * @returns A new context * * @example * ```ts * const state = reactive({ user: { name: 'Alice' } }); * const ctx = createContext(Mode.CLIENT, state); * ctx.eval('user.name' as Expression); // 'Alice' * * const childCtx = ctx.child({ $component: el }); * childCtx.get('$component'); // el * ``` */ export declare function createContext(mode: Mode, state: Record, scope?: Record): Context; /** * Create a child context with additional bindings. * * @deprecated Use ctx.child() instead */ export declare function createChildContext(parent: Context, additions: Record): Context;