import { type Context, ContextConsumer } from '@lit/context'; import { ControllerBase, type ControllerHost } from './Abstracts/ControllerBase'; /** * Configuration options for the InheritanceConsumerController. * * @public */ export interface IInheritanceConsumerControllerConfig { /** * The context to consume inherited properties from. */ context: Context>; } /** * Controller for child components that consume inherited properties from parent providers. * * This controller: * - Consumes properties from a `@lit/context` provider * - Tracks which properties have been explicitly set on the host * - Returns the effective value: explicit > inherited > local default * * @example * ```typescript * class AvatarElement extends CustomElement { * private _inheritance = addInheritanceConsumerController(this, { * context: AvatarGroupInheritanceContext * }); * * public override get size(): Size { * return this._inheritance.get('size', super.size); * } * * public override set size(value: Size) { * this._inheritance.markExplicit('size'); * super.size = value; * } * } * ``` * * @public */ export declare class InheritanceConsumerController extends ControllerBase { private readonly _explicitlySet; private readonly _consumer; private _inherited; /** * Creates a new InheritanceConsumerController. * * @public * @param host The host element. * @param config The controller configuration. */ constructor(host: ControllerHost, config: IInheritanceConsumerControllerConfig); /** * Whether this consumer has found a provider. * * @public * @readonly */ get hasProvider(): boolean; /** * Gets all inherited properties. * * @public * @readonly */ get inherited(): Partial; /** * Gets the context consumer. * * @protected * @readonly */ protected get consumer(): ContextConsumer>, ControllerHost>; /** * Marks a property as explicitly set on the host. * Once marked, the inherited value will be ignored for this property. * * @public * @param key The property key. */ markExplicit(key: TKey): void; /** * Checks if a property has been explicitly set. * * @public * @param key The property key. * @returns True if the property was explicitly set. */ isExplicit(key: TKey): boolean; /** * Gets the effective value for a property. * * Priority: explicit > inherited > localValue * * @public * @param key The property key. * @param localValue The local value from the host. * @returns The effective value (same type as localValue). */ get(key: TKey, localValue: TValue): TValue; /** * Resets the explicit flag for a property. * After reset, the property will again inherit from the provider. * * @public * @param key The property key. */ resetExplicit(key: TKey): void; /** * Resets all explicit flags. * * @public */ resetAllExplicit(): void; } /** * Adds an inheritance consumer controller to the given host. * * @public * @param host The host element. * @param config The configuration options. * @returns The inheritance consumer controller instance. */ export declare function addInheritanceConsumerController(host: ControllerHost, config: IInheritanceConsumerControllerConfig): InheritanceConsumerController; //# sourceMappingURL=InheritanceConsumerController.d.ts.map