UNPKG

element-plus

Version:
71 lines (70 loc) 3.36 kB
import { camelize, capitalize, extend, hasOwn, isArray, isObject, isString, looseEqual } from '@vue/shared'; import type { ComponentPublicInstance, CSSProperties, Ref } from 'vue'; import type { AnyFunction, TimeoutHandle, Hash, Nullable } from './types'; declare global { interface Document { documentMode?: any; } } export declare const SCOPE = "Util"; export declare function toObject<T>(arr: Array<T>): Record<string, T>; export declare const getValueByPath: (obj: any, paths?: string) => unknown; export declare function getPropByPath(obj: any, path: string, strict: boolean): { o: unknown; k: string; v: Nullable<unknown>; }; /** * Generate random number in range [0, 1000] * Maybe replace with [uuid](https://www.npmjs.com/package/uuid) */ export declare const generateId: () => number; export declare const escapeRegexpString: (value?: string) => string; export declare const coerceTruthyValueToArray: (arr: any) => any[]; export declare const isIE: () => boolean; export declare const isEdge: () => boolean; export declare const isFirefox: () => boolean; export declare const autoprefixer: (style: CSSProperties) => CSSProperties; export declare const kebabCase: (str: string) => string; export { hasOwn, isObject, isArray, isString, capitalize, camelize, looseEqual, extend, }; export declare const isBool: (val: unknown) => boolean; export declare const isNumber: (val: unknown) => boolean; export declare const isHTMLElement: (val: unknown) => boolean; export declare function rafThrottle<T extends AnyFunction<any>>(fn: T): AnyFunction<void>; export declare const clearTimer: (timer: Ref<TimeoutHandle>) => void; /** * Generating a random int in range (0, max - 1) * @param max {number} */ export declare function getRandomInt(max: number): number; export declare function entries<T>(obj: Hash<T>): [string, T][]; export declare function isUndefined(val: any): val is undefined; export { isVNode } from 'vue'; export declare function useGlobalConfig(): any; export declare const arrayFindIndex: <T = any>(arr: T[], pred: (args: T) => boolean) => number; export declare const arrayFind: <T>(arr: T[], pred: (args: T) => boolean) => T; export declare function isEmpty(val: unknown): boolean; export declare function arrayFlat(arr: unknown[]): any; export declare function deduplicate<T>(arr: T[]): T[]; /** * Unwraps refed value * @param ref Refed value */ export declare function $<T>(ref: Ref<T>): T; export declare function addUnit(value: string | number): string; /** * Enhance `lodash.isEqual` for it always return false even two functions have completely same statements. * @param obj The value to compare * @param other The other value to compare * @returns Returns `true` if the values are equivalent, else `false`. * @example * lodash.isEqual(() => 1, () => 1) // false * isEqualWith(() => 1, () => 1) // true */ export declare function isEqualWithFunction(obj: any, other: any): boolean; /** * Generate function for attach ref for the h renderer * @param ref Ref<HTMLElement | ComponentPublicInstance> * @returns (val: T) => void */ export declare const refAttacher: <T extends HTMLElement | ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>>(ref: Ref<T>) => (val: T) => void;