UNPKG

@true-directive/base

Version:

The set of base classes for the TrueDirective Grid

46 lines (45 loc) 1.6 kB
/** * Copyright (c) 2018-2019 Aleksey Melnikov, True Directive Company. * @link https://truedirective.com/ * @license MIT */ export declare class Utils { /** * Is the element ancestor to the given element. * @param ancestor Element to check. * @param element An element that may be descendant * @return True if the first element is an ancestor of the second element. */ static isAncestor(ancestor: any, element: any): boolean; /** * Is given element has ancestor with given css-class * @param element Element to check * @param ancestorClass class * @return True if the first element has an ancestor with given class. */ static isClassDescendant(element: any, ancestorClass: string): boolean; /** * Moving item inside the array. * @param arr Array. * @param oldIndex Old index. * @param newIndex New index. */ static moveArrayItem(arr: any[], oldIndex: number, newIndex: number): void; /** * Removes html tags from the string. * @param txt String to remove tags * @return String without tags. */ static htmlToPlaintext(txt: string): string; static readonly userAgent: string; static detectIOS(): boolean; static detectFirefox(): boolean; static detectSafari(): boolean; static detectAndroid(): boolean; static detectMobile(): boolean; static detectIE(): boolean; /** * Returns date if it is valid or null if not. */ static purifyDate(v: any): any; }