import { AttachmentService } from './services/attachment.service';
import { FastifyReply, FastifyRequest } from 'fastify';
import { ModuleRef } from '@nestjs/core';
import { User, Workspace } from "../../database/types/entity.types";
import { StorageService } from '../../integrations/storage/storage.service';
import { AttachmentType } from './attachment.constants';
import SpaceAbilityFactory from '../casl/abilities/space-ability.factory';
import WorkspaceAbilityFactory from '../casl/abilities/workspace-ability.factory';
import { PageRepo } from "../../database/repos/page/page.repo";
import { TemplateRepo } from "../../database/repos/template/template.repo";
import { SpaceMemberRepo } from "../../database/repos/space/space-member.repo";
import { AttachmentRepo } from "../../database/repos/attachment/attachment.repo";
import { EnvironmentService } from '../../integrations/environment/environment.service';
import { TokenService } from '../auth/services/token.service';
import { AttachmentInfoDto, DeleteAttachmentDto, PageIdDto, RemoveIconDto } from './dto/attachment.dto';
import { PaginationOptions } from "../../database/pagination/pagination-options";
import { PageAccessService } from '../page/page-access/page-access.service';
import { DomainService } from '../../integrations/environment/domain.service';
import { IAuditService } from '../../integrations/audit/audit.service';
export declare class AttachmentController {
    private readonly attachmentService;
    private readonly storageService;
    private readonly workspaceAbility;
    private readonly spaceAbility;
    private readonly pageRepo;
    private readonly attachmentRepo;
    private readonly environmentService;
    private readonly tokenService;
    private readonly pageAccessService;
    private readonly domainService;
    private readonly auditService;
    private readonly templateRepo;
    private readonly spaceMemberRepo;
    private readonly moduleRef;
    private readonly logger;
    constructor(attachmentService: AttachmentService, storageService: StorageService, workspaceAbility: WorkspaceAbilityFactory, spaceAbility: SpaceAbilityFactory, pageRepo: PageRepo, attachmentRepo: AttachmentRepo, environmentService: EnvironmentService, tokenService: TokenService, pageAccessService: PageAccessService, domainService: DomainService, auditService: IAuditService, templateRepo: TemplateRepo, spaceMemberRepo: SpaceMemberRepo, moduleRef: ModuleRef);
    uploadFile(req: any, res: FastifyReply, user: User, workspace: Workspace): Promise<never>;
    getFile(req: FastifyRequest, res: FastifyReply, user: User, workspace: Workspace, fileId: string, fileName?: string): Promise<never>;
    getPublicFile(req: FastifyRequest, res: FastifyReply, workspace: Workspace, fileId: string, fileName?: string, jwtToken?: string): Promise<never>;
    uploadAvatarOrLogo(req: any, res: FastifyReply, user: User, workspace: Workspace): Promise<never>;
    getLogoOrAvatar(res: FastifyReply, workspace: Workspace, attachmentType: AttachmentType, fileName?: string): Promise<never>;
    getAttachmentInfo(dto: AttachmentInfoDto, workspace: Workspace, user: User): Promise<{
        url: string;
        type: string;
        id: string;
        workspaceId: string;
        creatorId: string;
        createdAt: Date;
        updatedAt: Date;
        deletedAt: Date;
        tsv: string;
        spaceId: string;
        textContent: string;
        pageId: string;
        aiChatId: string;
        fileExt: string;
        fileName: string;
        filePath: string;
        fileSize: string;
        indexedAt: Date;
        mimeType: string;
        templateId: string;
    }>;
    getPageAttachments(dto: PageIdDto, pagination: PaginationOptions, user: User, workspace: Workspace): Promise<{
        items: {
            url: string;
            type: string;
            id: string;
            workspaceId: string;
            creatorId: string;
            createdAt: Date;
            updatedAt: Date;
            deletedAt: Date;
            tsv: string;
            spaceId: string;
            textContent: string;
            pageId: string;
            aiChatId: string;
            fileExt: string;
            fileName: string;
            filePath: string;
            fileSize: string;
            indexedAt: Date;
            mimeType: string;
            templateId: string;
            creator: {
                id: string;
                name: string;
                avatarUrl: string;
            };
        }[];
        meta: {
            limit: number;
            hasNextPage: boolean;
            hasPrevPage: boolean;
            nextCursor: string | null;
            prevCursor: string | null;
        };
    }>;
    deleteAttachment(dto: DeleteAttachmentDto, user: User, workspace: Workspace): Promise<void>;
    removeIcon(dto: RemoveIconDto, user: User, workspace: Workspace): Promise<void>;
    private buildFileUrl;
    private findEditableTemplate;
    private canViewTemplateFile;
    private sendFileResponse;
}
