import { type AttachmentInput } from './attachment-router.js'; import { LocoSession } from './protocol/session.js'; import type { LocoPacket } from './protocol/types.js'; import { type KakaoChat, type KakaoDeviceType, type KakaoLeaveChatResult, type KakaoMarkReadResult, type KakaoMember, type KakaoMessage, type KakaoProfile, type KakaoReplyTarget, type KakaoSendResult, type KakaoTypingResult } from './types.js'; export type KakaoSessionEvent = { type: 'connected'; userId: string; } | { type: 'disconnected'; } | { type: 'kicked'; reason: string; }; export type KakaoPushHandler = (packet: LocoPacket) => void; export type KakaoSessionEventHandler = (event: KakaoSessionEvent) => void; export declare class KakaoTalkError extends Error { code: string; constructor(message: string, code: string, options?: { cause?: unknown; }); } export declare class KakaoTalkClient { private oauthToken; private userId; private deviceUuid; private deviceType; private state; private initPromise; private closed; private pushHandlers; private sessionEventHandlers; private nameCache; login(credentials?: { oauthToken: string; userId: string; deviceUuid?: string; deviceType?: KakaoDeviceType; }, accountId?: string): Promise; getCredentials(): { oauthToken: string; userId: string; deviceUuid: string; deviceType: KakaoDeviceType; }; private ensureAuth; private ensureSession; acquireSession(): Promise; onPush(handler: KakaoPushHandler): () => void; onSessionEvent(handler: KakaoSessionEventHandler): () => void; isConnected(): boolean; private executeWithReconnect; private connect; private dispatchPush; private invalidateSession; private emitSessionEvent; getChats(options?: { all?: boolean; search?: string; resolveTitles?: boolean; }): Promise; /** * Resolve the user-set room title via CHATINFO. Returns null on any error * (network, malformed response, or no TITLE meta present). Designed to be * fire-and-forget per chat — failures don't poison the whole `getChats` call. */ getChatTitle(chatId: string): Promise; private fetchChatTitle; getMessages(chatId: string, options?: { count?: number; from?: string; }): Promise; getMembers(chatId: string): Promise; getMembersByIds(chatId: string, userIds: string[]): Promise; sendMessage(chatId: string, text: string, options?: { replyTo?: KakaoReplyTarget; }): Promise; sendTyping(chatId: string, opts?: { linkId?: string; }): Promise; sendAttachment(chatId: string, data: Uint8Array | Buffer, filename: string, mimeType?: string): Promise; sendAttachment(chatId: string, attachments: ReadonlyArray): Promise; private dispatchSingleAttachment; sendPhoto(chatId: string, photo: Uint8Array | Buffer, filename?: string): Promise; sendVideo(chatId: string, video: Uint8Array | Buffer, filename?: string): Promise; sendAudio(chatId: string, audio: Uint8Array | Buffer, filename?: string): Promise; sendFile(chatId: string, file: Uint8Array | Buffer, filename: string, mimeType?: string): Promise; sendMultiPhoto(chatId: string, photos: Array<{ data: Uint8Array | Buffer; filename?: string; }>): Promise; private sendMediaViaLoco; /** * Advance the read watermark for `chatId` up to and including `logId`. * The caller decides open vs normal: pass `opts.linkId` for open chats * (오픈채팅) and omit it for normal chats. Open chats without a `linkId` * are rejected by the server with a non-zero `body.status` — this method * does not auto-detect. */ markRead(chatId: string, logId: string, opts?: { linkId?: string; }): Promise; leaveChat(chatId: string): Promise; getProfile(): Promise; close(): void; lookupAuthorName(chatId: string, authorId: number): string | null; } //# sourceMappingURL=client.d.ts.map