import { OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { MJFileEntity } from '@memberjunction/core-entities'; import { SharedService } from '@memberjunction/ng-shared'; import { ColDef, GridReadyEvent, type Theme } from 'ag-grid-community'; import { FileUploadEvent } from '../file-upload/file-upload'; import * as i0 from "@angular/core"; export declare class FilesGridComponent implements OnInit, OnChanges { private sharedService; files: MJFileEntity[]; isLoading: boolean; editFile: MJFileEntity | undefined; GridTheme: Theme; ColumnDefs: ColDef[]; DefaultColDef: ColDef; private gridApi; constructor(sharedService: SharedService); CategoryID: string | undefined; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; OnGridReady(event: GridReadyEvent): void; /** * Resets the edited file. * * This method reverts any changes made to the edited file by calling the Revert method of the MJFileEntity class. It then sets the editFile property to undefined, indicating that there is no longer an edited file. * * @returns void */ resetEditFile(): void; /** * Saves the edited file. * * This method saves the changes made to the edited file. It first checks if there is an edited file available. If so, it sets the isLoading property to true to indicate that the save operation is in progress. Then, it calls the Save method of the edited file to save the changes. If the save operation is successful, it creates a success notification using the sharedService.CreateSimpleNotification method. The notification message includes the ID and name of the saved file. Finally, it sets the edited file to undefined and sets the isLoading property to false to indicate that the save operation is complete. * * @returns Promise - A promise that resolves when the save operation is complete. * @throws Error - If there is an error during the save operation. */ saveEditFile(): Promise; /** * Downloads a file using the provided MJFileEntity. * * @param file - The MJFileEntity representing the file to be downloaded. * @returns Promise - A promise that resolves when the file download is complete. * @throws Error - If there is an error during the file download process. */ downloadFile: (file: MJFileEntity) => Promise; /** * Determines whether a file can be deleted based on its status and creation time. * * @param file - The MJFileEntity representing the file to be checked. * @returns boolean - True if the file can be deleted, false otherwise. */ canBeDeleted(file: MJFileEntity): boolean; /** * Deletes a file using the provided MJFileEntity. * * @param file - The MJFileEntity representing the file to be deleted. * @returns Promise - A promise that resolves when the file deletion is complete. * @throws Error - If there is an error during the file deletion process. */ deleteFile: (file: MJFileEntity) => Promise; /** * Handles the file upload event, sending a notification in case of failure and otherwise adding * the newly uploaded files to the files currently displayed. * * @param e - The file upload event. */ handleFileUpload(e: FileUploadEvent): void; /** * Refreshes the data by running a view and loading the files. * @returns {Promise} - A promise that resolves when the data is refreshed. */ Refresh(): Promise; /** * Builds AG Grid column definitions from the entity fields. */ private buildColumnDefs; /** * Creates a small action button element for the AG Grid cell renderer. */ private createActionButton; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=files-grid.d.ts.map