UNPKG

@mescius/dsimageviewer

Version:

Document Solutions Image Viewer

53 lines (52 loc) 1.99 kB
export declare function getShadowRootOrDocument(elem?: HTMLElement): HTMLDocument | ShadowRoot; /** * Checks if element is nested within parent element on any level. * @param parent * @param child */ export declare function isDescendant(child: Element, parent: Element): boolean; /** * Find correct event target. * @param e */ export declare function getEventTarget(e: any): any; export declare function isInputArea(el: HTMLElement): boolean; export declare function isDefaultEditorEventAllowed(event: Event): boolean; /** * Cross-browser element.classList.contains * @param element HTML DOM element * @param className Class name without dot. */ export declare function classListContains(element: HTMLElement, className: string): boolean; /** * Search parent element by class name. * @param el HTML DOM element * @param className Class name without dot. */ export declare function findSelfOrAncestor(el: HTMLElement | null, className: string): HTMLElement | null; /** * Search parent element by attribute name. * @param el HTML DOM element * @param className Attribute name. */ export declare function findSelfOrAncestorAttr(el: HTMLElement | null, attrName: string): HTMLElement | null; /** * Get element's numerical index in its parent element. * @param el HTML DOM element */ export declare function findElementIndex(el: Element): number; export declare function isTouchEventsEnabled(): boolean; export declare function getEventCoordinates(event: MouseEvent | TouchEvent): { pageX: number; pageY: number; clientX: number; clientY: number; }; export declare function reversePopupRotation(popupWrapperToRotate: HTMLElement, rotation: number, iconToRotate?: HTMLElement): void; /** * Simulate mouse event. * @param element * @param eventType */ export declare function triggerMouseEvent(element: Element, eventType: string): void; export declare function triggerFullStackClick(element: Element): void;