@jiaozhiye/qm-design-vue
Version:
A Component Library for Vue3.0
57 lines (56 loc) • 3.11 kB
TypeScript
import { Ref, VNode } from 'vue';
import { camelize } from 'vue';
import { isArray, isPlainObject as isObject, isFunction, isString, isNumber, isBoolean, isUndefined, get, set } from 'lodash-es';
import type { AnyFunction, AnyObject } from './types';
export { isObject, isArray, isFunction, isString, isNumber, isBoolean, isUndefined, get, set };
export declare const isIE: () => boolean;
export declare const isEdge: () => boolean;
export declare const isChrome: () => boolean;
export declare const isFirefox: () => boolean;
export declare const isSimpleValue: (x: unknown) => boolean;
export { isVNode } from 'vue';
export declare const isFragment: (c: VNode) => boolean;
export declare const isText: (c: VNode) => boolean;
export declare const isComment: (c: VNode) => boolean;
export declare const isTemplate: (c: VNode) => boolean;
export declare const isValidElement: (c: VNode) => boolean;
export declare const isEmptyElement: (c: VNode) => boolean;
export declare const filterEmptyElement: (children?: Array<VNode>) => Array<VNode>;
export declare const hasOwn: <T extends AnyObject<unknown>>(obj: T, key: string) => boolean;
export declare const sleep: (delay: number) => Promise<any>;
export declare const nextTick: (cb: AnyFunction<void>) => void;
export { camelize };
export declare const noop: () => void;
export declare const trueNoop: () => boolean;
export declare const isEmpty: (val: unknown) => boolean;
export declare const isValid: (val: string) => boolean;
export declare const isSci: (value: number) => boolean;
export declare const getValueByPath: (obj: AnyObject<any>, path: string) => any;
export declare const setValueByPath: (obj: AnyObject<any>, path: string, value: any) => void;
export declare const getParserWidth: (val: number | string) => string;
export declare const $: <T>(ref: Ref<T, T>) => unknown;
export declare const omit: <T extends object, K extends keyof T>(obj: T, fields: K[] | readonly K[]) => Omit<T, K>;
export declare const pick: <T extends object, K extends keyof T>(obj: T, keys: (string | K)[]) => Pick<T, K>;
/**
* @description 深拷贝目标对象,同时把 Proxy 转成 普通对象
* @param {object | array}} target 目标对象
* @returns 转换后的对象
*/
export declare const deepToRaw: <T>(target: T) => T;
export declare const deepClone: <T extends object>(target: T, map?: WeakMap<object, any>) => T;
/**
* @description 捕获基于 Promise 操作的异常
* @param {func} asyncFn 异步函数
* @param {any} params 函数的参数
* @returns {array} 错误前置
*/
export declare const errorCapture: (asyncFn: AnyFunction<any>, ...params: any[]) => Promise<any[]>;
/**
* @description 合并组件参数的默认值
* @param {object} propTypes 已声明的 propType
* @param {object} defaultProps 默认值
* @returns
*/
export declare const initDefaultProps: <T extends Record<string, unknown>>(propTypes: T, defaultProps: { [P in keyof T]?: unknown; }) => T;
export declare const flatJson: <T extends Record<string, any>>(jsonObj: T) => T;
export declare const parseJson: <T extends Record<string, any>>(jsonObj: T) => T;