UNPKG

swap-chat-react

Version:
49 lines (48 loc) 1.66 kB
import type { ChannelResponse, MemberUserInfo, UserInfo } from 'web2-mq'; export declare const getShortAddress: (address?: string) => string; export declare const copyText: (text: string) => Promise<boolean>; /** * 防反跳。fn函数在最后一次调用时刻的delay毫秒之后执行! * @param fn 执行函数 * @param delay 时间间隔 * @param isImmediate 为true,debounce会在delay时间间隔的开始时立即调用这个函数 * @returns {Function} */ export declare function debounce<T extends {}>(fn: Function, delay: number, isImmediate: boolean): ([k]: string) => T | Promise<T>; export declare const dateTransform: (time: number) => string; export declare const formatUserInfoData: (data: UserInfo) => { avatar: string; title: string; user_id: string; }; /** * channel格式化 * @param channel */ export declare const formatMessageData: (channel: ChannelResponse) => { latestMsg: string | import("web2-mq").MsgContents; displayTitle: string; avatarUrl: string[]; updatedAt: string; unread: number; unreadCount?: number | undefined; created_at: number; creator: MemberUserInfo[]; creator_id: number; description: string; is_1v1: boolean; is_opensea_coll: boolean; latest_msg: import("web2-mq").MessageResponse; members: MemberUserInfo[]; name: string; opensea_coll_cover: string; opensea_coll_name: string; opensea_coll_slug: string; room_id: string; }; /** * 日期格式化 * @param time * @param format */ export declare function dateFormat(time: number, format?: string): string;