tenacity-tools
Version:
tenacity's js tool library
68 lines (67 loc) • 1.58 kB
TypeScript
/**
* @name base
* @author Lester
* @date 2022-01-12 11:22
*/
/**
* 获取屏幕宽度
*/
export declare const getClientWidth: () => number;
/**
* 当前屏幕相对标准屏幕比
*/
export declare const screenRate: number;
/**
* 轻提示
*/
export declare const Toast: {
info(text: string, duration?: number, parentElement?: HTMLElement): void;
success(text: string, duration?: number): void;
fail(text: string, duration?: number): void;
};
/**
* 复制
* @param text
* @param showTip
*/
/**
* 复制文本到剪贴板,并可选地显示提示信息
* @param {string} text - 要复制到剪贴板的文本
* @param {boolean} [showTip=false] - 是否显示复制成功或失败的提示信息
*/
export declare const copy: (text: string, showTip?: boolean) => Promise<any>;
/**
* 设置title
* @param tile
*/
export declare const setTitle: (tile: string) => void;
/**
* 解析url参数
* @param searchStr
*/
export declare const parseSearch: (searchStr?: string) => {
[key: string]: string;
};
/**
* 获取路由query参数
* @param key
*/
export declare const getQueryParam: (key?: string) => any;
/**
* 是否是移动端
*/
export declare const isMobile: () => boolean;
/**
* 获取cookie
* @param key
*/
export declare const getCookie: (key: string) => string;
/**
* 获取随机字符串
*/
export declare const getRandomStr: () => string;
/**
* 获取设备类型
* @param userAgent
*/
export declare const getDeviceType: (userAgent?: string) => string;