import type Redis from "ioredis";
import type { RequestUser } from "../auth/auth.guard";
export declare class MessagesController {
    private readonly redis;
    constructor(redis: Redis);
    /**
     * The outbox-friendly send path (§5.3): a plain idempotent HTTP POST,
     * safe to replay from IndexedDB/SQLite on reconnect because of
     * `UNIQUE(channel_id, client_msg_id)` (I3). apps/gateway also exposes a
     * socket `message:send` event calling the same libs/messaging function —
     * this HTTP route doesn't require a live socket, which matters while a
     * client is still mid-catch-up (I7) or the gateway is briefly unreachable.
     */
    send(user: RequestUser, workspaceId: string, channelId: string, body: unknown): Promise<{
        type: string;
        workspaceId: number;
        channelId: number;
        id: number;
        createdAt: Date;
        deletedAt: Date | null;
        seq: number;
        clientMsgId: string;
        authorId: number;
        text: string;
        blocks: unknown;
        revision: number;
        parentId: number | null;
        isBroadcast: boolean;
        threadReplyCount: number;
        threadLastReplyAt: Date | null;
        editedAt: Date | null;
    }>;
    scrollback(user: RequestUser, workspaceId: string, channelId: string, query: unknown): Promise<{
        messages: {
            type: "text" | "system";
            id: number;
            createdAt: string;
            workspaceId: number;
            channelId: number;
            parentId: number | null;
            authorId: number;
            text: string;
            seq: number;
            clientMsgId: string;
            blocks: {
                v: 1;
                doc: Record<string, unknown>;
                forwardedMessage?: {
                    createdAt: string;
                    messageId: number;
                    channelId: number;
                    parentId: number | null;
                    channelName: string | null;
                    channelType: "public" | "private" | "dm" | "group_dm";
                    authorId: number;
                    authorName: string;
                    authorAvatarUrl: string | null;
                    text: string;
                    attachmentNames: string[];
                } | undefined;
            };
            revision: number;
            isBroadcast: boolean;
            threadReplyCount: number;
            threadLastReplyAt: string | null;
            editedAt: string | null;
            deletedAt: string | null;
            reactions?: {
                emoji: string;
                count: number;
                reactedByMe: boolean;
            }[] | undefined;
        }[];
    }>;
    thread(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        messages: {
            type: "text" | "system";
            id: number;
            createdAt: string;
            workspaceId: number;
            channelId: number;
            parentId: number | null;
            authorId: number;
            text: string;
            seq: number;
            clientMsgId: string;
            blocks: {
                v: 1;
                doc: Record<string, unknown>;
                forwardedMessage?: {
                    createdAt: string;
                    messageId: number;
                    channelId: number;
                    parentId: number | null;
                    channelName: string | null;
                    channelType: "public" | "private" | "dm" | "group_dm";
                    authorId: number;
                    authorName: string;
                    authorAvatarUrl: string | null;
                    text: string;
                    attachmentNames: string[];
                } | undefined;
            };
            revision: number;
            isBroadcast: boolean;
            threadReplyCount: number;
            threadLastReplyAt: string | null;
            editedAt: string | null;
            deletedAt: string | null;
            reactions?: {
                emoji: string;
                count: number;
                reactedByMe: boolean;
            }[] | undefined;
        }[];
    }>;
    one(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        message: {
            type: "text" | "system";
            id: number;
            createdAt: string;
            workspaceId: number;
            channelId: number;
            parentId: number | null;
            authorId: number;
            text: string;
            seq: number;
            clientMsgId: string;
            blocks: {
                v: 1;
                doc: Record<string, unknown>;
                forwardedMessage?: {
                    createdAt: string;
                    messageId: number;
                    channelId: number;
                    parentId: number | null;
                    channelName: string | null;
                    channelType: "public" | "private" | "dm" | "group_dm";
                    authorId: number;
                    authorName: string;
                    authorAvatarUrl: string | null;
                    text: string;
                    attachmentNames: string[];
                } | undefined;
            };
            revision: number;
            isBroadcast: boolean;
            threadReplyCount: number;
            threadLastReplyAt: string | null;
            editedAt: string | null;
            deletedAt: string | null;
            reactions?: {
                emoji: string;
                count: number;
                reactedByMe: boolean;
            }[] | undefined;
        };
    }>;
    edit(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        id: number;
        workspaceId: number;
        channelId: number;
        seq: number;
        clientMsgId: string;
        authorId: number;
        type: string;
        text: string;
        blocks: unknown;
        revision: number;
        parentId: number | null;
        isBroadcast: boolean;
        threadReplyCount: number;
        threadLastReplyAt: Date | null;
        editedAt: Date | null;
        deletedAt: Date | null;
        createdAt: Date;
    }>;
    forward(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        messages: {
            type: string;
            workspaceId: number;
            channelId: number;
            id: number;
            createdAt: Date;
            deletedAt: Date | null;
            seq: number;
            clientMsgId: string;
            authorId: number;
            text: string;
            blocks: unknown;
            revision: number;
            parentId: number | null;
            isBroadcast: boolean;
            threadReplyCount: number;
            threadLastReplyAt: Date | null;
            editedAt: Date | null;
        }[];
    }>;
    remove(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        deleted: boolean;
    }>;
    addReaction(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        added: boolean;
    }>;
    removeReaction(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        removed: boolean;
    }>;
    pin(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        pinned: boolean;
    }>;
    unpin(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        unpinned: boolean;
    }>;
    /** Spins up a workspace-wide Task pre-filled from this message (§ Tasks
     * feature) — lives here rather than TasksController because the input
     * identity (workspace/channel/message) is exactly what this controller
     * already carries via @Param, same as pin/unpin/reactions do. */
    createTask(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        description: string | null;
        title: string;
        status: "todo" | "in_progress" | "done";
        id: number;
        createdAt: string;
        workspaceId: number;
        createdBy: number;
        channelId: number | null;
        deletedAt: string | null;
        updatedAt: string;
        assigneeUserId: number | null;
        dueAt: string | null;
        sourceMessageId: number | null;
        completedAt: string | null;
        deletedBy: number | null;
    }>;
    markThreadRead(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        updated: boolean;
        status: {
            workspaceId: number;
            channelId: number;
            following: boolean;
            reason: string | null;
            lastReadReplySeq: number;
            unreadReplyCount: number;
            rootMessageId: number;
        };
    }>;
    threadStatus(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        status: {
            workspaceId: number;
            channelId: number;
            following: boolean;
            reason: string | null;
            lastReadReplySeq: number;
            unreadReplyCount: number;
            rootMessageId: number;
        };
    }>;
    setThreadFollowing(user: RequestUser, workspaceId: string, channelId: string, messageId: string, body: unknown): Promise<{
        status: {
            workspaceId: number;
            channelId: number;
            following: boolean;
            reason: string | null;
            lastReadReplySeq: number;
            unreadReplyCount: number;
            rootMessageId: number;
        };
    }>;
    markUnread(user: RequestUser, workspaceId: string, channelId: string, messageId: string): Promise<{
        lastReadSeq: number;
        unreadCount: number;
    }>;
}
export declare class ThreadsController {
    list(user: RequestUser, workspaceId: string): Promise<{
        threads: {
            channelName: string | null;
            rootMessage: {
                type: "text" | "system";
                id: number;
                createdAt: string;
                workspaceId: number;
                channelId: number;
                parentId: number | null;
                authorId: number;
                text: string;
                seq: number;
                clientMsgId: string;
                blocks: {
                    v: 1;
                    doc: Record<string, unknown>;
                    forwardedMessage?: {
                        createdAt: string;
                        messageId: number;
                        channelId: number;
                        parentId: number | null;
                        channelName: string | null;
                        channelType: "public" | "private" | "dm" | "group_dm";
                        authorId: number;
                        authorName: string;
                        authorAvatarUrl: string | null;
                        text: string;
                        attachmentNames: string[];
                    } | undefined;
                };
                revision: number;
                isBroadcast: boolean;
                threadReplyCount: number;
                threadLastReplyAt: string | null;
                editedAt: string | null;
                deletedAt: string | null;
                reactions?: {
                    emoji: string;
                    count: number;
                    reactedByMe: boolean;
                }[] | undefined;
            };
            latestReply: {
                type: "text" | "system";
                id: number;
                createdAt: string;
                workspaceId: number;
                channelId: number;
                parentId: number | null;
                authorId: number;
                text: string;
                seq: number;
                clientMsgId: string;
                blocks: {
                    v: 1;
                    doc: Record<string, unknown>;
                    forwardedMessage?: {
                        createdAt: string;
                        messageId: number;
                        channelId: number;
                        parentId: number | null;
                        channelName: string | null;
                        channelType: "public" | "private" | "dm" | "group_dm";
                        authorId: number;
                        authorName: string;
                        authorAvatarUrl: string | null;
                        text: string;
                        attachmentNames: string[];
                    } | undefined;
                };
                revision: number;
                isBroadcast: boolean;
                threadReplyCount: number;
                threadLastReplyAt: string | null;
                editedAt: string | null;
                deletedAt: string | null;
                reactions?: {
                    emoji: string;
                    count: number;
                    reactedByMe: boolean;
                }[] | undefined;
            } | null;
            following: boolean;
            reason: string;
            lastReadReplySeq: number;
            unreadReplyCount: number;
            participants: {
                name: string;
                avatarUrl: string | null;
                userId: number;
            }[];
        }[];
    }>;
}
export declare class ReadStateController {
    private readonly redis;
    constructor(redis: Redis);
    markRead(user: RequestUser, workspaceId: string, channelId: string, body: unknown): Promise<{
        updated: boolean;
    }>;
}
//# sourceMappingURL=messages.controller.d.ts.map