import { expectError, expectType } from "tsd"; import "../lib/chat"; expectType(CHAT.user.canTalkDuringTimeout()); expectType(CHAT.user.getName()); expectType(CHAT.LIVE_CHAT_HOST_ID); expectType(CHAT.IS_MOBILE); expectType>(CHAT.RoomUsers.get(1)); expectType(CHAT.RoomUsers.forceUpdate(1)); expectType( CHAT.RoomUsers.sidebarActivity( 1, "Jeff Atwood", true, Date.now() / 1000, "abcd" ) ); expectType(CHAT.RoomUsers.all()); expectType>(CHAT.RoomUsers.createAvatarImage(1, 8)); const exampleUser = CHAT.RoomUsers.current(); expectType(exampleUser); expectType(exampleUser.email_hash); expectType(exampleUser.id); expectType(exampleUser.name); expectType(exampleUser.reputation); expectType(exampleUser.is_moderator); expectType(exampleUser.is_owner); expectError(CHAT.inputHint.show("content", "I'm done", "abc")); expectType(CHAT.switchMobile("on")); expectError(CHAT.switchMobile("enable")); expectType( CHAT.addEventHandlerHook((event, value1, value2) => { expectType(event.id); expectType(event.message_id); expectType(event.user_name); expectType(event?.show_parent); expectType(value1); expectType(value2); }) );