press-ui
Version:
简单、易用的跨端组件库,兼容 Vue2 和 Vue3,同时支持 uni-app和普通 Vue 项目
42 lines (41 loc) • 1.34 kB
TypeScript
import type { IChatSDK, EventCallback } from './types';
import type TIM_TYPE from 'tim-js-sdk/tim-js';
export declare class IM {
tim: IChatSDK;
// eslint-disable-next-line @typescript-eslint/naming-convention
TIM: typeof TIM_TYPE;
constructor({ appId, logLevel }: {
appId: number;
logLevel?: number;
});
get isReady(): boolean;
set isReady(value: boolean);
get isOnline(): boolean;
set isOnline(value: boolean);
init(appId: number, logLevel: number): any;
waitReady(): Promise<unknown>;
setEventListener(type: string, cb: EventCallback): void;
setReceivedMessagesListener(cb: EventCallback): void;
setKickedOutListener(cb: EventCallback): void;
setReadyListener(cb: EventCallback): void;
setConversationUpdateListener(cb: EventCallback): void;
setUnreadMsgCountUpdatedListener(cb: EventCallback): void;
innerLogin({ userId, userSig }: {
userId: string;
userSig: string;
}): Promise<any>;
innerLogout(): any;
sendMessage({ to, text }: {
to: string;
text?: string;
}): Promise<any>;
getMessageList({ id, nextMsgId }: {
id: string;
nextMsgId: string;
}): Promise<any>;
deleteConversation(id: string): any;
sendAllMegRead(): any;
setMessageRead(id: string): any;
updateMyProfile(profile: Record<string, any>): Promise<any>;
getConversationList(): any;
}