/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ import type { Context, ContextType } from '../create-context.js'; import type { ReactiveController, ReactiveControllerHost } from '@lit/reactive-element'; export interface Options> { context: C; callback?: (value: ContextType, dispose?: () => void) => void; subscribe?: boolean; } /** * A ReactiveController which adds context consuming behavior to a custom * element by dispatching `context-request` events. * * When the host element is connected to the document it will emit a * `context-request` event with its context key. When the context request * is satisfied the controller will invoke the callback, if present, and * trigger a host update so it can respond to the new value. * * It will also call the dispose method given by the provider when the * host element is disconnected. */ export declare class ContextConsumer, HostElement extends ReactiveControllerHost & HTMLElement> implements ReactiveController { protected host: HostElement; private context; private callback?; private subscribe; private provided; value?: ContextType; constructor(host: HostElement, options: Options); /** @deprecated Use new ContextConsumer(host, options) */ constructor(host: HostElement, context: C, callback?: (value: ContextType, dispose?: () => void) => void, subscribe?: boolean); private unsubscribe?; hostConnected(): void; hostDisconnected(): void; private dispatchRequest; private _callback; } //# sourceMappingURL=context-consumer.d.ts.map