UNPKG

@forest-js/core

Version:

A tiny, functional DOM engine with explicit update and real DOM.

20 lines 764 B
import { StoreMap, Utility, UtilityProps } from "../types"; /** * @function addAttribute * @description Adds attributes to an element. * Supports reactive attributes when using stores. * * @template E - Element type. * @template R - Object with attributes to add. * @template S - StoreMap type when used reactively. * @param args - Attributes or store and mapper function * @returns Utility function for adding attributes * @example * ```ts * const addTitle = addAttribute<HTMLDivElement, { title: string }>( * { title: "Hello" } * )(MyElement); * ``` */ export declare const addAttribute: <E extends Element, R extends Partial<E>, S extends StoreMap = StoreMap>(...args: UtilityProps<R, S>) => Utility<E>; //# sourceMappingURL=attribute.d.ts.map