import { Kysely } from 'kysely';
import { DB } from "../../database/database.type";
type OpenConversationInput = {
    otherUserId: string;
    report_id?: string | null;
};
type ParsedMessageContent = {
    messageType: 'text' | 'pet_token' | 'report_token' | 'location_token';
    petProfileId: string | null;
    reportId: string | null;
    location: {
        latitude: number;
        longitude: number;
        label: string;
    } | null;
    previewText: string;
};
export declare function parseMessageContent(text: string): ParsedMessageContent;
export declare class ConversationsService {
    private readonly db;
    constructor(db: Kysely<DB>);
    private findConversationByIdForUser;
    private validateMessageText;
    private buildMessageAttachments;
    private normalizeMessageRow;
    private hydrateMessages;
    getConversations(user_id: string): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            id: string;
            report_id: string | null;
            otherUserId: string;
            otherUserName: string;
            lastMessageText: string;
            lastMessageRawText: string;
            lastMessageType: "text" | "pet_token" | "report_token" | "location_token";
            lastMessagePetProfileId: string | null;
            lastMessageReportId: string | null;
            lastMessageLocation: {
                latitude: number;
                longitude: number;
                label: string;
            } | null;
            lastMessageAt: string;
            unreadCount: number;
            reportpet_name: string | null;
            reportStatus: string | null;
            reportPhoto: string | null;
            created_at: string;
        }[];
    }>;
    createConversation(user_id: string, data: {
        participant2Id: string;
        report_id?: string | null;
    }): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            id: string;
            report_id: string | null;
            otherUserId: string;
            otherUserName: string;
            lastMessageText: string;
            lastMessageRawText: string;
            lastMessageType: "text" | "pet_token" | "report_token" | "location_token";
            lastMessagePetProfileId: string | null;
            lastMessageReportId: string | null;
            lastMessageLocation: {
                latitude: number;
                longitude: number;
                label: string;
            } | null;
            lastMessageAt: string;
            unreadCount: number;
            reportpet_name: string | null;
            reportStatus: string | null;
            reportPhoto: string | null;
            created_at: string;
        };
    }>;
    openConversation(user_id: string, data: OpenConversationInput): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            id: string;
            report_id: string | null;
            otherUserId: string;
            otherUserName: string;
            lastMessageText: string;
            lastMessageRawText: string;
            lastMessageType: "text" | "pet_token" | "report_token" | "location_token";
            lastMessagePetProfileId: string | null;
            lastMessageReportId: string | null;
            lastMessageLocation: {
                latitude: number;
                longitude: number;
                label: string;
            } | null;
            lastMessageAt: string;
            unreadCount: number;
            reportpet_name: string | null;
            reportStatus: string | null;
            reportPhoto: string | null;
            created_at: string;
        };
    }>;
    getMessages(user_id: string, conversationId: string, limit?: number): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            id: string;
            conversationId: string;
            senderId: string;
            senderName: string;
            text: string;
            messageType: "text" | "pet_token" | "report_token" | "location_token";
            petProfileId: string | null;
            reportId: string | null;
            location: {
                latitude: number;
                longitude: number;
                label: string;
            } | null;
            attachment: any;
            previewText: string;
            isMe: boolean;
            readAt: string | null;
            created_at: string;
        }[];
    }>;
    sendMessage(senderId: string, conversationId: string, text: string): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            id: string;
            conversationId: string;
            senderId: string;
            senderName: string;
            text: string;
            messageType: "text" | "pet_token" | "report_token" | "location_token";
            petProfileId: string | null;
            reportId: string | null;
            location: {
                latitude: number;
                longitude: number;
                label: string;
            } | null;
            attachment: any;
            previewText: string;
            isMe: boolean;
            readAt: string | null;
            created_at: string;
        };
    }>;
    markAsRead(user_id: string, conversationId: string): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            message: string;
            updatedCount: number;
        };
    }>;
    getConversationSummary(user_id: string, conversationId: string): Promise<{
        status: boolean;
        statusCode: number;
        data: {
            id: string;
            report_id: string | null;
            otherUserId: string;
            otherUserName: string;
            lastMessageText: string;
            lastMessageRawText: string;
            lastMessageType: "text" | "pet_token" | "report_token" | "location_token";
            lastMessagePetProfileId: string | null;
            lastMessageReportId: string | null;
            lastMessageLocation: {
                latitude: number;
                longitude: number;
                label: string;
            } | null;
            lastMessageAt: string;
            unreadCount: number;
            reportpet_name: string | null;
            reportStatus: string | null;
            reportPhoto: string | null;
            created_at: string;
        };
    }>;
}
export {};
