import { type RequestUser } from "../auth/auth.guard";
import { ObjectStorageService } from "./object-storage.service";
export declare class FilesController {
    private readonly storage;
    constructor(storage: ObjectStorageService);
    presign(user: RequestUser, workspaceIdParam: string, channelIdParam: string, body: unknown): Promise<{
        attachment: {
            type: string;
            id: number;
            name: string;
            createdAt: string;
            workspaceId: number;
            messageId: number | null;
            channelId: number;
            uploadedBy: number;
            size: number;
            category: "text" | "audio" | "video" | "image" | "pdf" | "document" | "archive";
        };
        uploadUrl: string;
        uploadHeaders: {
            "content-type": string;
        };
        expiresIn: number;
    }>;
    /**
     * Browser PUT-to-S3 is blocked until the bucket has CORS. This path
     * streams the bytes through the API (same object key as presign).
     */
    putBytes(user: RequestUser, workspaceIdParam: string, channelIdParam: string, fileIdParam: string, req: {
        file: () => Promise<{
            toBuffer: () => Promise<Buffer>;
        } | undefined>;
    }): Promise<{
        uploaded: boolean;
    }>;
    complete(user: RequestUser, workspaceIdParam: string, channelIdParam: string, fileIdParam: string): Promise<{
        attachment: {
            type: string;
            id: number;
            name: string;
            createdAt: string;
            workspaceId: number;
            messageId: number | null;
            channelId: number;
            uploadedBy: number;
            size: number;
            category: "text" | "audio" | "video" | "image" | "pdf" | "document" | "archive";
        };
    }>;
    access(user: RequestUser, workspaceIdParam: string, channelIdParam: string, fileIdParam: string): Promise<{
        url: string;
        expiresAt: string;
    }>;
    /** Read-only compatibility for files uploaded by the old local-filesystem
     * endpoint. New uploads never use this path; preserving it avoids breaking
     * historical message blocks while teams migrate objects to S3. */
    legacyDownload(user: RequestUser, workspaceIdParam: string, channelIdParam: string, fileId: string, name: string, reply: {
        header: (name: string, value: string) => void;
        send: (payload: unknown) => unknown;
    }): Promise<unknown>;
    remove(user: RequestUser, workspaceIdParam: string, channelIdParam: string, fileIdParam: string): Promise<{
        deleted: boolean;
    }>;
    browse(user: RequestUser, workspaceIdParam: string, query: unknown): Promise<{
        files: {
            channelName: string | null;
            channelType: "public" | "private" | "dm" | "group_dm";
            uploaderName: string;
            messageText: string | null;
            type: string;
            id: number;
            name: string;
            createdAt: string;
            workspaceId: number;
            messageId: number | null;
            channelId: number;
            uploadedBy: number;
            size: number;
            category: "text" | "audio" | "video" | "image" | "pdf" | "document" | "archive";
        }[];
        nextCursor: number | null;
    }>;
}
//# sourceMappingURL=files.controller.d.ts.map