import { default as CxHeader } from '../../../atoms/src/components/header/header.ts';
import { default as CxLineClamp } from '../../../atoms/src/components/line-clamp/line-clamp.ts';
import { default as CxResizeObserver } from '../../../atoms/src/components/resize-observer/resize-observer.ts';
import { default as CxTypography } from '../../../atoms/src/components/typography/typography.ts';
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
import { PageOutlineUnderlineType } from '../../../types/src/page-outline';
import { CSSResultGroup } from 'lit';

/**
 * @summary The PageOutline component dynamically generates a structured outline
 * of the document by scanning for `<cx-header>` elements inside a specified root.
 *
 * @cssproperty --page-outline-item-color - The text color of item
 * @cssproperty --page-outline-item-hover-color - The text color of item when hovered
 * @cssproperty --page-outline-item-padding - The padding of item
 * @cssproperty --page-outline-item-underline-offset - The offset of the underline
 * @cssproperty --page-outline-item-underline-thickness - The thickness of the underline
 * @cssproperty --page-outline-item-underline-style - The style of the underline
 *
 * @csspart title - The title of the outline
 * @csspart list - The list of the outline
 * @csspart item - The item of the outline
 * @csspart text - The text of the outline item
 *
 * @typedef PageOutlineUnderlineType - 'always' | 'hover'
 */
export default class CxPageOutline extends CortexElement {
    static readonly styles: CSSResultGroup;
    static readonly dependencies: {
        'cx-header': typeof CxHeader;
        'cx-line-clamp': typeof CxLineClamp;
        'cx-resize-observer': typeof CxResizeObserver;
        'cx-typography': typeof CxTypography;
    };
    indicator?: HTMLElement;
    list?: HTMLElement;
    /** Root selector of the scanning document */
    rootSelector: string;
    /** If true, the outline item will be clickable */
    canClick: boolean;
    /** Heading title */
    headingTitle: string;
    /** Underline variant */
    showUnderlineType: PageOutlineUnderlineType;
    /** If true, automatically sync active heading based on scroll position */
    autoSync: boolean;
    /** Whether to not show the header anchor in nested blocks in CMS5 */
    excludeNested: boolean;
    /** List of the outline items extracted from the page */
    private outlineItems;
    private root;
    private currentHash;
    /**
     * For auto-sync mode, when user clicks on an item
     * We need to priority that item more than the observer for better visual experience
     *
     * Use case: Article header is at the end of the page, and user clicks on the item.
     * (Normally observer will pick the previous item, but we want to pick the clicked item until we scroll)
     */
    private manualSelected;
    private readonly MAX_NESTED_LEVEL;
    private documentObserver;
    private rootObserver;
    private intersectionObserver?;
    constructor();
    runConnectedCallback(): void;
    disconnectedCallback(): void;
    /** Get the owner window */
    private get ownerWindow();
    /** Get all headings by role and aria-level, filtered to only include those with text content */
    private get headings();
    /** Extract all headings by role and aria-level */
    private extractHeadings;
    /**
     * Count how many wrapper levels exist between a heading and the root.
     * If the root is missing, return 0 so the heading is treated as not nested.
     */
    private getWrapperLevel;
    /** Extract root and set to state */
    private extractRoot;
    /** Query root node */
    handleRootSelectorChange(): void;
    handleRootChange(): void;
    /**
     * Setup the MutationObserver safely without recursion
     */
    private observeRootMutations;
    /** Watch autoSync property */
    handleAutoSyncChange(): void;
    /** Observe headings for scroll sync */
    private observeHeadings;
    private disconnectHeadingsObserver;
    /** Handle item click to scroll to section */
    private handleItemClick;
    updateCurrentHash(): void;
    private syncIndicator;
    private handleListKeyDown;
    render(): import('lit').TemplateResult<1>;
}
declare global {
    interface HTMLElementTagNameMap {
        'cx-page-outline': CxPageOutline;
    }
}
