///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
import type { DeleteResult, FilterQuery } from 'mongoose';
import type { AppConfig, IMessage } from '~/types';
export interface MessageMethods {
saveMessage(ctx: {
userId: string;
isTemporary?: boolean;
interfaceConfig?: AppConfig['interfaceConfig'];
}, params: Partial & {
newMessageId?: string;
}, metadata?: {
context?: string;
}): Promise;
bulkSaveMessages(messages: Array>, overrideTimestamp?: boolean): Promise;
recordMessage(params: {
user: string;
endpoint?: string;
messageId: string;
conversationId?: string;
parentMessageId?: string;
[key: string]: unknown;
}): Promise;
updateMessageText(userId: string, params: {
messageId: string;
text: string;
}): Promise;
updateMessage(userId: string, message: Partial & {
newMessageId?: string;
}, metadata?: {
context?: string;
}): Promise>;
deleteMessagesSince(userId: string, params: {
messageId: string;
conversationId: string;
}): Promise;
getMessages(filter: FilterQuery, select?: string): Promise;
getMessage(params: {
user: string;
messageId: string;
}): Promise;
getMessagesByCursor(filter: FilterQuery, options?: {
sortField?: string;
sortOrder?: 1 | -1;
limit?: number;
cursor?: string | null;
}): Promise<{
messages: IMessage[];
nextCursor: string | null;
}>;
searchMessages(query: string, searchOptions: Partial, hydrate?: boolean): Promise;
deleteMessages(filter: FilterQuery): Promise;
}
export declare function createMessageMethods(mongoose: typeof import('mongoose')): MessageMethods;