import { IPosition } from "../const/sociosInterfaces"; export declare namespace DomUtils { const isLocalhost: boolean; function closeSoftKeyboard(): void; function insideIframe(): boolean; function copyToClipboard(field: HTMLInputElement): void; function addPixel(url: string): void; function removePixel(url: string): void; function getScrollElement(doc?: Document): Element; /** * * @param url * @param callback * @param context */ function loadStylesheet(url: string, callback?: () => void, context?: Document | null): void; /** * get highest css z-index in tree * @param domNode */ function getHighestZIndex(domNode: Element): number; /** * loadScript({src:"myurl" 'data-key':1}); * @param data * @param context */ function loadScript(data: { src: string; }, context?: Document | null): void; function loadStyleSheet(url: string): HTMLLinkElement; function onClickOutsideOf(html: HTMLElement, callback: (e: Event) => void): void; function heightOfChildren(): void; /** * will fire on scroll change (DOM Friendly) */ function onFrameScroll(callback: (scrollPosition: number) => void): void; function waitForData(name: string, context?: Window): Promise; /** * if you want to offset to the window just use getBoundingClientRect * @param el * @param screenOffset */ function localToGlobal(el: HTMLElement): IPosition; /** * fires promise when ready */ function onDomReady(): Promise; function fade(elem: HTMLElement, options?: { duration?: number; from?: number; to?: number; }): Promise; /** * * @param html * @param viewOffset * @param percentageInView */ function inView(html: HTMLElement, viewOffset?: { left: number; top: number; bottom: number; right: number; }, percentageInView?: number): boolean; function insertAfter(newNode: Element, referenceNode: Element): void; function insertBefore(newNode: Element, referenceNode: Element): void; function insertAt(item: HTMLElement, listContainer: HTMLElement, position: number): number; /** * * @param toWrap * @param wrapperS */ function wrap(toWrap: HTMLElement, wrapperS: string): HTMLElement; /** * create htmls by string * createElement("
") ->
* @param htmlString */ function createElements(htmlString: string): HTMLCollection; /** * create html by string * createElement("

test

") ->

test

* @param htmlString */ function createElement(htmlString: string): HTMLElement; /** * like querySelectorAll but will give an live node list (means faster) * @param selector * @param context */ function query(selector: string, context: any): HTMLElement[]; function scrapeItemProps(html: HTMLElement): any; /** * It might be better to use Array.prototype.forEach.call by yourself to prevent this extra function call * forEach over html collection * @param elems * @param func */ function forEach(elems: E[] | NodeList | NodeListOf | HTMLCollectionOf, callbackfn: (elem: E, index: number) => void): any; /** * It might be better to use Array.prototype.reduce.call by yourself to prevent this extra function call * reduce over html collection * @param elems * @param func */ function reduce(elems: E[] | NodeList | NodeListOf | HTMLCollectionOf, callbackfn: (previousValue: E, currentValue: E, currentIndex: number, array: E[]) => E, initialValue: E): any; /** * It might be better to use Array.prototype.some.call by yourself to prevent this extra function call * some over html collection * @param elems * @param func */ function some(elems: E[] | NodeList | NodeListOf | HTMLCollectionOf, callbackfn: (elem: E, index: number) => void): any; /** * map over html collection * * @param elems * @param func */ function map(elems: HTMLElement | NodeList | NodeListOf | HTMLCollectionOf, func: (elem: HTMLElement) => any): any[]; /** * check if it has no children * @param elems */ function empty(elems: HTMLElement | NodeListOf): void; }