import { ExpressionBuilder } from 'kysely';
import { DB } from '@docmost/db/types/db';
import { KyselyDB, KyselyTransaction } from "../../types/kysely.types";
import { Attachment, InsertableAttachment, UpdatableAttachment } from "../../types/entity.types";
import { PaginationOptions } from "../../pagination/pagination-options";
export declare class AttachmentRepo {
    private readonly db;
    constructor(db: KyselyDB);
    private baseFields;
    findById(attachmentId: string, opts?: {
        trx?: KyselyTransaction;
    }): Promise<Attachment>;
    findByIdWithContent(attachmentId: string, opts?: {
        trx?: KyselyTransaction;
    }): Promise<Attachment>;
    insertAttachment(insertableAttachment: InsertableAttachment, trx?: KyselyTransaction): Promise<Attachment>;
    findBySpaceId(spaceId: string, opts?: {
        trx?: KyselyTransaction;
    }): Promise<Attachment[]>;
    findPageAttachments(pageId: string, pagination: PaginationOptions): Promise<import("@docmost/db/pagination/cursor-pagination").CursorPaginationResult<{
        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;
        };
    }, undefined>>;
    withCreator(eb: ExpressionBuilder<DB, 'attachments'>): import("kysely").AliasedRawBuilder<{
        id: string;
        name: string;
        avatarUrl: string;
    }, "creator">;
    findByIds(ids: string[], opts?: {
        trx?: KyselyTransaction;
    }): Promise<Attachment[]>;
    findByAiChatId(aiChatId: string, opts?: {
        trx?: KyselyTransaction;
    }): Promise<Attachment[]>;
    findByTemplateId(templateId: string, opts?: {
        trx?: KyselyTransaction;
    }): Promise<Attachment[]>;
    updateAttachmentsByTemplateId(updatable: UpdatableAttachment, templateId: string, trx?: KyselyTransaction): Promise<void>;
    updateAttachmentsByPageId(updatableAttachment: UpdatableAttachment, pageIds: string[], trx?: KyselyTransaction): Promise<{
        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;
    }>;
    updateAttachment(updatableAttachment: UpdatableAttachment, attachmentId: string): Promise<Attachment>;
    claimAttachmentsForChat(attachmentIds: string[], aiChatId: string, creatorId: string, workspaceId: string): Promise<void>;
    deleteAttachmentById(attachmentId: string): Promise<void>;
    deleteAttachmentByFilePath(attachmentFilePath: string): Promise<void>;
}
