import { Subscription } from 'rxjs'; import { NameValue } from '../global/types'; export declare const quarterMap: string[]; export declare const MONTHS: number[]; export declare const DAYS: number[]; export declare const HOURS: number[]; export declare const SCALE_POS: number[]; export declare const SCALE_NEG: number[]; export declare class AbmUtil { static findInArray(array: T[], field: number | string, key: number | string, contain?: boolean): T; static indexInArray(array: T[], field: string | number, key: number | string, contain?: boolean): number; static sortArray(array: T[], sortBy?: string | string[], desc?: boolean): T[]; static createArray(length?: number, fill?: T): T[]; static isGT(i: string, j: string): boolean; /** * compare 2 number|string * * return: * -1: op1 < op2 * 1: op1 > op2 * * @param op1 op1 * @param op2 op2 */ static compare(op1: number | string, op2: number | string): number; static getPropertyOrOthers(obj: any, property: string, other?: any): T; static removeFromArray(array: T[], field: string, key: string | number, contain?: boolean): T[]; static replaceInArray(array: T[], newItem: T, field: string, key: string | number): T[]; static checkProperties(data: any, ...properties: string[]): void; static getFileNameFromUrl(url: string): string; static extractPartOfTime(src: string, startPos: number, length?: number, append?: string): string; static objectToParamStr(body: { [name: string]: any; }): string; static hourStr(i: number): string; static quarterStr(i: number): string; static dashStr(...s: string[]): string; static sleep(ms: any): Promise; static dateAdd(offset: number, target?: Date): Date; /** * Transfer {key1:[v1,v2],key2:[v3,v4]} -> [{key1:v1,key2:v3},{key1:v2,key2:v4}] */ static zipData(obj: { [key: string]: any[]; }): { [key: string]: any; }[]; /** * Transfer [{key1:v1,key2:v3},{key1:v2,key2:v4}] -> {key1:[v1,v2],key2:[v3,v4]} */ static unzipData(obj: { [key: string]: any; }[]): { [key: string]: any[]; }; /** * get keys and values from an object. * * @param obj the object to be transferred */ static keysAndValues(obj: { [key: string]: any; }): { keys: string[]; values: any[]; }; static maxMinAvg(data: number[], decimal?: number): { max: number; min: number; avg: number; }; /** * return array of 3 values: max, min, avg * @param data input data array * @param decimal result round decimal */ static maxMinAvgArray(data: number[], decimal?: number): Array; static hexToRgb(hex: string, alpha?: number, returnString?: boolean): string | { r: number; g: number; b: number; }; static echartSize(size?: number): number; static formPath(file: string, ...paths: string[]): string; static assert(condition: any, msg?: string): asserts condition; static transferUnit(num: number, basicTitle?: string, askScale?: boolean): NameValue; static transferCnUnit(num: number, basicTitle?: string, askScale?: boolean): NameValue; private static _getScale; static transferUnitForMultiArray(nums: number[][], basicTitle?: string, language?: 'en' | 'cn'): { name: string; nums: number[][]; }; static transferUnitForArray(nums: number[], basicTitle?: string, language?: 'en' | 'cn'): { name: string; nums: number[]; }; /** * * @param type period type, currently support month, day, hour * @param all whether get periods untill today or get all periods. */ static getPeriods(type: 'M' | 'D' | 'H', all?: boolean): number[]; static get10Scale(scale: number): number; static randomInRange(from?: number, to?: number, int?: boolean): number; static alignWithZeroPrefix(nums: number[]): string[]; static unsubscribe(...subs: Subscription[]): void; }