import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core'; import { StorageAccountWithProvider } from '@memberjunction/core-entities'; import * as i0 from "@angular/core"; /** * Represents a file or folder item in the grid */ export interface FileGridItem { key: string; name: string; type: 'file' | 'folder'; size: number; lastModified: Date; contentType?: string; etag?: string; } /** * Result from a single provider's search */ export interface FileSearchResultItem { path: string; name: string; size: number; contentType: string; lastModified: string; relevance?: number; excerpt?: string; matchInFilename?: boolean; objectId?: string; } /** * Search results from a single account */ export interface AccountSearchResult { accountID: string; accountName: string; success: boolean; errorMessage?: string; results: FileSearchResultItem[]; totalMatches?: number; hasMore: boolean; nextPageToken?: string; } /** * Aggregated search results from multiple accounts */ export interface MultiProviderSearchResult { accountResults: AccountSearchResult[]; totalResultsReturned: number; successfulAccounts: number; failedAccounts: number; } /** * Displays files and folders in a grid/list view. * Shows file metadata like name, size, type, and last modified date. * Supports file selection and navigation to folders. */ export declare class FileGridComponent implements OnInit, OnChanges { /** * The storage account to list files from (includes provider details) */ account: StorageAccountWithProvider | null; /** * The current folder path to display */ folderPath: string; /** * Emits when a folder is double-clicked for navigation */ folderNavigate: EventEmitter; /** * Emits when the folder structure has changed (e.g., new folder created) * This signals that the folder tree should refresh */ folderStructureChanged: EventEmitter; /** * List of files and folders in the current directory */ items: FileGridItem[]; /** * Currently selected item keys in the grid (Kendo stores keys, not full objects) */ selectedItems: string[]; private cdr; /** * Loading state indicator */ isLoading: boolean; /** * Error message if loading fails */ errorMessage: string | null; /** * View mode: 'grid' or 'list' */ viewMode: 'grid' | 'list'; /** * Sort configuration for the grid */ sort: Array<{ field: string; dir?: 'asc' | 'desc'; }>; /** * Search query for filtering files/folders */ searchQuery: string; /** * File type filter ('all', 'files', 'folders') */ fileTypeFilter: 'all' | 'files' | 'folders'; /** * Filtered list of items based on search and filter criteria */ filteredItems: FileGridItem[]; /** * Drag-and-drop state */ isDragging: boolean; /** * Upload progress state */ isUploading: boolean; uploadProgress: number; uploadingFileName: string; /** * New folder dialog state */ showNewFolderDialog: boolean; newFolderName: string; isCreatingFolder: boolean; /** * Delete confirmation dialog state */ showDeleteDialog: boolean; itemToDelete: FileGridItem | null; isDeleting: boolean; /** * Rename dialog state */ showRenameDialog: boolean; itemToRename: FileGridItem | null; newItemName: string; isRenaming: boolean; /** * Copy dialog state */ showCopyDialog: boolean; itemToCopy: FileGridItem | null; copyDestinationPath: string; isCopying: boolean; /** * Move dialog state */ showMoveDialog: boolean; itemToMove: FileGridItem | null; moveDestinationPath: string; isMoving: boolean; /** * Copy to provider dialog state */ showCopyToProviderDialog: boolean; itemToCopyToProvider: FileGridItem | null; availableAccounts: StorageAccountWithProvider[]; selectedDestinationAccounts: Set; copyToAccountDestinationPath: string; isCopyingToAccount: boolean; copyToAccountProgress: { current: number; total: number; currentAccount: string; } | null; /** * Multi-provider search state */ isMultiProviderSearchMode: boolean; multiProviderSearchQuery: string; selectedSearchProviders: Set; isSearching: boolean; multiProviderSearchResults: MultiProviderSearchResult | null; /** * GraphQL client for file storage operations */ private storageClient; constructor(); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; /** * Loads files and folders from the current path */ private loadItems; /** * Applies search and filter criteria to the items list */ private applyFilters; /** * Handles search query changes */ onSearchChange(query: string): void; /** * Clears the search query */ clearSearch(): void; /** * Handles file type filter changes */ onFileTypeFilterChange(filterType: 'all' | 'files' | 'folders'): void; /** * Formats a file size in bytes to a human-readable string */ formatFileSize(bytes: number): string; /** * Formats a date to a readable string */ formatDate(date: Date): string; /** * Gets the icon class for a file or folder */ getItemIcon(item: FileGridItem): string; /** * Handles item selection change (not used - Kendo handles selection internally) */ onSelectionChange(selectedKeys: string[]): void; /** * Handles tile click in grid view for selection */ onTileClick(item: FileGridItem, event: MouseEvent): void; /** * Handles double-click on an item * For folders, navigate into them. For files, open/download them. */ onItemDoubleClick(item: FileGridItem): void; /** * Downloads a file by creating a pre-authenticated download URL */ private downloadFile; /** * Toggles between grid and list view */ toggleViewMode(): void; /** * Refreshes the current directory */ refresh(): void; /** * Navigates up to the parent directory */ navigateUp(): void; /** * Checks if we can navigate up (not at root) */ canNavigateUp(): boolean; /** * Handles sort change event from the grid */ onSortChange(sort: Array<{ field: string; dir?: 'asc' | 'desc'; }>): void; /** * Gets a human-readable file type based on extension */ getFileType(item: FileGridItem): string; /** * Handles upload button click - triggers file input */ onUploadClick(): void; /** * Handles drag enter event */ onDragEnter(event: DragEvent): void; /** * Handles drag over event */ onDragOver(event: DragEvent): void; /** * Handles drag leave event */ onDragLeave(event: DragEvent): void; /** * Handles drop event */ onDrop(event: DragEvent): void; /** * Uploads multiple files to the current folder */ private uploadFiles; /** * Uploads a single file */ private uploadSingleFile; /** * Uploads file to the pre-authenticated URL with progress tracking */ private uploadFileToUrl; /** * Opens the new folder dialog */ onNewFolderClick(): void; /** * Closes the new folder dialog */ onCancelNewFolder(): void; /** * Creates a new folder in the current directory */ onCreateFolder(): Promise; /** * Opens the delete confirmation dialog for the selected items */ onDeleteClick(): void; /** * Closes the delete confirmation dialog */ onCancelDelete(): void; /** * Deletes the selected item after confirmation */ onConfirmDelete(): Promise; /** * Opens the rename dialog for the selected item */ onRenameClick(): void; /** * Closes the rename dialog */ onCancelRename(): void; /** * Renames the selected item after confirmation */ onConfirmRename(): Promise; /** * Downloads the selected file */ onDownloadClick(): Promise; /** * Opens the copy dialog for the selected item */ onCopyClick(): void; /** * Cancels the copy operation */ onCancelCopy(): void; /** * Confirms and executes the copy operation */ onConfirmCopy(): Promise; /** * Opens the move dialog for the selected item */ onMoveClick(): void; /** * Cancels the move operation */ onCancelMove(): void; /** * Confirms and executes the move operation */ onConfirmMove(): Promise; /** * Constructs the full path for an item */ private constructItemPath; /** * Gets the currently selected item (if exactly one is selected) */ getSelectedItem(): FileGridItem | null; /** * Opens the copy to account dialog */ onCopyToAccountClick(): Promise; /** * Cancels the copy to account dialog */ onCancelCopyToAccount(): void; /** * Toggles selection of a destination account for copying */ toggleDestinationAccount(accountId: string): void; /** * Checks if an account is selected as a destination */ isDestinationAccountSelected(accountId: string): boolean; /** * Executes the cross-account copy to multiple selected accounts */ onConfirmCopyToAccount(): Promise; /** * Toggles multi-account search mode */ toggleMultiAccountSearchMode(): void; /** * Loads available accounts for search selection */ private loadAvailableAccountsForSearch; /** * Toggles account selection for search */ toggleSearchAccount(accountID: string): void; /** * Checks if an account is selected for search */ isAccountSelectedForSearch(accountID: string): boolean; /** * Checks if an account's provider supports search */ accountSupportsSearch(accountWithProvider: StorageAccountWithProvider): boolean; /** * Executes multi-account search */ executeMultiAccountSearch(): Promise; /** * Clears multi-provider search results */ clearMultiProviderSearch(): void; /** * Gets icon for a search result based on content type */ getSearchResultIcon(result: FileSearchResultItem): string; /** * Formats file size for search results */ formatSearchResultSize(bytes: number): string; /** * Formats date for search results */ formatSearchResultDate(dateStr: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=file-grid.component.d.ts.map