import type { Moment } from 'moment'; import type { TKeyValue } from '../core'; /** * 将url拆分成列表 * @param url 要转换的url * @returns 拆分后的数组 * @example /userinfo/2144/id => ['/userinfo','/useinfo/2144,'/userindo/2144/id'] */ export declare function urlToList(url?: string): string[]; /** * 判断对象是否是Promise类型 * @param {any} obj 要判断的对象 * @returns {boolean} 如果是 返回true,否则 false */ export declare function isPromise(obj: any): boolean; /** * 判断给定的字符串是否是个url地址 * @param path 地址 * @returns {boolean} 如果是 返回 true,否则 false */ export declare const isUrl: (path: string) => boolean; /** * 将数组对象转换成object对象 * @param items 要转换的数组 * @param key 作为key的属性名 默认为 'label' * @param value 作为值的属性名 默认为'value' * @example listToFlat([{label:'label1',value:'001'},{label:'label2',value:'002'}],'value','label')==>{'001':'label1','002':'label2'}]) * @returns TKeyValue * @summary 建议配合memoize方法使用避免不必要的转换,提高性能 */ export declare function listToFlat(items: T[], key?: string | number, text?: string): TKeyValue; /** * 判断是否是浏览器环境 */ export declare const isBrowser: () => boolean; /** * 获取查询对象 */ export declare const getPageQuery: () => import("querystring").ParsedUrlQuery; /** * * @param {object} * @param {Moment} param.date * @param {string} param.format 格式 默认为年月日 */ export declare function getDateString({ date, format, }: { date: string | Moment; format?: string; }): string; /** * 补足两位数字(example:02) * @param val 值 */ export declare function fixedZero(val: number): string; /** * 生成guid * @param withSplit [true|false] 是否带分隔符 */ export declare function newGuid(withSplit?: boolean): string; /** * 打码显示,ex: 18585858585==> 185*****222 * @param text 加密前的内容 * @param type 类型 mobile:手机 phone:电话号码 fax:传真号码 mail:邮箱 card:银行卡 identity:身份证 name:姓名 */ export declare function formatSecuredInfo(text: string, type: 'mobile' | 'phone' | 'fax' | 'mail' | 'card' | 'identity' | 'name', filterNA?: boolean): string; /** * 对数据源按key进行相邻行合并,返回生成的跨行对象,建议使用memoizeOne进行缓存调用 * @param list 要进行合并的数据源列表 * @param key key * @example mergeCells([{name:'xxg',title:'code'},{name:'刘德华',title:'code'},{name:'古天乐',title:'other'}],'title')==>{0:2,1:0,2:1} */ export declare function mergeCells(list: T[], key: string | ((item: T) => string)): TKeyValue;