import { SupportConversationRow, SupportSenderType } from '../models/support.model'; export declare function isStaffRole(role: string | undefined): boolean; export type SupportAccessContext = { userId?: string; role?: string; visitorToken?: string | null; }; export declare function assertConversationAccess(conversationId: string, ctx: SupportAccessContext): Promise; export declare function getOrCreateConversation(ctx: SupportAccessContext): Promise<{ id: string; userId: string | null; visitorToken: string | null; isAnonymous: boolean; subject: string | null; status: import("../models/support.model").SupportConversationStatus; assignedTo: string | null; lastMessageAt: string | null; lastMessagePreview: string | null; unreadUser: number; unreadStaff: number; createdAt: string; updatedAt: string; }>; export declare function listUserConversations(ctx: SupportAccessContext): Promise<{ id: string; userId: string | null; visitorToken: string | null; isAnonymous: boolean; subject: string | null; status: import("../models/support.model").SupportConversationStatus; assignedTo: string | null; lastMessageAt: string | null; lastMessagePreview: string | null; unreadUser: number; unreadStaff: number; createdAt: string; updatedAt: string; }[]>; export declare function getConversationMessages(conversationId: string, ctx: SupportAccessContext, after?: string): Promise<{ messages: { id: string; conversationId: string; senderType: SupportSenderType; senderUserId: string | null; senderDisplayName: string | null; body: string | null; attachmentUrl: string | null; attachmentName: string | null; attachmentMime: string | null; readAt: string | null; createdAt: string; }[]; typing: { userTyping: boolean; staffTyping: boolean; }; }>; export declare function sendMessage(conversationId: string, ctx: SupportAccessContext, input: { body?: string; attachmentUrl?: string; attachmentName?: string; attachmentMime?: string; }): Promise<{ id: string; conversationId: string; senderType: SupportSenderType; senderUserId: string | null; senderDisplayName: string | null; body: string | null; attachmentUrl: string | null; attachmentName: string | null; attachmentMime: string | null; readAt: string | null; createdAt: string; }>; export declare function setTyping(conversationId: string, ctx: SupportAccessContext, active: boolean): Promise<{ ok: boolean; }>; export declare function listAdminConversations(filters: { status?: string; assignedTo?: string | null; search?: string; page?: number; pageSize?: number; }): Promise<{ items: { id: string; userId: string | null; visitorToken: string | null; isAnonymous: boolean; subject: string | null; status: import("../models/support.model").SupportConversationStatus; assignedTo: string | null; lastMessageAt: string | null; lastMessagePreview: string | null; unreadUser: number; unreadStaff: number; createdAt: string; updatedAt: string; }[]; total: number; page: number; pageSize: number; totalPages: number; }>; export declare function getAdminConversationDetail(conversationId: string): Promise<{ conversation: { id: string; userId: string | null; visitorToken: string | null; isAnonymous: boolean; subject: string | null; status: import("../models/support.model").SupportConversationStatus; assignedTo: string | null; lastMessageAt: string | null; lastMessagePreview: string | null; unreadUser: number; unreadStaff: number; createdAt: string; updatedAt: string; }; user: { id: string; email: string | null; firstName: string | null; lastName: string | null; displayName: string | null; role: string; emailVerified: boolean; isEnabled: boolean; createdAt: string; } | null; }>; export declare function updateAdminConversation(conversationId: string, staffUserId: string, patch: { status?: string; assignedTo?: string | null; subject?: string; }): Promise<{ id: string; userId: string | null; visitorToken: string | null; isAnonymous: boolean; subject: string | null; status: import("../models/support.model").SupportConversationStatus; assignedTo: string | null; lastMessageAt: string | null; lastMessagePreview: string | null; unreadUser: number; unreadStaff: number; createdAt: string; updatedAt: string; }>; export declare function getStaffUnreadCount(): Promise; export declare function resolveUploadPath(storedName: string): string; export declare function ensureUploadDir(): string; export declare function publicAttachmentUrl(storedName: string): string; /** Links all anonymous visitor conversations to a newly registered or logged-in user. */ export declare function mergeVisitorSupportForUser(userId: string, visitorToken: string | null | undefined): Promise; //# sourceMappingURL=supportService.d.ts.map