import type { SelectedFile } from "@webiny/app-admin/presentation/browserFilePicker/index.js"; import type { CmsModel } from "@webiny/app-headless-cms-common/types/index.js"; import type { IListViewModel } from "@webiny/app-admin/presentation/listPresenter/abstractions.js"; import type { IListActions } from "@webiny/app-admin/presentation/listPresenter/abstractions.js"; import type { IFolderTreeViewModel } from "@webiny/app-aco/presentation/folderTree/abstractions.js"; import type { FolderDto } from "@webiny/app-aco"; import type { IFileDetailsPresenter } from "../FileDetails/abstractions.js"; import type { FmFile } from "../../features/shared/types.js"; import type { FmTag } from "../../features/shared/types.js"; import type { UploadJob } from "../../features/fileUploader/abstractions.js"; export interface IFileManagerInitConfig { initialFolderId?: string; scope?: string; accept?: string[]; } export interface IFileManagerViewModel { fileModel: CmsModel | null; list: IListViewModel; folders: IFolderTreeViewModel; fileDetails: IFileDetailsPresenter | null; tags: FmTag[]; upload: { jobs: UploadJob[]; overallProgress: { percentage: number; bytesSent: number; totalBytes: number; }; isUploading: boolean; }; loading: boolean; empty: boolean; showFolders: boolean; childFolders: FolderDto[]; viewMode: "table" | "grid"; dragging: boolean; showingFilters: boolean; permissions: { canRead: boolean; canCreate: boolean; canEdit: boolean; canDelete: boolean; canEditFile: (file: FmFile) => boolean; canDeleteFile: (file: FmFile) => boolean; }; } export interface IFolderActions { selectFolder(folderId: string | null): void; createFolder(parentFolderId?: string): void; editFolder(folderId: string): void; deleteFolder(folderId: string): Promise; moveFolder(folderId: string, targetParentId: string | null): Promise; loadChildFolders(parentIds: string[]): Promise; canManageStructure(folderId: string): boolean; getAncestorIds(folderId: string): string[]; submitOperation(): Promise; cancelOperation(): void; } export interface IFileManagerActions extends IListActions { showFileDetails(id: string): void; hideFileDetails(): void; upload(files: SelectedFile[]): Promise; setViewMode(mode: "table" | "grid"): void; setDragging(dragging: boolean): void; showFilters(): void; hideFilters(): void; folders: IFolderActions; } export interface IFileManagerPresenter { vm: IFileManagerViewModel; actions: IFileManagerActions; init(config?: IFileManagerInitConfig): void; dispose(): void; } export declare const FileManagerPresenter: import("@webiny/di").Abstraction; export declare namespace FileManagerPresenter { type Interface = IFileManagerPresenter; type ViewModel = IFileManagerViewModel; type Actions = IFileManagerActions; type InitConfig = IFileManagerInitConfig; }