import { DataType } from '../types/data_type'; export declare namespace utils { function getAllDataTypes(): DataType[]; function getDateDataTypes(): DataType[]; function getStringDataTypes(): DataType[]; function getNumericDataTypes(): DataType[]; /** * Copy the content of all objests passed in `args` parameters into `target` * and returns the result * NB: This function copies only the first level properties. * For a deep copy please use `assignDeep` * @param target - the target object * @param args - an array of the source objects */ function assign(target: any, ...args: any[]): any; /** * Copy the content of all objests passed in `args` parameters into `target` * and returns the result * NB: This function make a deep copy - * so `assignDeep` will be called recursively for all object properties * on the first level. * @param target - the target object * @param sources - an array of the source objects */ function assignDeep(target: any, ...sources: any[]): any; function getIfDefined(value: T, defaultValue: T): T; function IsDefinedAndNotNull(value: any): boolean; /** * Represents any object which hs `id` property */ interface ItemWithId { id: any; } function copyArrayTo(collection1: any, collection2: any): void; function createArrayFrom(collection: any): any; /** * Searches an array of the objects which implement ItemWithId by ID * Returs the found object or null. * @param array * @param id */ function findItemById(array: Array, id: any): T; function findItemIndexById(array: Array, id: any): number; /** * Searches an array of the objects which implement ItemWithId by ID * Returs the index of the found element, or -1 if nothing was found. * @param array * @param id */ function indexOfArrayItem(arr: Array, item: T): number; /** * Moves an item in some array to a new position * @param array * @param index1 * @param index2 */ function moveArrayItem(array: Array, index1: number, index2: number): void; /** * Searches for a particular item in the array are removes that item if found. * @param arr * @param value */ function removeArrayItem(arr: Array, value: T): T; function insertArrayItem(arr: Array, index: number, value: T): void; function fillArray(arr: Array, value: T, start?: number, end?: number): T[]; /** * Calculates the shift on which we need to move our element horizontally * to find current window * @param absLeft * @param width */ function shiftToFitWindow(absLeft: number, width: number): number; /** * Returns `true` if the value passed in the parameter is an object * @param val */ function isObject(val: any): boolean; /** * Returns `true` if the `DataType` value passed in the parameter * represents some numeric type * @param dtype */ function isNumericType(dtype: DataType): boolean; /** * Returns `true` if the `DataType` value passed in the parameter * represents some numeric type * @param dtype */ function isIntType(dtype: DataType): boolean; /** * Returns `true` if the value passed in the parameter is an a numeric value * @param val */ function isNumeric(val: any): boolean; /** * Returns `true` if two data types passed in parameters * are compatible - so it's safe to copy the values between * two expressions with these two types * @param type1 * @param type2 */ function areCompatibleDataTypes(type1: DataType, type2: DataType): boolean; /** * Returns `true` if the property with named `propName` * in the object `obj` has some value * @param obj * @param propName */ function isPropSet(obj: any, propName: any): any; /** * Generates an unique ID */ function generateId(prefix: string): string; function strToDateTime(value: string, format: string): Date; function strToTime(str: string): Date; }