import type { Conversation, ConversationRecord, Message, MessageOptions, Reaction, Invite, ParticipantActivity, Alias, SystemEvent } from "../shared/shared-types.js"; import { type ServerDispatch, type RateLimitOptions, type CleanupOptions, type Handler } from "./server-types.js"; export type { ServerDispatch, RateLimitOptions, CleanupOptions } from "./server-types.js"; export type { Conversation, ConversationRecord, Message, MessageOptions, SystemEvent, Reaction, Invite, ParticipantActivity, Alias } from "../shared/shared-types.js"; export type ServerOptions = { logInfo?: boolean; }; export declare class Server { private dispatch; private rateLimits; private cleanup; private handlers; private subscriptions; private rateLimiter; private scheduler; private ctx; constructor(dispatch: ServerDispatch, rateLimits?: RateLimitOptions, cleanup?: CleanupOptions, options?: ServerOptions); stop(): void; onCreateConversation(handler: Handler<[ConversationRecord, string, number], void>): void; onCreateMessage(handler: Handler<[Message], void>): void; onCreateMessagesSystemRemoved(handler: Handler<[Message[]], { oldestMessagesByConversationId: Map; updatedParticipantActivities: ParticipantActivity[]; }>): void; onCreateReaction(handler: Handler<[Reaction], void>): void; onCreateInvite(handler: Handler<[Invite, number], { inserted: boolean; }>): void; onCreateConversationParticipant(handler: Handler<[string, string, number, number], void>): void; onCreateConversationParticipantActivity(handler: Handler<[ParticipantActivity], void>): void; onReadConversations(handler: Handler<[string], Conversation[]>): void; onReadMessages(handler: Handler<[string, string | null, boolean, number], { messages: Message[]; remainingInDirection: number; }>): void; onReadInvitesInvolvingParticipant(handler: Handler<[string], Invite[]>): void; onReadInvitesForRecipient(handler: Handler<[string, string], Invite[]>): void; onReadAliases(handler: Handler<[string[]], Alias[]>): void; onReadConversationParticipantActivity(handler: Handler<[string, string], ParticipantActivity | null>): void; onReadParticipantActivities(handler: Handler<[string], ParticipantActivity[]>): void; onReadMessage(handler: Handler<[string], Message | null>): void; onReadMessagesByIds(handler: Handler<[string[]], Message[]>): void; onReadConversationLastMessageMetadata(handler: Handler<[string], { messageId: string; createdAt: Date; } | null>): void; onReadConversation(handler: Handler<[string], Conversation | null>): void; onReadInvite(handler: Handler<[string, string, string], Invite | null>): void; onReadReaction(handler: Handler<[string], Reaction | null>): void; onReadHasNew(handler: Handler<[string], { hasNewMessages: boolean; hasNewInvites: boolean; }>): void; onUpdateMessage(handler: Handler<[Message], void>): void; onUpdateConversationParticipantActivity(handler: Handler<[ParticipantActivity], void>): void; onDeleteReaction(handler: Handler<[string], void>): void; onDeleteConversationParticipantAndParticipantActivity(handler: Handler<[string, string], void>): void; onDeleteAllConversationParticipantsAndParticipantActivitiesForParticipant(handler: Handler<[string], { deletedConversations: { conversationId: string; formerParticipantIds: string[]; deletedInvites: { fromParticipantId: string; toParticipantId: string; }[]; }[]; remainingConversations: { conversationId: string; conversationRecord: ConversationRecord; remainingParticipantIds: string[]; lastMessage: Message | null; }[]; }>): void; onDeleteConversationWithMessagesReactionsInvitesAndActivities(handler: Handler<[string], { deletedInvites: { fromParticipantId: string; toParticipantId: string; }[]; }>): void; onDeleteInvites(handler: Handler<[{ conversationId: string; fromParticipantId: string; toParticipantId: string; }[]], void>): void; onDeleteMessagesBefore(handler: Handler<[Date], { affectedConversationIds: string[]; }>): void; onDeleteConversationsWithMessagesReactionsInvitesAndActivitiesBefore(handler: Handler<[Date], { deletedConversations: { conversationId: string; formerParticipantIds: string[]; deletedInvites: { fromParticipantId: string; toParticipantId: string; }[]; }[]; }>): void; onDeleteInvitesBefore(handler: Handler<[Date], { deletedInvites: { conversationId: string; fromParticipantId: string; toParticipantId: string; }[]; }>): void; onParticipantAuth(handler: Handler<[string, unknown], boolean>): void; onInviteAuth(handler: Handler<[string, string], boolean>): void; onProfanityCheckCensor(handler: Handler<[string], string>): void; onProfanityCheckBlock(handler: Handler<[string], boolean>): void; receive(data: unknown): Promise; private verifyAuth; private handleRequest; private runHooks; private invoke; private handleSubscribe; private handleUnsubscribe; private runAdmin; createConversation(creatorParticipantId: string, maxSize?: number): Promise; createInvite(conversationId: string, fromParticipantId: string, toParticipantId: string): Promise; deleteParticipant(participantId: string): Promise; cleanupParticipant(participantId: string): void; acceptInvite(conversationId: string, participantId: string): Promise; revokeInvite(conversationId: string, fromParticipantId: string, toParticipantId: string): Promise; joinConversation(conversationId: string, participantId: string): Promise; leaveConversation(conversationId: string, participantId: string): Promise; sendMessage(conversationId: string, participantId: string, message: string, options?: MessageOptions, systemEvent?: SystemEvent): Promise; onAfterMessageCreated(handler: Handler<[Message], void>): void; onAfterMessageDeleted(handler: Handler<[Message], void>): void; onAfterParticipantJoined(handler: Handler<[string, string], void>): void; onAfterParticipantLeft(handler: Handler<[string, string], void>): void; onAfterInviteCreated(handler: Handler<[Invite], void>): void; onAfterInviteDeleted(handler: Handler<[string, string, string], void>): void; onAfterConversationCreated(handler: Handler<[Conversation], void>): void; onAfterConversationDeleted(handler: Handler<[string], void>): void; } //# sourceMappingURL=server.d.ts.map