@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
24 lines (23 loc) • 1.04 kB
TypeScript
/** Checks that passed value is an DOM Element Node */
export declare const isElement: (el: any) => el is Element;
/**
* Get the Element that is the root element of the document.
* @param element - element for which to get the document element
* */
export declare const getDocument: (element?: Element | Window) => Element;
/**
* Get the name of node.
* @param element - element for which to get the name
*/
export declare const getNodeName: (element?: Node | Window) => string;
/**
* Get the parent of the specified element in the DOM tree.
* @param element - element for which to get the parent
*/
export declare const getParentNode: (element: Element | ShadowRoot) => Node;
/**
* Converts HTML string or other input to a DOM Element.
* @param input - HTML string to parse, Element to return as-is, or array of elements to get first from
* @returns DOM Element, or undefined if no element can be resolved from the input
*/
export declare const htmlToElement: (input: string | Element | Element[]) => Element | undefined;