import type { Conversation, Invite, Message, MessageOptions, Indicator, Alias, ParticipantActivity } from "../shared/shared-types.js"; export type { Conversation, Message, MessageOptions, Indicator, Invite, ParticipantActivity, Alias } from "../shared/shared-types.js"; export type ClientDispatch = (data: unknown) => void | Promise; export type GetAuthData = () => unknown | Promise; type ConversationEvent = { conversationId: string; data: Conversation | null; }; type InviteEvent = { conversationId: string; toParticipantId: string; data: Invite | null; }; type ParticipantActivityEvent = { conversationId: string; data: ParticipantActivity | null; }; export type SubscriptionEntry = { kind: "message"; conversationId: string; handlers: ((message: Message) => void)[]; } | { kind: "indicators"; conversationId: string; handlers: ((indicators: Indicator[]) => void)[]; } | { kind: "conversation"; handlers: ((event: ConversationEvent) => void)[]; } | { kind: "invite"; handlers: ((event: InviteEvent) => void)[]; } | { kind: "participantActivity"; handlers: ((event: ParticipantActivityEvent) => void)[]; }; export declare class Client { private dispatch; private participantId; private getAuthData; private nextRequestId; private pending; private scopeHandlers; private handlerScope; constructor(dispatch: ClientDispatch, participantId: string, getAuthData: GetAuthData); dispose(): void; receive(data: unknown): void; private sendEnvelope; private request; private subscribe; private unsubscribe; private attachHandler; private detachHandler; createConversation(maxSize?: number): Promise; createInvite(conversationId: string, participantId: string): Promise; revokeInvite(conversationId: string, toParticipantId: string): Promise; acceptInvite(conversationId: string): Promise; declineInvite(conversationId: string): Promise; leaveConversation(conversationId: string): Promise; setIndicator(conversationId: string): Promise; removeIndicator(conversationId: string): Promise; sendMessage(conversationId: string, message: string, options?: MessageOptions): Promise; editMessage(messageId: string, message: string): Promise; deleteMessage(messageId: string): Promise; addReaction(messageId: string, reaction: string): Promise; removeReaction(reactionId: string): Promise; getConversations(): Promise; getMessages(conversationId: string, cursorMessageId: string | null, after: boolean, amount: number): Promise<{ messages: Message[]; remainingInDirection: number; }>; getMessagesByIds(messageIds: string[]): Promise; getInvites(): Promise; getAliases(participantIds: string[]): Promise; getParticipantActivities(): Promise; getHasNew(): Promise<{ hasNewMessages: boolean; hasNewInvites: boolean; }>; onMessage(conversationId: string, handler: (message: Message) => void): Promise; offMessage(handler: (message: Message) => void): Promise; onIndicators(conversationId: string, handler: (indicators: Indicator[]) => void): Promise; offIndicators(handler: (indicators: Indicator[]) => void): Promise; onConversation(handler: (event: ConversationEvent) => void): Promise; offConversation(handler: (event: ConversationEvent) => void): Promise; onInvite(handler: (event: InviteEvent) => void): Promise; offInvite(handler: (event: InviteEvent) => void): Promise; onParticipantActivity(handler: (event: ParticipantActivityEvent) => void): Promise; offParticipantActivity(handler: (event: ParticipantActivityEvent) => void): Promise; onMany(entries: SubscriptionEntry[]): Promise; offMany(handlers: ((...args: never[]) => void)[]): Promise; } //# sourceMappingURL=client.d.ts.map