export interface AttributesParentBase { /** all attributes / 全部属性 */ attributes: Record; /** class attribute in string / 以字符串表示的class属性 */ className: string; /** class attribute in Set / 以Set表示的class属性 */ readonly classList: Set; /** id attribute / id属性 */ id: string; /** * Check if the token has a certain attribute * * 是否具有某属性 * @param key attribute name / 属性键 */ hasAttr(key: string): boolean; /** * Get the attribute * * 获取指定属性 * @param key attribute name / 属性键 */ getAttr(key: string): string | true | undefined; /** * Get all attribute names * * 获取全部的属性名 */ getAttrNames(): Set; /** * Get all attributes * * 获取全部属性 */ getAttrs(): Record; /** * Set the attribute * * 设置指定属性 * @param key attribute name / 属性键 * @param value attribute value / 属性值 */ setAttr(key: string, value: string | boolean): void; setAttr(prop: Record): void; /** * Remove an attribute * * 移除指定属性 * @param key attribute name / 属性键 */ removeAttr(key: string): void; /** * Toggle the specified attribute * * 开关指定属性 * @param key attribute name / 属性键 * @param force whether to force enabling or disabling / 强制开启或关闭 */ toggleAttr(key: string, force?: boolean): void; /** * Get the value of a style property * * 获取某一样式属性的值 * @param key style property / 样式属性 * @param value style property value / 样式属性值 */ css(key: string, value?: string): string | undefined; } /** * 子节点含有AttributesToken的类 * @param i AttributesToken子节点的位置 */