declare module '@climblee/uv-ui/libs/config/config.js' { const config: { /** * 版本号 */ v: string /** * 版本号 */ version: string /** * 主题名称 */ type: ('primary' | 'success' | 'info' | 'error' | 'warning')[] /** * 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持 */ color: { 'uv-primary': string 'uv-warning': string 'uv-success': string 'uv-error': string 'uv-info': string 'uv-main-color': string 'uv-content-color': string 'uv-tips-color': string 'uv-light-color': string } /** * 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx */ unit: string } export default config } declare module '@climblee/uv-ui/libs/function/colorGradient.js' { /** * 求两个颜色之间的渐变值 */ function colorGradient( startColor?: string, endColor?: string, step?: number ): string /** * 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式) */ function hexToRgb(sColor, str: boolean): string /** * 将rgb表示方式转换为hex表示方式 */ function rgbToHex(rgb): string /** * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串 */ function colorToRgba(color, alpha): string export { colorGradient, colorToRgba, hexToRgb, rgbToHex } } declare module '@climblee/uv-ui/libs/function/index.js' { /** * @description 如果value小于min,取min;如果value大于max,取max */ function range(min?: number, max?: number, value?: number): number /** * @description 用于获取用户传递值的px值 如果用户传递了"xxpx"或者"xxrpx",取出其数值部分,如果是"xxxrpx"还需要用过uni.upx2px进行转换 */ function getPx(value, unit?: boolean): string | number /** * @description 进行延时,以达到可以简写代码的目的 比如: await uni.$uv.sleep(20)将会阻塞20ms */ function sleep(value?: number): Promise /** * @description 运行期判断平台 * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台 */ function os(): string /** * @description 获取系统信息同步接口 * @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync */ function sys(): any /** * @description 取一个区间数 */ function random(min, max): number /** * 生产一个全局唯一、随机的guid */ function guid(len?: number, firstU?: boolean, radix?: number): string /** * 获取父组件 */ function $parent(name?: string): string | undefined /** * @description 样式转换,对象转字符串,或者字符串转对象 */ function addStyle(customStyle, target?): object | string /** * @description 添加单位,如果有rpx,upx,%,px等单位结尾或者值为auto,直接返回,否则加上px单位结尾 */ function addUnit(value?: string, unit?: string): string /** * @description 深度克隆 */ function deepClone(obj, cache?: WeakMap): any /** * @description 深度合并 */ function deepMerge(target?, source?): object | boolean /** * @description error提示 */ function error(err): void /** * @description 打乱数组 */ function randomArray(array?: any[]): any[] /** * @description 格式化时间 */ function timeFormat(dateTime?: string | number, formatStr?: string): string /** * @description 时间戳转为多久之前 */ function timeFrom(timestamp?: string | number, format?: string): string /** * @description 去除空格 */ function trim(str, pos?: 'both' | 'left' | 'right' | 'all'): string /** * @description 对象转url参数 */ function queryParams( data?, isPrefix?: boolean, arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma' ): string /** * 显示消息提示框 */ function toast(title, duration?: number): void /** * @description 根据主题type值,获取对应的图标 */ function type2icon( type?: 'primary' | 'info' | 'error' | 'warning' | 'success', fill?: boolean ): string /** * @description 数字格式化 */ function priceFormat( number, decimals?: number, decimalPoint?: string, thousandsSeparator?: string ): string /** * @description 获取duration值 */ function getDuration(value, unit?: boolean): string | number /** * @description 日期的月或日补零操作 */ function padZero(value): string /** * @description 在uv-form的子组件内容发生变化,或者失去焦点时,尝试通知uv-form执行校验方法 */ function formValidate(instance, event): void /** * @description 获取某个对象下的属性,用于通过类似'a.b.c'的形式去获取一个对象的的属性的形式 */ function getProperty(obj, key): any /** * @description 设置对象的属性值,如果'a.b.c'的形式进行设置 */ function setProperty(obj, key, value): void /** * @description 获取当前页面路径 */ function page(): string /** * @description 获取当前路由栈实例数组 */ function pages(): any[] /** * 获取页面历史栈指定层实例 */ function getHistoryPage(back?: number): any /** * @description 修改uvui内置属性值 */ function setConfig({ props = {}, config = {}, color = {}, zIndex = {} }): void export { $parent, addStyle, addUnit, deepClone, deepMerge, error, formValidate, getDuration, getHistoryPage, getProperty, getPx, guid, os, padZero, page, pages, priceFormat, queryParams, random, randomArray, range, setConfig, setProperty, sleep, sys, timeFormat, timeFrom, toast, trim, type2icon } } declare module '@climblee/uv-ui/libs/function/platform.js' { /** * 注意: * 此部分内容,在vue-cli模式下,需要在vue.config.js加入如下内容才有效: * ```js * module.exports = { * transpileDependencies: ['@climblee/uv-ui'] * } * ``` */ const platform: string export default platform } declare module '@climblee/uv-ui/libs/function/test.js' { /** * 验证电子邮箱格式 */ function email(value): boolean /** * 验证手机格式 */ function mobile(value): boolean /** * 验证URL格式 */ function url(value): boolean /** * 验证日期格式 */ function date(value): boolean /** * 验证ISO类型的日期格式 */ function dateISO(value): boolean /** * 验证十进制数字 */ function number(value): boolean /** * 验证字符串 */ function string(value): boolean /** * 验证整数 */ function digits(value): boolean /** * 验证身份证号码 */ function idCard(value): boolean /** * 是否车牌号 */ function carNo(value): boolean /** * 金额,只允许2位小数 */ function amount(value): boolean /** * 中文 */ function chinese(value): boolean /** * 只能输入字母 */ function letter(value): boolean /** * 只能是字母或者数字 */ function enOrNum(value): boolean /** * 验证是否包含某个值 */ function contains(value, param): boolean /** * 验证一个值范围[min, max] */ function range(value, param): boolean /** * 验证一个长度范围[min, max] */ function rangeLength(value, param): boolean /** * 是否固定电话 */ function landline(value): boolean /** * 判断是否为空 */ function empty(value): boolean /** * 是否json字符串 */ function jsonString(value): boolean /** * 是否数组 */ function array(value): boolean /** * 是否对象 */ function object(value): boolean /** * 是否短信验证码 */ function code(value, len?: number): boolean /** * 是否函数方法 */ function func(value): boolean /** * 是否promise对象 */ function promise(value): boolean /** 是否图片格式 */ function image(value): boolean /** * 是否视频格式 */ function video(value): boolean /** * 是否为正则对象 */ function regExp(o): boolean export { amount, array, carNo, chinese, code, contains, date, dateISO, digits, email, empty, enOrNum, func, idCard, image, jsonString, landline, letter, mobile, number, object, promise, range, rangeLength, regExp, string, url, video } } declare module '@climblee/uv-ui/libs/function/debounce.js' { /** * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数 */ function debounce(func, wait?: number, immediate?: boolean): void export default debounce } declare module '@climblee/uv-ui/libs/function/throttle.js' { /** * 节流原理:在一定时间内,只能触发一次 */ function throttle(func, wait?: number, immediate?: boolean): void export default throttle } declare module '@climblee/uv-ui/libs/util/route.js' { /** * 路由跳转方法,内部是对uni多个路由跳转api的封装,更方便使用。支持路由拦截等多功能。 */ function route( options?: string | Record, params?: Record ): Promise export default route }