///
import { AxiosRequestConfig } from 'axios';
import { default as Md5 } from 'md5';
import QRCODE from 'qrcode';
import { QRCodeToDataURLOptions } from 'qrcode';
import Router from 'vue-router';
import { RouterOptions } from 'vue-router';
import Vue from 'vue';
import { VueMetaOptions } from 'vue-meta';
export declare const $bus: import("vue/types/vue").CombinedVueInstance>;
/**
* 账号验证(手机号与邮箱)
* @param rule
* @param value
* @param callback
*/
declare function account(rule: any, value: any, callback: any): void;
export declare function addScript(src: string): (() => void) | null;
/**
* Created by henian.xu on 2018/7/24.
* 常用校验类
*/
/**
* 确认密码验证
* @param rule
* @param value
* @param callback
*/
declare function againPassword(this: any, rule: any, value: any, callback: any): void;
export declare function assert(condition: any, msg: string, module?: string): void;
declare function base64Decode(t: string): string;
declare function base64Encode(e: string): string;
export declare const CommonConfig: {
pickerOptions: {
shortcuts: {
text: string;
onClick(picker: Vue): void;
}[];
};
};
export declare const Convert: {
listToTree: typeof listToTree;
sortAtOrderNum: typeof sortAtOrderNum;
sortTreeData: typeof sortTreeData;
};
export declare const createObjectURL: (obj: any) => string;
export declare function dataURLtoBlob(dataurl: string, fileName?: string): Blob;
/**
* 防抖
* (与underscore 不同的是 immediate 为 true 时仅仅只是第一次触发会立即调用,
* 而 underscore immediate 为 true 时会把调用前置,既:触发会立即调用且在 delay 内再触发触发的不调用。
* 与 underscore 的不同导致不会严格按照 delay 时间间隔调用,因为正好在 delay 调用后触发会立即调用)
* @param func
* @param delay
* @param immediate
*/
export declare function debounce(func: Function, delay?: number, immediate?: boolean): {
(this: any, ...args: any[]): Promise;
cancel(): void;
};
export declare const Decode: {
uniEncode: typeof uniEncode;
uniDecode: typeof uniDecode;
base64Encode: typeof base64Encode;
base64Decode: typeof base64Decode;
utf8Encode: typeof utf8Encode;
utf8Decode: typeof utf8Decode;
utf16to8: typeof utf16to8;
utf8to16: typeof utf8to16;
};
export declare function delayRun(this: any, func: Function, delay: number, ...args: any[]): NodeJS.Timeout;
/**
* Created by henian.xu on 2019/3/19.
*
*/
export declare const Device: {
ua: string;
ios: boolean;
android: boolean;
androidChrome: boolean;
desktop: boolean;
windowsPhone: boolean;
iphone: boolean;
iphoneX: boolean;
ipod: boolean;
ipad: boolean;
edge: boolean;
ie: boolean;
firefox: boolean;
macos: boolean;
windows: boolean;
cordova: boolean;
phonegap: boolean;
electron: boolean;
webview: boolean;
standalone: boolean;
statusbar: boolean;
weixin: boolean;
pixelRatio: number;
os: string;
osVersion: string | null;
needsStatusbarOverlay: () => boolean;
};
/**
* 邮箱验证
* @param rule
* @param value
* @param callback
* @param source
* @param options
*/
declare function email(rule: any, value: any, callback: any): void;
export declare function fileSize(value: string | number | undefined, format: SizeKey, isUpperCase?: boolean): string;
/**
* 数值格式化
* @param value
* @param length
* @param strict
*/
export declare function filterNumber(value?: string | number, length?: number, strict?: boolean): string;
export declare function formatDuration(ms: number): string;
export declare function formModelMerge(formModel: {
[key: string]: any;
}, obj: {
[key: string]: any;
}): void;
export declare function getKey(): string;
declare function getQRCode(): Promise;
declare function getRouter(): Router | null;
export declare function getSysDayDate(): string;
export declare function getSysMonthDate(): string;
export declare function getSysMonthFirstDayDate(): string;
export declare function getSysYearFirstMonthDate(): string;
export declare const getType: (obj: any) => string;
export declare const getUniqueId: (prefix?: string) => string;
export declare const GlobalVar: GlobalVar_2;
declare interface GlobalVar_2 {
isDev: boolean;
docTitle: string;
appConfig?: {
AXIOS_DEFAULT_CONFIG?: AxiosRequestConfig;
ROUTER_DEFAULT_CONFIG?: RouterOptions;
USER_API?: string;
APP_LIST_API?: string;
DEFAULT_IMG?: string;
VUE_META?: VueMetaOptions;
[k: string]: any;
};
[k: string]: any;
}
declare const GlobalVar_2: GlobalVar_2;
/**
* 检查对象是否具有该属性。
*/
export declare const hasOwn: (obj: object, key: string | number | symbol) => any;
/**
* 整合异步
* @param func
*/
export declare function integrateAsync any>(func: T): (this: any, ...args: Parameters) => Promise | null>;
export declare const isArray: (arg: any) => arg is any[];
export declare const isBoolean: (val: any) => val is string;
export declare const isDef: (val: any) => boolean;
export declare const isFunction: (val: any) => val is Function;
export declare const isObject: (val: any) => val is Record;
export declare const isString: (val: any) => val is string;
export declare const isUrl: (url: string) => boolean;
/**
* 是否 VNode
* @param node
*/
export declare const isVNode: (node: any) => any;
declare function listToTree(list: any[], lv: number): any[];
export declare function loadExternalScript(src: string, check: () => any, delay?: number): Promise;
export declare function loadImg(src: string): Promise;
export declare function loadImgs(srcs: string[]): Promise;
export declare function makeEnum>(obj: T[] | T): {};
export { Md5 }
/**
* 手机验证
* @param rule
* @param value
* @param callback
* @param source
* @param options
*/
declare function mobile(rule: any, value: any, callback: any): void;
/**
* Created by henian.xu on 2020/5/22.
*
*/
export declare const NOOP: () => void;
export declare function pluckDeep(path: any, data: any, isCreate?: boolean): any;
export declare const QRCode: {
getQRCode: typeof getQRCode;
toDataURL: typeof toDataURL;
};
declare type QRCode_2 = typeof QRCODE;
export declare const Runtime: {
setRouter: typeof setRouter;
getRouter: typeof getRouter;
};
declare function setRouter(router: Router): void;
declare type SizeKey = keyof typeof sizeMap;
declare const sizeMap: {
b: number;
kb: number;
mb: number;
gb: number;
};
/**
* Created by henian.xu on 2019/11/1.
*
*/
declare function sortAtOrderNum(list: any[]): void;
declare function sortTreeData(list: any[]): void;
export declare const startCountdown: (timestamp: number, callBack?: () => void, finish?: () => void) => () => void;
declare function strictRequired(rule: any, value: any, callback: any): void;
/**
* 节流
* underscore的实现
* @param func
* @param delay
* @param options
*/
export declare function throttle(func: Function, delay?: number, options?: {
leading?: boolean;
trailing?: boolean;
}): {
(this: any, ...args: any[]): Promise;
cancel(): void;
};
declare function toDataURL(canvasElement: HTMLCanvasElement, text: string, options?: QRCodeToDataURLOptions): Promise;
declare function toDataURL(text: string, options?: QRCodeToDataURLOptions): Promise;
export declare function transformCssValue(val: any, unit?: string): any;
declare function uniDecode(t: string): string;
/**
* Created by henian.xu on 2019/2/28.
* 字符串解码
*/
declare function uniEncode(t: string): string;
declare function utf16to8(t: string): string;
declare function utf8Decode(t: string): string;
declare function utf8Encode(t: string): string;
declare function utf8to16(t: string): string;
export declare const Valid: {
againPassword: typeof againPassword;
email: typeof email;
mobile: typeof mobile;
account: typeof account;
strictRequired: typeof strictRequired;
};
export declare function validateForm(forms: any[], showFirstErrorField?: boolean): Promise;
export { }