@tempots/dom

HeadlessAdapter.(constructor)

Constructs a new instance of the HeadlessAdapter class

Signature:

constructor({ select, getAttribute, setAttribute, getClass, setClass, getStyles, setStyles, appendHTML, getInnerHTML, setInnerHTML, getInnerText, setInnerText, }: {
        select: (selector: string) => EL[];
        getAttribute: (el: EL, attr: string) => string | null;
        setAttribute: (el: EL, attr: string, value: string | null) => void;
        getClass: (el: EL) => string | null;
        setClass: (el: EL, cls: string | null) => void;
        getStyles: (el: EL) => Record<string, string>;
        setStyles: (el: EL, styles: Record<string, string>) => void;
        appendHTML: (el: EL, html: string) => void;
        getInnerHTML: (el: EL) => string | null;
        setInnerHTML: (el: EL, html: string) => void;
        getInnerText: (el: EL) => string | null;
        setInnerText: (el: EL, text: string) => void;
    });

Parameters

Parameter

Type

Description

{ select, getAttribute, setAttribute, getClass, setClass, getStyles, setStyles, appendHTML, getInnerHTML, setInnerHTML, getInnerText, setInnerText, }

{ select: (selector: string) => EL[]; getAttribute: (el: EL, attr: string) => string | null; setAttribute: (el: EL, attr: string, value: string | null) => void; getClass: (el: EL) => string | null; setClass: (el: EL, cls: string | null) => void; getStyles: (el: EL) => Record<string, string>; setStyles: (el: EL, styles: Record<string, string>) => void; appendHTML: (el: EL, html: string) => void; getInnerHTML: (el: EL) => string | null; setInnerHTML: (el: EL, html: string) => void; getInnerText: (el: EL) => string | null; setInnerText: (el: EL, text: string) => void; }