import { ValueTypeEnum } from '../enum'; import { CryptoParamsType } from '../globalConfig'; import { type IObject } from '../interface'; export declare const temporaryUrlKey = "temporary_url_params"; declare function clearTemporaryCache(md5?: string): void; declare function handleURL(url: string, params?: IObject | undefined, isHttp?: boolean): string; declare function handleData(data: any): any; declare const CacheObj: any; /** * 可以单独使用的基础函数 */ declare const util: { /** * 获取当前登录用户信息 */ getUser(): T; /** * 设置当前登录用户信息 * @param user */ setUser(user?: IObject): void; getRoot(): string; /** * 封装请求地址 */ getHttpUrl(url: string, root?: any): string; toFirstUpperCase(str: string): string; extend: (...args: any[]) => any; extendIgnoreCase: (...args: any[]) => any; assign: (objA: any, objB: any) => false | Record; clearObject: (obj: any) => void; numberPrecision(value: any, precision?: number): number; thousandNumber(value: any, options?: { separator?: string; includeDecimal?: boolean; precision?: number; }): any; uniqueId(key?: string, n?: number): string; deepCopyEx: (obj: any) => any; copyText(text: any): void; deepMerge(objA: object, objB: object, except?: string[]): object; getAggregate: (type: any, dataArr: any[], key?: string) => number | "-" | "*****"; flatArray: (arr: any[], depth?: number) => any; flatTree(rows: any, childrenKey?: string): T_1[]; filterTree: (nodes: IObject[], predicate: (node: any) => boolean, options?: { childrenKey?: string; leafKey?: string; includeChildren?: boolean; }) => any; groupBy: (dataArr: any[], f: (arg0: any) => any) => any; /** * 对象比较 * @param props * @param nextProps * @param config */ isObjectEqual(props: any, nextProps: any, config?: { shallow?: boolean; exclude?: string[]; }): boolean; /** * 属性比较 * @param props * @param nextProps * @param config */ isPropsEqual(props: any, nextProps: any, config?: { shallow?: boolean; exclude?: string[]; }): boolean; isArrayEqual(arr1: any[], arr2: any[], config?: { shallow?: boolean; exclude?: string[]; }): boolean; /** * 返回指定路径的对象或值 * @param obj 被查询的对象 {a:{b:[1,2]}} * @param path 对象地址,例如 "a.b[0]" */ getValueByPath: (obj: any, path: string) => any; getBirthDay({ idCard, format }: { idCard: any; format?: string | undefined; }): any; getAge({ idCard, birth, format }: { idCard?: string | undefined; birth?: string | undefined; format?: string | undefined; }): any; strToDate(dateStr: any): Date; formatDate(dateStr: any, format?: string): any; addDate(date: any, count: number, type?: 'year' | 'month' | 'date' | 'hours' | 'minutes' | 'seconds' | 'milliseconds', format?: string): string | Date; regExpTest: (regExp: string | Function, value: any) => any; convertData: (data: any, dataType: ValueTypeEnum, format?: string) => any; getScrollBarInfo(container?: HTMLElement, cache?: boolean): any; getQueryValue(queryName?: string, options?: string | { search?: string; ignoreCase?: boolean; decode?: boolean; cache?: boolean; }): any; setCookie(name: string, value: string, days?: number, path?: string): void; getCookie(name: any, dv?: any): any; handleData: typeof handleData; handleUrl: typeof handleURL; debounce: (func: any, wait: number, immediate?: boolean) => (...payload: any[]) => any; throttle: (func: any, wait: number, options?: { leading?: boolean; trailing?: boolean; }) => (...payload: any[]) => any; /** * 查找满足条件的父元素(包括自己) * @param el 当前元素 * @param fn 条件 */ closest(el: any, fn: (el: any) => boolean): any; /** * 获取dom节点的样式属性 * @param dom * @param attr */ getStyle(dom: any, attr: any): any; /** * 配合await延时 * @param timestamp 延时毫秒数 */ delay: (timestamp: number) => Promise; /** * 获取当前光标位置 */ getCursorPosition(element?: any): any; getSelectionEnd(): any; /** * 设置光标位置 * @param ctrl 元素 * @param pos 位置 */ setCursorPosition(ctrl: any, pos: any): void; /** * 组合classname * @param cls 样式集合 */ classNames(...cls: Array>): string; CryptoJS: { encode(word: any, opt?: CryptoParamsType): any; decode(word: any, opt?: CryptoParamsType): any; getCryptoJS(): any; }; sm4: { encode(word: any, key?: string): any; decode(encodeWord: any, key?: string): any; getSm(): any; }; /** * base64方法 */ Base64: { encode(data: any, useCryptoJS?: boolean): any; decode(encodedData: string, useCryptoJS?: 'Utf8' | 'Utf16' | 'Utf16BE' | 'Utf16LE' | boolean): any; }; /** * 文件下载 * @param url 下载地址 * @param filename 文件名 * @param blob Blob对象,优先级高于url * @param withToken 下载需要token,url下载采用ajax请求返回blob实现 */ downLoad({ url, filename, blob, withToken }: { url?: string | undefined; filename?: string | undefined; blob?: Blob | undefined; withToken?: boolean | undefined; }): Promise; /** * 获取当前相对路径的绝对路径 * @param url 相对路径 * @returns */ getAbsoluteUrl(url: any): string; /** * 调试 * @param param */ debug(param: { msg: any; type?: 'log' | 'warn' | 'error'; } | string | Array): void; /** * 获取对象的值 * @param obj 对象 * @param pathKeys 路径 * @param emptyValue 空值 */ getObjValue(obj: any, pathKeys: any, emptyValue?: any): any; /** * 设置对象的值 * @param obj 对象 * @param pathKeys 路径 * @param value 值 */ setObjValue(obj: any, pathKeys: any, value: any): void; deleteObjKey(obj: any, pathKeys: any): void; /** * 分隔字符串 * @param str * @param _split */ split(str: any, _split?: string): string[]; /** * 字符长度 */ strLen(str: string, chnlen?: number): number; /** * 动画结束回调 * @param el 监听动画的元素 * @param callback 回调事件 */ addAnimationend(el: any, callback: any): () => void; stopPropagation(e: any): void; isPromise(obj: any): obj is Promise; isArray(arr: any): arr is any[]; isFunction(fn: any): fn is Function; isObject(obj: any): obj is Record; isNumber(v: any): v is number; isString(str: any): str is string; isBoolean(obj: any): obj is boolean; isDate(date: any): date is Date; isNullOrEmpty(val: any, except?: "" | null | undefined): boolean; isEmptyArray(arr: any): boolean; isSymbol(value: any): value is Symbol; isDOMNode(obj: any): any; deepCopy(obj: any, structuredClone?: boolean): any; validJson(jsonStr: string, type?: "Array" | "Object" | ("Array" | "Object")[]): boolean; jsonString(json: any, undefinedValue?: any): string; parseJson: (jsonStr: any) => any; firstCase(str: string): string; toLowerCamelCase(str: string): string; camelCaseToField(str: string, split?: string): string; loopChildren(data: any, todo: (row: any, i: number, level: number, parents: any) => boolean | void, level?: number, parents?: any, childrenKey?: string): false | undefined; setCache(key: string, value: any, option?: { type: "local" | "session"; } | undefined): void; getCache(key: string, option?: boolean | { type?: "local" | "session" | undefined; toObject?: boolean | undefined; }): T_2; removeCache(key: string, option?: { type: "local" | "session"; } | undefined): void; }; /** * 初始化自定义的css3变量 * @param colorVal * @param themeObj */ declare function initCustomThemeColor(colorVal: any, config: { env?: 'mobile' | 'pc'; themeObj?: IObject; cssVars: { body: IObject; global: IObject; pc: IObject; mobile: IObject; }; appName?: string; }): void; declare function insertCss(cssText: string, styleId?: string): () => void; export { util, CacheObj, initCustomThemeColor, insertCss, clearTemporaryCache };