Forest.js Core Documentation - v1.2.3
    Preparing search index...

    Type Alias Utility<E>

    Utility: (el: E) => E

    A utility function that takes an element, applies transformations, and returns the modified element. Typically used to enhance or manipulate the DOM element in a declarative way.

    Type Parameters

    • E extends Element

      The type of element the utility operates on.

    Type declaration

      • (el: E): E
      • Parameters

        • el: E

        Returns E

    const addClass: Utility<HTMLDivElement> = (el) => {
    el.classList.add("highlight");
    return el;
    };