import { Token } from '../prism/index'; import { Extension } from '..'; /** * Tuple containing in the following order: * - The tag's `Token` * - Its starting position * - Its ending position * - Its tag name * - Whether it's a closing tag * - Whether it isn't self-closing */ export type Tag = [Token, number, number, string, boolean, boolean]; export interface TagMatcher { /** * Array of tuples containing in the following order: * - The tag's `Token` * - Its starting position * - Its ending position * - Its tag name * - Whether it's a closing tag * - Whether it isn't self-closing */ readonly tags: Tag[]; /** Array mapping the index of a tag to the index of its matching tag. */ readonly pairs: (number | undefined)[]; } /** * Extension that traverses the tokens and matches tags together. * Used by {@link highlightMatchingTags} and {@link highlightTagPunctuation} */ declare const matchTags: () => Extension; /** * Extension that adds an `active-tagname` class to matching HTML/XML/JSX tags when the * cursor is on either tag. It's required to have the {@link matchTags} extension for this * to work. Use the CSS selector `.active-tagname` to style the elements. */ declare const highlightMatchingTags: () => Extension; /** * Extension that highlights `<` and `>` punctuation in XML tags. * It's required to have the {@link matchTags} extension for this to work. * @param className Class added to the active punctuation you can use to style them with CSS. * @param alwaysHighlight If true, the punctuation will always be highlighted when the cursor * is inside a tag. If not it will only be highlighted when the cursor is on the punctuation. */ declare const highlightTagPunctuation: (className: string, alwaysHighlight?: boolean) => Extension; export { matchTags, highlightTagPunctuation, highlightMatchingTags };