import type { EncryptedContent, IUpload } from '@rocket.chat/core-typings'; import type { DeleteResult, UpdateResult, ClientSession, Document, InsertOneResult, WithId, FindCursor } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; import type { DocumentWithProjection, FindOptionsWithProjection } from '../types/DocumentWithProjection'; export interface IBaseUploadsModel extends IBaseModel { insertFileInit(userId: string, store: string, file: { name: string }, extra: object): Promise>>; updateFileComplete(fileId: string, userId: string, file: object): Promise | undefined; confirmTemporaryFile(fileId: string, userId: string): Promise | undefined; findByIds = FindOptionsWithProjection>( _ids: string[], options?: O, ): FindCursor>; findOneByName(name: string, options?: { session?: ClientSession }): Promise; findOneByRoomId(rid: string): Promise; findExpiredTemporaryFiles = FindOptionsWithProjection>( options?: O, ): FindCursor>; updateFileNameById(fileId: string, name: string): Promise; deleteFile(fileId: string, options?: { session?: ClientSession }): Promise; findOneByIdAndUserIdAndRoomId = FindOptionsWithProjection>( fileId: string, userId: string, rid: string, options?: O, ): Promise | null>; updateFileMetadata( fileId: string, userId: string, metadata: { name?: string; description?: string; typeGroup?: string; content?: EncryptedContent }, ): Promise; }