import { default as CxFormatTime } from '../../../atoms/src/components/format-time/format-time.ts';
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
import { DisplayStyle } from '../../../types/src/time';
import { CSSResultGroup } from 'lit';

/**
 * @summary Displays the estimated reading time for a target element's text content.
 *
 * @description Calculates reading time based on the visible text of a target element,
 * using an average reading speed of 238 words per minute. Rendered as `"<duration> read"`
 * (e.g. "12 minutes read", "1 hour, 1 minute read"), with the duration formatted by `cx-format-time`.
 * `resolveTarget` is a JS-only property (no HTML attribute) since it accepts non-serialisable values.
 * If `resolveTarget` is not set, the component does nothing.
 *
 * @csspart base - The component's text wrapper. Target with `::part(base)` for style control.
 *
 * @example
 * // Pass a function
 * document.querySelector('cx-estimated-reading-time').resolveTarget = () => document.getElementById('my-content');
 *
 * @example
 * // Pass a raw element
 * document.querySelector('cx-estimated-reading-time').resolveTarget = document.getElementById('my-content');
 */
export default class CxEstimatedReadingTime extends CortexElement {
    static readonly styles: CSSResultGroup;
    static readonly dependencies: {
        'cx-format-time': typeof CxFormatTime;
    };
    private readonly localize;
    private observer;
    /** The target element to calculate reading time for. Accepts a raw HTMLElement or a function that returns one. */
    resolveTarget: HTMLElement | (() => HTMLElement | null) | null;
    /** Display style forwarded to `cx-format-time`. Defaults to "long". */
    displayStyle: DisplayStyle;
    private durationMs;
    connectedCallback(): void;
    disconnectedCallback(): void;
    onResolveTargetChange(): void;
    recalculate(): void;
    private getTarget;
    private calculate;
    private observe;
    render(): symbol | import('lit').TemplateResult<1>;
}
declare global {
    interface HTMLElementTagNameMap {
        'cx-estimated-reading-time': CxEstimatedReadingTime;
    }
}
