import { BoundingRect } from '../lib/rect'; import { Token } from './index'; import { AtomToken } from './atom'; import { AttributeToken } from './attribute'; import type { Config, LintError } from '../base'; import type { ExtToken, HtmlToken, SyntaxToken } from '../internal'; import type { AttributeTypes } from './attribute'; import type { TableTokens } from './table/index'; declare type AttributesTypes = `${AttributeTypes}s`; declare type Child = AtomToken | AttributeToken; /** * 将属性类型转换为单属性类型 * @param type 属性类型 */ export declare const toAttributeType: (type: AttributesTypes) => AttributeTypes; /** * attributes of extension and HTML tags * * 扩展和HTML标签属性 * @classdesc `{childNodes: (AtomToken|AttributeToken)[]}` */ export declare abstract class AttributesToken extends Token { #private; readonly name: string; readonly childNodes: readonly Child[]; abstract get firstChild(): Child | undefined; abstract get lastChild(): Child | undefined; abstract get parentNode(): ExtToken | HtmlToken | TableTokens | undefined; abstract get previousSibling(): SyntaxToken | undefined; get type(): AttributesTypes; /** * @param attr 标签属性 * @param type 标签类型 * @param name 标签名 */ constructor(attr: string | undefined, type: AttributesTypes, name: string, config: Config, accum?: Token[]); /** * Get all AttributeTokens with the specified attribute name * * 所有指定属性名的AttributeToken * @param key attribute name / 属性名 */ getAttrTokens(key?: string): AttributeToken[]; /** * Check if the token has a certain attribute * * 是否具有某属性 * @param key attribute name / 属性键 */ hasAttr(key: string): boolean; /** * Get the last AttributeToken with the specified attribute name * * 指定属性名的最后一个AttributeToken * @param key attribute name / 属性名 */ getAttrToken(key: string): AttributeToken | undefined; /** * Get the attribute * * 获取指定属性 * @param key attribute name / 属性键 */ getAttr(key: string): string | undefined; } export {};