/** 任意函数 */ type AnyFunc = (...args: any[]) => R; /** 任意数组 */ type AnyArray = any[]; /** 取出数组元素 */ type ArrayElements = A extends Array ? R : never; /** 任意对象 */ type AnyObject = Record; type PartialDeep = { [P in keyof T]?: PartialDeep; }; /** * 判断对象内是否有该静态属性 * @param {object} obj * @param {string} key * @returns {boolean} */ declare function objectHas(obj: T, key: keyof T): boolean; /** * 判断一个对象是否为类数组 * * @param any * @returns {boolean} */ declare function arrayLike(any: unknown): boolean; /** * 判断任意值的数据类型,检查非对象时不如typeof、instanceof的性能高 * * 当检查类对象时是不可靠的,对象可以通过定义 Symbol.toStringTag 属性来更改检查结果 * * 详见:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/toString * @param {unknown} any * @returns */ declare function typeIs(any: unknown): 'Null' | 'Undefined' | 'Symbol' | 'Boolean' | 'Number' | 'String' | 'Function' | 'Date' | 'RegExp' | 'Map' | 'Set' | 'ArrayBuffer' | 'Object' | 'Array' | 'Error' | 'BigInt' | 'Promise' | 'AsyncFunction' | string; declare const isString: (any: unknown) => any is string; declare const isBoolean: (any: unknown) => any is boolean; declare const isSymbol: (any: unknown) => any is symbol; declare const isBigInt: (any: unknown) => any is bigint; declare const isNumber: (any: unknown) => any is number; declare const isUndefined: (any: unknown) => any is undefined; declare const isNull: (any: unknown) => any is null; declare const isPrimitive: (any: unknown) => boolean; declare function isNullOrUnDef(val: unknown): val is null | undefined; declare const isObject: (any: unknown) => any is Record; declare const isArray: (any: unknown) => any is unknown[]; /** * 判断是否为函数 * @param {unknown} any * @returns {boolean} */ declare const isFunction: (any: unknown) => any is Function; declare const isNaN: (any: unknown) => any is number; declare const isDate: (any: unknown) => any is Date; declare const isError: (any: unknown) => any is Error; declare const isRegExp: (any: unknown) => any is RegExp; /** * 判断一个字符串是否为有效的 JSON, 若有效则返回有效的JSON对象,否则false * @param {string} str * @returns {Object | boolean} */ declare function isJsonString(str: string): Object | boolean; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * isEmpty(null); * // => true * * isEmpty(true); * // => true * * isEmpty(1); * // => true * * isEmpty([1, 2, 3]); * // => false * * isEmpty({ 'a': 1 }); * // => false */ declare function isEmpty(value: any): boolean; /** * 遍历数组,返回 false 中断遍历(支持continue和break操作) * * @param {ArrayLike} array * @param {(val: V, idx: number) => any} iterator 迭代函数, 返回值为true时continue, 返回值为false时break * @param {boolean} reverse 是否倒序 * @returns {*} */ declare function arrayEach(array: ArrayLike, iterator: (val: V, idx: number, arr: ArrayLike) => boolean | void, reverse?: boolean): void; /** * 异步遍历数组,返回 false 中断遍历 * @param {ArrayLike} array 数组 * @param {(val: V, idx: number) => Promise} iterator 支持Promise类型的回调函数 * @param {boolean} reverse 是否反向遍历 * @example * 使用范例如下: * const start = async () => { * await arrayEachAsync(result, async (item) => { * await request(item); * count++; * }) * console.log('发送次数', count); * } * for await...of 使用范例如下 * const loadImages = async (images) => { * for await (const item of images) { * await request(item); * count++; * } * } */ declare function arrayEachAsync(array: ArrayLike, iterator: (val: V, idx: number) => Promise | any, reverse?: boolean): Promise; /** * 插入到目标位置之前 * @param {AnyArray} array * @param {number} start * @param {number} to * @returns {*} */ declare function arrayInsertBefore(array: AnyArray, start: number, to: number): void; /** * 数组删除指定项目 * @param {V[]} array * @param {(val: V, idx: number) => boolean} expect * @returns {V[]} */ declare function arrayRemove(array: V[], expect: (val: V, idx: number) => boolean): V[]; declare const isValidDate: (any: unknown) => any is Date; interface DateObj { [propName: string]: string; } type DateValue = number | string | Date; /** * 解析为Date对象 * @param {DateValue} value - 可以是数值、字符串或 Date 对象 * @returns {Date} - 转换后的目标Date */ declare function dateParse(value: DateValue): Date; /** * 格式化为日期对象(带自定义格式化模板) * @param {DateValue} value 可以是数值、字符串或 Date 对象 * @param {string} [format] 模板,默认是 YYYY-MM-DD HH:mm:ss,模板字符: * - YYYY:年 * - yyyy: 年 * - MM:月 * - DD:日 * - dd: 日 * - HH:时(24 小时制) * - hh:时(12 小时制) * - mm:分 * - ss:秒 * - SSS:毫秒 * @returns {string} */ /** * 将日期转换为一天的开始时间,即0点0分0秒0毫秒 * @param {DateValue} value * @returns {Date} */ declare function dateToStart(value: DateValue): Date; /** * 将日期转换为一天的结束时间,即23点59分59秒999毫秒 * @param {DateValue} value * @returns {Date} */ declare function dateToEnd(value: DateValue): Date; /** * 格式化为日期对象(带自定义格式化模板) * @param {Date} value - 可以是数值、字符串或 Date 对象 * @param {string} [format] - 模板,默认是 YYYY-MM-DD HH:mm:ss,模板字符: * - YYYY:年 * - yyyy: 年 * - MM:月 * - DD:日 * - dd: 日 * - HH:时(24 小时制) * - mm:分 * - ss:秒 * - SSS:毫秒 * - ww: 周 * @returns {string} 格式化后的日期字符串 */ declare function formatDate(value: DateValue, format?: string): string; /** * 计算向前或向后N天的具体日期 * @param {DateValue} originDate - 参考日期 * @param {number} n - 正数:向后推算;负数:向前推算 * @param {string} sep - 日期格式的分隔符 * @returns {string} 计算后的目标日期 */ declare function calculateDate(originDate: DateValue, n: number, sep?: string): string; /** * 计算向前或向后N天的具体日期时间 * @param {DateValue} originDateTime - 参考日期时间 * @param {number} n - 正数:向后推算;负数:向前推算 * @param {string} dateSep - 日期分隔符 * @param {string} timeSep - 时间分隔符 * @returns {string} 转换后的目标日期时间 */ declare function calculateDateTime(originDateTime: DateValue, n: number, dateSep?: string, timeSep?: string): string; /** * 判断对象是否为纯对象 * @param {object} obj * @returns {boolean} */ declare const isPlainObject: (obj: unknown) => boolean; /** * 遍历对象,返回 false 中断遍历 * @param {O} obj * @param {(val: O[keyof O], key: keyof O) => (boolean | void)} iterator */ declare function objectEach(obj: O, iterator: (val: O[keyof O], key: Extract) => any): void; /** * 异步遍历对象,返回 false 中断遍历 * @param {O} obj * @param {(val: O[keyof O], key: keyof O) => (boolean | void)} iterator */ declare function objectEachAsync(obj: O, iterator: (val: O[keyof O], key: Extract) => Promise | any): Promise; /** * 对象映射 * @param {O} obj * @param {(val: O[keyof O], key: Extract) => any} iterator * @returns {Record, T>} */ declare function objectMap(obj: O, iterator: (val: O[keyof O], key: Extract) => any): Record, T>; /** * 对象提取 * @param {O} obj * @param {K} keys * @returns {Pick>} */ declare function objectPick[]>(obj: O, keys: K): Pick>; /** * 对象去除 * @param {O} obj * @param {K} keys * @returns {Pick>} */ declare function objectOmit[]>(obj: O, keys: K): Omit>; type ObjectAssignItem = AnyObject | AnyArray; /** * 对象合并,返回原始对象 * @param {ObjectAssignItem} source * @param {ObjectAssignItem | undefined} targets * @returns {R} */ declare function objectAssign(source: ObjectAssignItem, ...targets: (ObjectAssignItem | undefined)[]): R; /** * 对象填充 * @param {Partial} source * @param {Partial} target * @param {(s: Partial, t: Partial, key: keyof R) => boolean} fillable * @returns {R} */ declare function objectFill(source: Partial, target: Partial, fillable?: (s: typeof source, t: typeof target, key: keyof R) => boolean): R; /** * 获取对象指定层级下的属性值(现在可用ES6+的可选链?.来替代) * @param {AnyObject} obj * @param {string} path * @param {boolean} strict * @returns */ declare function objectGet(obj: AnyObject, path: string, strict?: boolean): { p: any | undefined; k: string | undefined; v: any | undefined; }; /** * 标准化路径 * @param {string} path * @returns {string} */ declare const pathNormalize: (path: string) => string; /** * 路径合并 * @param {string} from * @param {string} to * @returns {string} */ declare const pathJoin: (from: string, ...to: string[]) => string; /** * 将字符串转换为驼峰格式 * @param {string} string * @param {boolean} [bigger] 是否大写第一个字母 * @returns {string} */ declare function stringCamelCase(string: string, bigger?: boolean): string; /** * 将字符串转换为连字格式 * @param {string} string * @param {string} [separator] 分隔符,默认是"-"(短横线) * @returns {string} */ declare function stringKebabCase(string: string, separator?: string): string; declare const STRING_ARABIC_NUMERALS = "0123456789"; declare const STRING_LOWERCASE_ALPHA = "abcdefghijklmnopqrstuvwxyz"; declare const STRING_UPPERCASE_ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; /** * 字符串格式化 * @example * ```js * stringFormat("My name is %s.", "zhangsan") * // => "My name is zhangsan." * ``` * @param {string} string 字符串模板,使用 %s 表示字符串,%d 表示数值,%o 表示对象,%% 表示百分号,参考 console.log * @param args * @returns {string} */ declare function stringFormat(string: string, ...args: Array): string; /** * 字符串赋值 * @example * ```js * stringAssign('My name is ${user}.', { user: 'zhangsan' }); * // => "My name is zhangsan." * ``` * @param {string} template * @param {AnyObject} data * @returns {string} */ declare const stringAssign: (template: string, data: AnyObject) => string; /** * 字符串编码 HTML * @example * ```js * stringEscapeHtml('You & Me speak "xixi"') * // => "<b>You & Me speak "xixi"</b>" * ``` * @param {string} html * @returns {string} */ declare const stringEscapeHtml: (html: string) => string; /** * 字符串填充 * @param {number} length * @param {string} value * @returns {string} */ declare const stringFill: (length: number, value?: string) => string; /** * 解析URL查询参数 * @param {string} searchStr * @returns {Record} */ declare function parseQueryParams(searchStr?: string): Record; /** * 等待一段时间 * @param {number} timeout 等待时间,单位毫秒 * @returns {Promise} */ declare function wait(timeout?: number): Promise; /** * 异步遍历 * @ref https://github.com/Kevnz/async-tools/blob/master/src/mapper.js * @ref https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator * @param {Array} list * @param {(val: T, idx: number, list: ArrayLike) => Promise} mapper * @param {number} concurrency 并发数量,默认无限 * @returns {Promise} */ declare function asyncMap(list: Array, mapper: (val: T, idx: number, list: Array) => Promise, concurrency?: number): Promise; interface DebounceFunc { (...args: Parameters): void; cancel: () => void; } /** * 防抖函数 * 当函数被连续调用时,该函数并不执行,只有当其全部停止调用超过一定时间后才执行1次。 * 例如:上电梯的时候,大家陆陆续续进来,电梯的门不会关上,只有当一段时间都没有人上来,电梯才会关门。 * @param {F} func * @param {number} wait * @returns {DebounceFunc} */ declare const debounce: (func: F, wait?: number) => DebounceFunc; interface ThrottleFunc { (...args: Parameters): void; cancel: () => void; } /** * 节流函数 * 节流就是节约流量,将连续触发的事件稀释成预设评率。 比如每间隔1秒执行一次函数,无论这期间触发多少次事件。 * 这有点像公交车,无论在站点等车的人多不多,公交车只会按时来一班,不会来一个人就来一辆公交车。 * @param {F} func * @param {number} wait * @param {boolean} immediate * @returns {ThrottleFunc} */ declare const throttle: (func: F, wait: number, immediate?: boolean) => ThrottleFunc; interface OnceFunc { (...args: Parameters): ReturnType; } /** * 单次函数 * @param {AnyFunc} func * @returns {AnyFunc} */ declare const once: (func: F) => OnceFunc; /** * 设置全局变量 * @param {string | number | symbol} key * @param val */ declare function setGlobal(key: string | number | symbol, val?: any): void; /** * 获取全局变量 * @param {string | number | symbol} key * @param val */ declare function getGlobal(key: string | number | symbol): T | void; /** * 随机整数 * @param {number} min * @param {number} max * @returns {number} */ declare const randomNumber: (min: number, max: number) => number; declare const STRING_POOL: string; interface RandomString { (length: number, pool: string): string; (length: number): string; (pool: string): string; (): string; } /** * 随机字符串 * @param {number | string} length * @param {string} pool * @returns {string} */ declare const randomString: RandomString; /** * 优先浏览器原生能力获取 UUID v4 * @returns {string} */ declare function randomUuid(): string; declare const HEX_POOL: string; /** * 将十进制转换成任意进制 * @param {number | string} decimal 十进制数值或字符串,可以是任意长度,会使用大数进行计算 * @param {string} [hexPool] 进制池,默认 62 进制 * @returns {string} */ declare function numberToHex(decimal: number | string, hexPool?: string): string; interface INumberAbbr { ratio?: number; decimals?: number; separator?: string; } /** * 将数字转换为携带单位的字符串 * @param {number | string} num * @param {Array} units * @param {INumberAbbr} options default: { ratio: 1000, decimals: 0, separator: ' ' } * @returns {string} */ declare const numberAbbr: (num: number | string, units: Array, options?: INumberAbbr) => string; interface IHumanFileSizeOptions { decimals?: number; si?: boolean; separator?: string; baseUnit?: string; maxUnit?: string; } /** * Converting file size in bytes to human-readable string * reference: https://zh.wikipedia.org/wiki/%E5%8D%83%E5%AD%97%E8%8A%82 * @param {number | string} num bytes Number in Bytes * @param {IHumanFileSizeOptions} options default: { decimals = 0, si = false, separator = ' ' } * si: True to use metric (SI) units, aka powers of 1000, the units is * ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']. * False to use binary (IEC), aka powers of 1024, the units is * ['Byte', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'] * @returns */ declare function humanFileSize(num: number | string, options?: IHumanFileSizeOptions): string; /** * 将数字格式化成千位分隔符显示的字符串 * @param {number|string} num 数字 * @param {number} decimals 格式化成指定小数位精度的参数 * @returns {string} */ declare function formatNumber(num: number | string, decimals?: number): string; declare const UNIQUE_NUMBER_SAFE_LENGTH = 18; /** * 生成唯一不重复数值 * @param {number} length * @returns {string} */ declare const uniqueNumber: (length?: number) => string; interface UniqueString { (length: number, pool: string): string; (length: number): string; (pool: string): string; (): string; } /** * 生成唯一不重复字符串 * @param {number | string} length * @param {string} pool * @returns {string} */ declare const uniqueString: UniqueString; interface IFieldOptions { keyField: string; childField: string; pidField: string; } interface ISearchTreeOpts { childField: string; nameField: string; removeEmptyChild: boolean; ignoreCase: boolean; } interface IFilterCondition { keyword?: string; filter?: (args: V) => boolean; } /** * 深度优先遍历函数(支持continue和break操作), 可用于insert tree item 和 remove tree item * @param {ArrayLike} tree 树形数据 * @param {Function} iterator 迭代函数, 返回值为true时continue, 返回值为false时break * @param {string} children 定制子元素的key * @param {boolean} isReverse 是否反向遍历 * @returns {*} */ declare function forEachDeep(tree: ArrayLike, iterator: (val: V, i: number, currentArr: ArrayLike, tree: ArrayLike, parent: V | null, level: number) => boolean | void, children?: string, isReverse?: boolean): void; /** * 创建一个新数组, 深度优先遍历的Map函数(支持continue和break操作), 可用于insert tree item 和 remove tree item * * 可遍历任何带有 length 属性和数字键的类数组对象 * @param {ArrayLike} tree 树形数据 * @param {Function} iterator 迭代函数, 返回值为true时continue, 返回值为false时break * @param {string} children 定制子元素的key * @param {boolean} isReverse 是否反向遍历 * @returns {any[]} 新的一棵树 */ declare function mapDeep(tree: T[], iterator: (val: T, i: number, currentArr: T[], tree: T[], parent: T | null, level: number) => { [k: string | number]: any; } | boolean, children?: string, isReverse?: boolean): any[]; type IdLike = number | string; interface ITreeConf { id: string | number; children: string; } /** * 在树中找到 id 为某个值的节点,并返回上游的所有父级节点 * * @param {ArrayLike} tree - 树形数据 * @param {IdLike} nodeId - 元素ID * @param {ITreeConf} config - 迭代配置项 * @returns {[IdLike[], ITreeItem[]]} - 由parentId...childId, parentObject-childObject组成的二维数组 */ declare function searchTreeById(tree: ArrayLike, nodeId: IdLike, config?: ITreeConf): [IdLike[], ArrayLike[]]; /** * 扁平化数组转换成树 * @param {any[]} list * @param {IFieldOptions} options * @returns {any[]} */ declare function formatTree(list: any[], options?: IFieldOptions): any[]; /** * 树形结构转扁平化 * @param {any} treeList * @param {IFieldOptions} options * @returns {*} */ declare function flatTree(treeList: any[], options?: IFieldOptions): any[]; /** * 模糊搜索函数,返回包含搜索字符的节点及其祖先节点, 适用于树型组件的字符过滤功能 * 以下搜索条件二选一,按先后优先级处理: * 1. 过滤函数filter, 返回true/false * 2. 匹配关键词,支持是否启用忽略大小写来判断 * * 有以下特性: * 1. 可配置removeEmptyChild字段,来决定是否移除搜索结果中的空children字段 * 2. 若无任何过滤条件或keyword模式匹配且keyword为空串,返回原对象;其他情况返回新数组 * @param {V[]} nodes * @param {IFilterCondition} filterCondition * @param {ISearchTreeOpts} options * @returns {V[]} */ declare function fuzzySearchTree(nodes: V[], filterCondition: IFilterCondition, options?: ISearchTreeOpts): V[]; /** * 数值安全乘法 * @param arg1 数值1 * @param arg2 数值2 */ declare const multiply: (arg1: number, arg2: number) => number; /** * 数值安全加法 * @param arg1 数值1 * @param arg2 数值2 */ declare const add: (arg1: number, arg2: number) => number; /** * 数值安全减法 * @param arg1 数值1 * @param arg2 数值2 */ declare const subtract: (arg1: number, arg2: number) => number; /** * 数值安全除法 * @param arg1 数值1 * @param arg2 数值2 */ declare const divide: (arg1: number, arg2: number) => number; type NumberType = number | string; /** * Correct the given number to specifying significant digits. * * @param num The input number * @param precision An integer specifying the number of significant digits * * @example strip(0.09999999999999998) === 0.1 // true */ declare function strip(num: NumberType, precision?: number): number; /** * 字符串编码成Base64, 平替浏览器的btoa, 不包含中文的处理 (适用于任何环境,包括小程序) * @param {string} string * @returns {string} */ declare function weBtoa(string: string): string; /** * Base64解码为原始字符串,平替浏览器的atob, 不包含中文的处理(适用于任何环境,包括小程序) * @param {string} string * @returns {string} */ declare function weAtob(string: string): string; /** * 将base64编码的字符串转换为原始字符串,包括对中文内容的处理(高性能,且支持Web、Node、小程序等任意平台) * @param base64 base64编码的字符串 * @returns 原始字符串,包括中文内容 */ declare function decodeFromBase64(base64: string): string; /** * 将原始字符串,包括中文内容,转换为base64编码的字符串(高性能,且支持Web、Node、小程序等任意平台) * @param rawStr 原始字符串,包括中文内容 * @returns base64编码的字符串 */ declare function encodeToBase64(rawStr: string): string; declare const EMAIL_REGEX: RegExp; /** * 判断字符串是否为邮箱格式,不对邮箱真实性做验证,如域名是否正确等 * @param {string} value * @returns {boolean} */ declare const isEmail: (value: string) => boolean; declare const PHONE_REGEX: RegExp; /** * 判断字符串是否为宽松手机格式,即首位为 1 的 11 位数字都属于手机号 * @param {string} value * @returns {boolean} */ declare const isPhone: (value: string) => boolean; /** * 判断字符串是否为身份证号码格式 * @param {string} value * @returns {boolean} */ declare const isIdNo: (value: string) => boolean; declare const URL_REGEX: RegExp; declare const HTTP_URL_REGEX: RegExp; /** * 判断字符串是否为 url 格式,支持 http、https、ftp 协议,支持域名或者 ipV4 * @param {string} value * @returns {boolean} */ declare const isUrl: (url: string, includeFtp?: boolean) => boolean; declare const IPV4_REGEX: RegExp; declare const IPV6_REGEX: RegExp; /** * 判断字符串是否为 IPV4 格式,不对 ip 真实性做验证 * @param {string} value * @returns {boolean} */ declare const isIpV4: (value: string) => boolean; /** * 判断字符串是否为 IPV6 格式,不对 ip 真实性做验证 * @param {string} value * @returns {boolean} */ declare const isIpV6: (value: string) => boolean; /** * 判断字符串是否为整数(自然数),即 ...,-3,-2,-1,0,1,2,3,... * @param {string} value * @returns {boolean} */ declare const isInteger: (value: string) => boolean; /** * 判断字符串是否为浮点数,即必须有小数点的有理数 * @param {string} value * @returns {boolean} */ declare const isFloat: (value: string) => boolean; /** * 判断字符串是否为正确数值,包括整数和浮点数 * @param {string} value * @returns {boolean} */ declare const isNumerical: (value: string) => boolean; /** * 判断字符串是否为数字,例如六位数字短信验证码(093031) * @param {string} value * @returns {boolean} */ declare const isDigit: (value: string) => boolean; /** * 去除字符串中重复字符 * @param {string} str * @returns string * @example * * uniqueSymbol('1a1bac'); * // => '1abc' */ declare function uniqueSymbol(str: string): string; /** * 转义所有特殊字符 * @param {string} str 原字符串 * reference: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_expressions * @returns string */ declare function escapeRegExp(str: string): string; /** * 解析字符串的插值变量 * @param {string} str 字符串 * @param {string} leftMatchSymbol 变量左侧匹配符号,默认:{ * @param {string} rightMatchSymbol 变量右侧匹配符号,默认:} * @returns string[] * @example * * default match symbol {} same as /{\s*([^{}\s]*)\s*}/g */ declare function parseVarFromString(str: string, leftMatchSymbol?: string, rightMatchSymbol?: string): string[]; /** * 替换字符串中的插值变量 * @param {string} sourceStr * @param {Record} targetObj * @param {string} leftMatchSymbol 变量左侧匹配符号,默认:{ * @param {string} rightMatchSymbol 变量右侧匹配符号,默认:} * @returns string */ declare function replaceVarFromString(sourceStr: string, targetObj: Record, leftMatchSymbol?: string, rightMatchSymbol?: string): string; /** * 在指定作用域中执行代码 * @param {string} code 要执行的代码(需包含 return 语句或表达式) * @param {Object} scope 作用域对象(键值对形式的变量环境) * @returns 代码执行结果 * * @example * // 测试用例 1: 基本变量访问 * executeInScope("return a + b;", { a: 1, b: 2 }); * // 3 * * // 测试用例 2: 支持复杂表达式和运算 * executeInScope( * "return Array.from({ length: 3 }, (_, i) => base + i);", * { base: 100 } * ); * // [100, 101, 102] * * // 支持外传函数作用域执行 * const scope = { * $: { * fun: { * time: { * now: function () { * return new Date(); * }, * }, * }, * }, * }; * executeInScope("return $.fun.time.now()", scope) */ declare function executeInScope(code: string, scope?: Record): any; export { type AnyArray, type AnyFunc, type AnyObject, type ArrayElements, type DateObj, type DateValue, type DebounceFunc, EMAIL_REGEX, HEX_POOL, HTTP_URL_REGEX, type IFieldOptions, type IFilterCondition, IPV4_REGEX, IPV6_REGEX, type ISearchTreeOpts, type ITreeConf, type IdLike, type ObjectAssignItem, type OnceFunc, PHONE_REGEX, type PartialDeep, type RandomString, STRING_ARABIC_NUMERALS, STRING_LOWERCASE_ALPHA, STRING_POOL, STRING_UPPERCASE_ALPHA, type ThrottleFunc, UNIQUE_NUMBER_SAFE_LENGTH, URL_REGEX, type UniqueString, add, arrayEach, arrayEachAsync, arrayInsertBefore, arrayLike, arrayRemove, asyncMap, calculateDate, calculateDateTime, dateParse, dateToEnd, dateToStart, debounce, decodeFromBase64, divide, encodeToBase64, escapeRegExp, executeInScope, flatTree, forEachDeep, formatDate, formatNumber as formatMoney, formatNumber, formatTree, fuzzySearchTree, getGlobal, humanFileSize, isArray, isBigInt, isBoolean, isDate, isDigit, isEmail, isEmpty, isError, isFloat, isFunction, isIdNo, isInteger, isIpV4, isIpV6, isJsonString, isNaN, isNull, isNullOrUnDef, isNullOrUnDef as isNullish, isNumber, isNumerical, isObject, isPhone, isPlainObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined, isUrl, isValidDate, mapDeep, multiply, numberAbbr, numberToHex, objectAssign, objectEach, objectEachAsync, objectFill, objectGet, objectHas, objectMap, objectAssign as objectMerge, objectOmit, objectPick, once, parseQueryParams, parseVarFromString, pathJoin, pathNormalize, randomNumber, randomString, randomUuid, replaceVarFromString, searchTreeById, setGlobal, stringAssign, stringCamelCase, stringEscapeHtml, stringFill, stringFormat, stringKebabCase, strip, subtract, throttle, typeIs, uniqueNumber, uniqueString, uniqueSymbol, wait, weAtob, weBtoa };