UNPKG

vue-launchers

Version:
128 lines (127 loc) 3.99 kB
import { RequestHttpIntervalEnum, RequestParamsObjType } from '../enums/httpEnum'; import { CreateComponentType, CreateComponentGroupType } from '../packages/index.d'; /** * * 判断是否是开发环境 * @return { Boolean } */ export declare const isDev: () => boolean; /** * * 生成一个不重复的ID * @param { Number } randomLength */ export declare const getUUID: (randomLength?: number) => string; /** * * render 图标 * @param icon 图标 * @param set 设置项 */ export declare const renderIcon: (icon: any, set?: {}) => () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { [key: string]: any; }>; /** * * render 语言 * @param lang 语言标识 * @param set 设置项 * @param tag 要渲染成的标签 */ export declare const renderLang: (lang: string, set?: {}, tag?: string) => () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { [key: string]: any; }>; /** * * 获取错误处理图片,默认 404 图 * @returns url */ export declare const requireErrorImg: () => string; /** * * 全屏操作函数 * @param isFullscreen * @param isEnabled * @returns */ export declare const screenfullFn: (isFullscreen?: boolean, isEnabled?: boolean) => boolean; /** * 修改元素位置 * @param target 对象 * @param x X轴 * @param y Y轴 */ export declare const setComponentPosition: (target: CreateComponentType | CreateComponentGroupType, x?: number, y?: number) => void; /** * * 设置元素属性 * @param HTMLElement 元素 * @param key 键名 * @param value 键值 */ export declare const setDomAttribute: <K extends keyof CSSStyleDeclaration, V extends CSSStyleDeclaration[K]>(HTMLElement: HTMLElement, key: K, value: V) => void; /** * * 判断是否是 mac * @returns boolean */ export declare const isMac: () => boolean; /** * * file转url */ export declare const fileToUrl: (file: File) => Promise<string>; /** * * file转base64 */ export declare const fileTobase64: (file: File, callback: Function) => void; /** * * 挂载监听 */ export declare const addEventListener: <K extends keyof WindowEventMap>(target: HTMLElement | Document, type: K, listener: any, delay?: number, options?: boolean | AddEventListenerOptions | undefined) => void; /** * * 卸载监听 */ export declare const removeEventListener: <K extends keyof WindowEventMap>(target: HTMLElement | Document, type: K, listener: any) => void; /** * * 截取画面为图片并下载 * @param html 需要截取的 DOM */ export declare const canvasCut: (html: HTMLElement | null, callback?: Function) => void; /** * * 函数过滤器 * @param data 数据值 * @param res 返回顶级对象 * @param funcStr 函数字符串 * @param isToString 是否转为字符串 * @param errorCallBack 错误回调函数 * @param successCallBack 成功回调函数 * @returns */ export declare const newFunctionHandle: (data: any, res: any, funcStr?: string, isToString?: boolean, errorCallBack?: Function, successCallBack?: Function) => any; /** * * 处理请求事件单位 * @param num 时间间隔 * @param unit RequestHttpIntervalEnum * @return number 秒数 */ export declare const intervalUnitHandle: (num: number, unit: RequestHttpIntervalEnum) => number; /** * * 对象转换 cookie 格式 * @param obj * @returns string */ export declare const objToCookie: (obj: RequestParamsObjType) => string; /** * * 设置按下键盘按键的底部展示 * @param keyCode * @returns */ export declare const setKeyboardDressShow: (keyCode?: number) => void; /** * * JSON序列化,支持函数和 undefined * @param data */ export declare const JSONStringify: <T>(data: T) => string; export declare const evalFn: (fn: string) => any; /** * * JSON反序列化,支持函数和 undefined * @param data */ export declare const JSONParse: (data: string) => any; /** * * 修改顶部标题 * @param title */ export declare const setTitle: (title?: string) => void;