UNPKG

smart-react-components

Version:

React UI library, wide variety of editable ready to use Styled and React components.

64 lines (63 loc) 2.16 kB
import { SizeStrictProps } from "../props/size-strict-props"; import { Theme } from "../theme"; export default class DOMHelper { static TRANSITION_END: string[]; static MOUSE_WHEEL: string[]; static requestAnimationFrame: Function; static isServer: boolean; static isMobile: boolean; /** * Attaches events to the given element. * * @param el * @param events * @param callback * @param options */ static addEventListener(el: HTMLElement | Document | Window, events: string[], callback: (e: Event) => void, options?: boolean | AddEventListenerOptions): void; /** * Removes events from the given element. * * @param el * @param events * @param callback * @param options */ static removeEventListener(el: HTMLElement | Document | Window, events: string[], callback: (e: Event) => void, options?: boolean | EventListenerOptions): void; /** * Attaches events to the given element for once. * * @param el * @param events * @param callback * @param addOptions * @param removeOptions */ static addEventListenerOnce(el: HTMLElement | Document | Window, events: string[], callback: (e: Event) => void, addOptions?: boolean | AddEventListenerOptions, removeOptions?: boolean | EventListenerOptions): void; /** * Checks if target is a clickable element. * * @param target * @param container */ static checkIfTargetIsClickable(target: HTMLElement, container: HTMLElement): boolean; /** * Gets breakpoint key by window size. * * @param sb * @param theme */ static getBreakpointKey({ size, sizeSm, sizeMd, sizeLg, sizeXl }: SizeStrictProps, theme: Theme): string; /** * Gets scroll parent of the given element. * * @param el */ static getScrollParent(el: HTMLElement): HTMLElement; /** * Checks if an element can be rendered in the React portal. * * @param renderInPortal */ static canBeRenderedInPortal(renderInPortal: boolean): boolean; }