import type { TagToken } from '../common/token.js'; import type { TreeAdapterTypeMap } from '../tree-adapters/interface.js'; export declare enum EntryType { Marker = 0, Element = 1 } interface MarkerEntry { type: EntryType.Marker; older: Entry | null; newer: Entry | null; /** The index of the entries before this marker. */ outerIndex: RegionIndex | null; } /** The entries with one tag name after one marker are chained from a head, newest first. */ interface SameTagLink { olderSameTag: ElementEntry | null; } export interface ElementEntry extends SameTagLink { type: EntryType.Element; element: T['element']; token: TagToken; older: Entry | null; newer: Entry | null; /** The entry's group of entries with the same tag name and attributes; null until indexed. */ ark: Ark | null; /** The next newer entry with the same tag name, or the chain's head; null until indexed. */ newerSameTag: SameTagLink | null; } export type Entry = MarkerEntry | ElementEntry; /** The entries after one marker with one tag name and attributes, oldest first, and their key in the region's arks. */ interface Ark { entries: ElementEntry[]; key: string; } /** The entries after one marker by tag name and attributes, and the newest of them by tag name. */ interface RegionIndex { arks: Map>; tagNames: Map>; } export declare class FormattingElementList { newest: Entry | null; bookmark: Entry | null; /** The index of the entries after the last marker; null only while there are at most NOAH_ARK_CAPACITY of them. */ private index; /** The entries by element, except possibly those after the last marker while they are not indexed. */ private elementEntries; /** Returns the entry's ark, or null if the entries after the last marker are not indexed. */ private _insertElementEntry; private _addToIndex; insertMarker(): void; pushElement(element: T['element'], token: TagToken): void; insertElementAfterBookmark(element: T['element'], token: TagToken): void; removeEntry(entry: ElementEntry): void; replaceElement(entry: ElementEntry, element: T['element']): void; /** * Clears the list of formatting elements up to the last marker. * * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker */ clearToLastMarker(): void; getElementEntryInScopeWithTagName(tagName: string): ElementEntry | null; getElementEntry(element: T['element']): ElementEntry | undefined; } export {};