UNPKG

jinbi-utils

Version:

这是一个实用工具库,包含了多个常用的功能模块。以下是各个模块的详细说明:

48 lines (47 loc) 2.13 kB
/** * 通用函数 * @packageDocumentation * @module Common * @preferred */ import { IFromType } from "@/constant/common.constant"; /** * 判断val 是否是空值 #### 使用说明 ``` isEmpty('') 返回 true isEmpty(null) 返回 true isEmpty(undefined) 返回 true isEmpty(12323) 返回 false ``` */ export declare function isEmpty(val: any): boolean; export declare const clearLoginData: () => void; export declare const getQueryString: (url: string, queryKey: string) => string; export declare const getQueryVariable: (variable: any) => string | false; export declare const getWecomToken: () => string | null; export declare const getDeviceType: () => IFromType; export declare const getFromType: (res: IFromType) => string; export declare function randomString(e: any): string; export declare const getCookie: (cookieName: any) => string; export declare const buildUUID: () => string; export declare const getTicket: () => string | null; export declare const setTicket: (jsapiTicket: any) => void; export declare const removeTicket: () => void; export declare const formateTimestamp: (timestamp: number | null, type?: string) => string; export declare const convertBase64UrlToBlob: (urlData: any) => Blob; export declare const getEnvironment: () => "com-wx-mobile" | "com-wx-pc" | "wx-mobile" | "wx-pc" | "other"; export declare const getIsComWx: () => boolean; export declare const getIsDevelopment: () => boolean; export declare const filterRepeat: (arr: any[], fieldName: string) => any[]; export declare const base64ToBlob: (base64: any) => Blob; export declare const base64ToFile: (base64: any, fileName: any) => File; export declare const isImage: (type: string) => boolean; export declare const getFileData: (optionName: string) => { name: string; url: string; }; export declare const validateTwoDecimal: (v: number | string) => boolean; export declare const uuid: (len: any, radix: any) => string; export declare const getToken: (cacheType: string, key?: string) => string; export declare const removeToken: (cacheType: string, key?: string) => void;