/** * Elijah Cobb * elijah@elijahcobb.com * elijahcobb.com * github.com/elijahjcobb */ import { IHCBotChatHistory, IHCBotThread } from "../types"; import { Socket } from "../HuskyChatBot"; import { HCBotKeyManager } from ".."; import { IHCAPIThread } from "@huskiesio/types"; export declare type HCBotChatOnReceivedParam = { threadId: string; senderId: string; payload: string; timestamp: number; }; export declare type HCBotChatOnSentParam = { threadId: string; payload: string; timestamp: number; }; export declare type HCBotChatOnReceivedHandler = (message: HCBotChatOnReceivedParam) => Promise; export declare type HCBotChatOnSentHandler = (message: HCBotChatOnSentParam) => Promise; export declare class HCBotChat { private readonly _history; private _onReceived; private _onSent; private _onThreadUpdated; private socket; private userKeyManager; constructor(socket: Socket, userKeyManager: HCBotKeyManager); history(): IHCBotChatHistory; onReceived(handler: HCBotChatOnReceivedHandler): void; onSent(handler: HCBotChatOnSentHandler): void; onThreadUpdated(handler: (threadId: string) => Promise): void; threads(): Promise; send(threadId: string, payload: string): Promise; createThread(name: string, description: string, members: string[]): Promise; handleChatMessageReceived(message: HCBotChatOnReceivedParam): Promise; handleChatMessageSent(message: HCBotChatOnSentParam): Promise; handleThreadUpdated(threadId: string): Promise; getThreadForId(threadId: string): Promise; }