/**
 * Inbox Service - Unified notification inbox management
 *
 * Provides CRUD operations for inbox items:
 * - addToInbox: Add a new notification to an entity's inbox
 * - getInbox: Get inbox items for an entity with optional filtering
 * - getInboxPaginated: Get inbox items with pagination and total count
 * - markAsRead: Mark an inbox item as read
 * - markAsUnread: Mark an inbox item as unread
 * - markAllAsRead: Mark all unread items as read for an entity
 * - archive: Archive an inbox item
 *
 * The service does NOT integrate with MessageService - that is handled
 * in a separate integration layer (Phase 4).
 */
import type { StorageBackend } from '@stoneforge/storage';
import type { EntityId, ChannelId, InboxItem, InboxFilter, CreateInboxItemInput } from '@stoneforge/core';
/**
 * Service for managing inbox items
 */
export declare class InboxService {
    private readonly db;
    constructor(db: StorageBackend);
    /**
     * Initialize the inbox_items table schema
     * Should be called during database setup
     *
     * Note: In production, use migrations instead of this method.
     * This is provided for testing and standalone service usage.
     */
    initSchema(): void;
    /**
     * Add a new item to an entity's inbox
     *
     * @param input - Inbox item creation input
     * @returns The created inbox item
     * @throws ValidationError if input is invalid
     * @throws ConflictError if inbox item already exists for this recipient/message
     */
    addToInbox(input: CreateInboxItemInput): InboxItem;
    /**
     * Get inbox items for a recipient with optional filtering
     *
     * @param recipientId - Entity to get inbox for
     * @param filter - Optional filter criteria
     * @returns Array of inbox items
     */
    getInbox(recipientId: EntityId, filter?: InboxFilter): InboxItem[];
    /**
     * Get inbox items with pagination info
     *
     * @param recipientId - Entity to get inbox for
     * @param filter - Optional filter criteria (limit and offset used for pagination)
     * @returns Object with items and total count
     */
    getInboxPaginated(recipientId: EntityId, filter?: InboxFilter): {
        items: InboxItem[];
        total: number;
    };
    /**
     * Get the count of unread inbox items for a recipient
     *
     * @param recipientId - Entity to get unread count for
     * @returns Number of unread items
     */
    getUnreadCount(recipientId: EntityId): number;
    /**
     * Get a single inbox item by ID
     *
     * @param id - Inbox item ID
     * @returns The inbox item or null if not found
     */
    getInboxItem(id: string): InboxItem | null;
    /**
     * Mark an inbox item as read
     *
     * @param itemId - Inbox item ID to mark as read
     * @returns The updated inbox item
     * @throws NotFoundError if inbox item doesn't exist
     */
    markAsRead(itemId: string): InboxItem;
    /**
     * Mark multiple inbox items as read in a single operation.
     *
     * @param itemIds - Inbox item IDs to mark as read
     * @returns Number of items actually marked as read
     */
    markAsReadBatch(itemIds: string[]): number;
    /**
     * Mark an inbox item as unread
     *
     * @param itemId - Inbox item ID to mark as unread
     * @returns The updated inbox item
     * @throws NotFoundError if inbox item doesn't exist
     */
    markAsUnread(itemId: string): InboxItem;
    /**
     * Mark all unread inbox items as read for a recipient
     *
     * @param recipientId - Entity to mark all items as read for
     * @returns Number of items marked as read
     */
    markAllAsRead(recipientId: EntityId): number;
    /**
     * Archive an inbox item
     *
     * @param itemId - Inbox item ID to archive
     * @returns The updated inbox item
     * @throws NotFoundError if inbox item doesn't exist
     */
    archive(itemId: string): InboxItem;
    /**
     * Get inbox items for a specific channel
     *
     * @param recipientId - Entity to get inbox for
     * @param channelId - Channel to filter by
     * @returns Array of inbox items for the channel
     */
    getInboxByChannel(recipientId: EntityId, channelId: ChannelId): InboxItem[];
    /**
     * Delete inbox items by message ID (for cascade deletion)
     *
     * @param messageId - Message ID to delete inbox items for
     * @returns Number of items deleted
     */
    deleteByMessage(messageId: string): number;
    /**
     * Delete all inbox items for a recipient
     *
     * @param recipientId - Entity to delete inbox items for
     * @returns Number of items deleted
     */
    deleteByRecipient(recipientId: EntityId): number;
    /**
     * Build a SQL query from filter options
     */
    private buildFilterQuery;
    /**
     * Convert a database row to an InboxItem object
     */
    private rowToInboxItem;
}
/**
 * Create a new InboxService instance
 */
export declare function createInboxService(db: StorageBackend): InboxService;
//# sourceMappingURL=inbox.d.ts.map