import type { ChatItem, RawActionReceivedEventArgs, YTLiveChatEvents } from "../types/index.js"; import type { SendDummyOptions, StartOptions } from "../types/options.js"; /** * Public contract for a live chat service implementation. * * Implementations support both event-based consumption (`on`) and async iterators * (`streamChatItems`, `streamRawActions`). * * @example * ```ts * const chat: IYTLiveChat = new YTLiveChat(); * chat.on("chatReceived", ({ chatItem }) => console.log(chatItem.author.name)); * await chat.start({ liveId: "VIDEO_ID" }); * ``` */ export interface IYTLiveChat { /** Subscribe to a typed chat event. */ on(event: K, listener: (payload: YTLiveChatEvents[K]) => void): this; /** Unsubscribe from a typed chat event. */ off(event: K, listener: (payload: YTLiveChatEvents[K]) => void): this; /** * Start monitoring live chat for a target handle, channel, or live video. */ start(options?: StartOptions): Promise; /** * Stop monitoring and emit `chatStopped`. */ stop(reason?: string): void; /** * Stop monitoring and remove all listeners. */ dispose(): void; /** * Emit a local fake chat event through the same event pipeline as real messages. * Useful for UI development and integration tests. */ sendDummy(options?: SendDummyOptions): ChatItem; /** * Stream parsed chat items with `for await...of`. */ streamChatItems(options?: StartOptions, signal?: AbortSignal): AsyncIterable; /** * Stream raw InnerTube actions with `for await...of`. */ streamRawActions(options?: StartOptions, signal?: AbortSignal): AsyncIterable; } //# sourceMappingURL=i-yt-live-chat.d.ts.map