UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

13 lines (12 loc) 982 B
import type { ESLDomElementTarget } from '../abstract/dom-target'; export type ESLAttributeTarget = undefined | null | ESLDomElementTarget | ESLDomElementTarget[]; export type ESLAttributeDecorator = (target: ESLDomElementTarget, propName: string) => void; /** @returns true if attribute presented */ export declare function hasAttr($el: ESLAttributeTarget, name: string): boolean; /** @returns attribute or passed fallback value. Identical to getAttribute by default */ export declare function getAttr($el: ESLAttributeTarget, name: string): string | null; export declare function getAttr<T>($el: ESLAttributeTarget, name: string, fallback: T): string | T; /** Sets attribute */ export declare function setAttr($el: ESLAttributeTarget, name: string, value: undefined | null | boolean | string): void; /** Gets attribute value from the closest element with group behavior settings */ export declare function getClosestAttr($el: ESLAttributeTarget, attrName: string): string | null;