import { LimeWebComponent, LimeWebComponentContext } from '../core'; /** * Listener for context updates passed to {@link subscribeContext}. * * @internal */ export type ContextListener = (value: LimeWebComponentContext | undefined) => void; /** * Resolve the current {@link LimeWebComponentContext} for a component, * preferring an explicit `@Prop` over the ambient registry. * * Mirrors {@link resolvePlatform}: if the component carries a `context` * property (via Stencil's `@Prop`, a `@SelectContext('context')` * subscription, or any other declaration that writes to the field), * that value wins. Otherwise dispatches a one-shot W3C * `context-request` event and returns whatever the closest ancestor * provider answers with — or `undefined` if nothing answers. * * Synchronous. Intended for mappers and other call-time consumers that * need the current context without holding a subscription. * * @param component - The component to resolve context for. * @returns The resolved context value, or `undefined`. * * @internal */ export declare function resolveContext(component: LimeWebComponent): LimeWebComponentContext | undefined; /** * Subscribe to ambient {@link LimeWebComponentContext} updates for a * component. * * If the host element exposes a `context` property (via Stencil's * `@Prop` or any other declaration on the prototype chain), wraps it * so the current value fires immediately and any later assignment * propagates through the listener. This keeps prop-drilled consumers * working unchanged. * * If no `context` property is exposed on the host, dispatches a W3C * `context-request` event with subscribe semantics. The closest * ancestor provider answers with the current value and again on every * change. * * Both paths coexist indefinitely; each component independently picks * based on what its own host exposes, so mixed trees work. * * @param component - The component to anchor the subscription against. * @param listener - Called synchronously with the initial value, and * again on every subsequent change. * @returns Teardown function to stop the subscription. * * @internal */ export declare function subscribeContext(component: LimeWebComponent, listener: ContextListener): () => void;