import { d as WidgetMap, i as ComponentResolver } from "../renderer-ab9E52Bp.mjs"; //#region src/core/contexts.d.ts /** * Abstract provide / consume port that framework adapters implement * against their native context primitive. The {@link provide} step * wraps its `children` in the framework's provider machinery so any * descendant calling {@link consume} receives the supplied value; * {@link consume} is called from inside a child renderer to read the * current value. * * The return type of `provide` and the argument type of `consume` are * deliberately `unknown` so the port works for both React-style * "wrap children in a provider component" implementations and * Svelte-style "set on the current component instance" implementations * without forcing one shape on the other. * * @typeParam T - The value carried by the context. */ interface ContextPort { /** * Provide `value` to every descendant of `children`. The exact * shape of `children` is framework-specific — `ReactNode` for * React, the slot's render function for Svelte, the `setup` * return value for Vue. The implementation simply makes the * supplied value available to subsequent {@link consume} calls * within that scope. */ provide(value: T, children: unknown): unknown; /** * Read the currently provided value. The exact host primitive is * framework-specific — `useContext(ctx)` in React, `inject(key)` * in Vue, `getContext(key)` in Svelte. When no provider is * mounted in scope, adapter implementations may return their * canonical "default" value or `undefined` — the choice is * adapter-defined. */ consume(): T; } /** * Shape carried by the resolver context. Adapters expose this through * a `ContextPort` so the dispatcher can read * the active theme adapter without taking a direct dependency on the * host framework's context system. * * Mirrors the value carried by the React adapter's * `UserResolverContext` (defined in `react/SchemaComponent.tsx`) — * an optional {@link ComponentResolver}. The `undefined` branch * signals "no theme provider mounted; fall through to the headless * resolver". * * @group Framework Adapters */ type ResolverContextShape = ComponentResolver | undefined; /** * Shape carried by the widgets context. Adapters expose this through * a `ContextPort` so the dispatcher can read * the active widget map without binding to the host framework's * context system. * * Mirrors the value carried by the React adapter's `WidgetsContext` * (defined in `react/SchemaComponent.tsx`) — an optional * {@link WidgetMap}. The `undefined` branch signals "no scoped widgets * for this subtree; fall through to per-instance widgets, then the * global registry, then the resolver". * * @group Framework Adapters */ type WidgetsContextShape = WidgetMap | undefined; //#endregion export { ContextPort, ResolverContextShape, WidgetsContextShape };