import { ContextPort } from "../core/contexts.mjs"; import { t as LitComponentResolver } from "../types-BCy7K3nk.mjs"; import { ReactiveControllerHost, ReactiveElement } from "lit"; //#region src/lit/contexts.d.ts /** * Context key identifying the {@link LitComponentResolver} provided at * a host element. Re-used by every built-in `` Custom Element so * a single `` provider seeds the whole subtree — * matching the behaviour of `` on the React side. * * The literal `"sc-resolver"` value is the runtime key carried in the * Context Protocol's `context-request` event; consumers and providers * must use the same `Context` object (not just the same string) to * match, which is why this is exported rather than redeclared per * element. */ declare const resolverContext: { __context__: LitComponentResolver; }; /** * Lit binding wrapping `ContextProvider` / `ContextConsumer` from * `@lit/context` for the {@link resolverContext}. * * The port is host-scoped — both `provide` and `consume` require a * `ReactiveControllerHost` reference so `@lit/context` can register * its controllers on the element's lifecycle. This is unavoidable * given Lit's reactive update model and is the reason the Lit port * does not match the canonical {@link ContextPort} signature in * `core/contexts.ts` directly — see this module's docstring for the * rationale. */ declare const resolverContextPort: { provide(host: ReactiveControllerHost & ReactiveElement, value: LitComponentResolver): { setValue: (value: LitComponentResolver) => void; }; consume(host: ReactiveControllerHost & ReactiveElement): { readonly value?: LitComponentResolver; }; }; /** * Widget map — name → custom element tag. * * Where the React adapter's `WidgetMap` is `ReadonlyMap` * (a function value per hint name), the Lit adapter resolves widgets by * Custom Element tag name. A schema field carrying * `.meta({ component: "color-picker" })` looks up `widgets.get("color-picker")` * and renders the matching tag — preserving the Web-Components-native * pattern where every renderer override IS a Custom Element. * * Tags must be registered via `customElements.define` before they can * be rendered. Unregistered tags surface as unknown elements with no * upgrade — matching the browser's behaviour rather than throwing. */ type LitWidgetMap = ReadonlyMap; /** * Context key for {@link LitWidgetMap}. */ declare const widgetsContext: { __context__: LitWidgetMap; }; /** * Lit binding wrapping `ContextProvider` / `ContextConsumer` from * `@lit/context` for the {@link widgetsContext}. Parallel to * {@link resolverContextPort}; see that export for the rationale on * why the Lit port is host-scoped rather than matching the canonical * {@link ContextPort} signature directly. */ declare const widgetsContextPort: { provide(host: ReactiveControllerHost & ReactiveElement, value: LitWidgetMap): { setValue: (value: LitWidgetMap) => void; }; consume(host: ReactiveControllerHost & ReactiveElement): { readonly value?: LitWidgetMap; }; }; //#endregion export { type ContextPort, LitWidgetMap, resolverContext, resolverContextPort, widgetsContext, widgetsContextPort };