UNPKG

reblend-typing

Version:
29 lines (28 loc) 1.44 kB
/** * A map of attribute keys to their corresponding standard HTML attribute names, default values, * or React-specific properties. The object supports various attribute types such as standard * HTML attributes, RDFa attributes, microdata attributes, React-specific attributes, and more. * * - If the value is a string, it represents the corresponding HTML attribute name. * - If the value is `null`, the attribute does not map to an HTML attribute (e.g., React-specific attributes like `children`). * - If the value is an object, it represents an attribute with a custom name that should be used for the corresponding property (e.g., `dangerouslySetInnerHTML` maps to the `innerHTML` property). * * @type {Record<string, string | null | { name: string }>} */ export declare const allAttribute: Record<string, string | null | { name: string; }>; /** * Determines whether to use `setAttribute` for a given attribute key. * * @param {string} key - The attribute key to check. * @returns {boolean} - Returns true if `setAttribute` should be used, false if the direct property should be accessed. */ export declare const shouldUseSetAttribute: (key: string) => boolean; /** * Returns the correct attribute name for a given key. * * @param {string} key - The key to be transformed into an attribute name. * @returns {string} - The corresponding attribute name. */ export declare const attributeName: (key: string) => string;