export type TGetElWrapperArgs = Parameters; export type TGetElWrapperReturn = ReturnType; /** * Gets a wrapper for specific element * @param el{HTMLElement} DOM element * @param str{string} string of wrapper HTML layout (supports nested blocks) * @returns {HTMLElement} * @throws {TypeError} getElWrapper: el must be an HTMLElement * @throws {TypeError} getElWrapper: str must be a non-empty string * @throws {TypeError} getElWrapper: str must contain an HTML element * @example * // How to wrap content to the few nested `div` blocks? * //
My Element
* const wrapperLayout = ` *
*
*
* `; * const el = document.getElementById("block"); * const wrapped = getElWrapper(el, wrapperLayout); * console.log(wrapped.outerHTML); // => `
My Element
` * @example * // Wrap a form field with reusable validation markup * const fieldWrapper = getElWrapper(input, ` * * `); */ export declare const getElWrapper: (el: HTMLElement, str: string) => HTMLElement;