/** * Tools function * @authors Luo-jinghui (luojinghui424@gmail.com) * @date 2019-11-08 15:54:21 */ import { ITemplateObj } from '../type'; /** * 节流函数 * * @param fn event function * @param delay 每隔多久必须触发一次 * @param atleast 最短间隔触发时间 */ export declare const debounce: (fn: any, delay: number, atleast: number) => () => void; /** * 防抖函数 * * @param fn Event function * @param wait 等待多少毫秒触发 */ export declare const throttle: (fn: any, wait: number) => () => void; /** * 获取当前时间 * * Format:xxxx-xx-xx xx:xx */ export declare const currentTime: () => string; /** * 获取当前时间 * * Format:xx-xx xx:xx:xx.xx */ export declare const getTime: () => string; /** * 获取当前时间 * * Format:xx:xx:xx xx */ export declare const getMillTime: () => string; /** * 错误信息格式化 * * @param { string } sdk38code 错误码 * @param { Record } data 数据 * @param { string } msg 消息描述 * @returns { XYReturnResult } 错误码数据 */ export declare const getStatus: (sdk38code: string, data?: Record, msg?: string) => { code: any; msg: string; data: Record; }; /** * 判断值类型 */ export declare const TYPEOF: { isNumber(num: any): boolean; isObject(obj: any): boolean; isArray(arr: any): boolean; isString(str: any): boolean; isBoolean(str: any): boolean; isUndefined(str: any): boolean; isFunction(val: any): val is Function; isLetter(val: any): boolean; isChinese(val: any): boolean; isNumberText(val: any): boolean; isSpecialChar(val: any): boolean; isWhiteSpace(val: any): boolean; }; /** * 将演讲者模式转化成content缩略视图模式 * 因为content模式中可能存在主会场,此时需要将P1替换为主会场,因此标注一下P1 * * @param {ITemplateObj} SPEAKER 演讲者模板 * @returns {ITemplateObj} */ export declare const toMultiPicContentHighPriority: (SPEAKER: ITemplateObj) => any; /** * 将演讲者模式转化成content缩略共享模式 * * @param SPEAKER 演讲者模板 * @returns {ITemplateObj} */ export declare const toMultiPicActiveHighPriority: (SPEAKER: ITemplateObj) => any; /** * 将字符串转为16进制 * * @param {string} str * @returns {string} */ export declare const stringToHex: (str: any) => string; /** * argb图片转rgba * * @param {ArrayBuffer} src argb array buffer * @param {boolean} convertAlpha 是否转换 alpha 通道,默认:false(不转换) * @returns {Uint8Array} 转换后的 rgba 数据 */ export declare const argbToRgba: (src: ArrayBuffer, convertAlpha?: boolean) => Uint8Array; /** * 检查图片是不是一张纯黑图片 * * @param {ArrayBuffer} buffer 图片数据 * @returns {boolean} */ export declare const isBlackImg: (buffer: ArrayBuffer) => boolean; /** * 获取n-ua信息 * * @returns {string} */ export declare const getNuaInfo: (appType?: string) => string;