import type { ICollectionObserver, ICollectionSubscriber } from '@aurelia/runtime'; import type { BackendService, BackendServiceApi, BasePaginationComponent, Column, EventSubscription, ExtensionList, ExternalResource, ExternalResourceConstructor, Locale, Metrics, Pagination, PaginationMetadata } from '@slickgrid-universal/common'; import { BackendUtilityService, CollectionService, ExtensionService, ExtensionUtility, FilterFactory, FilterService, GridEventService, GridService, GridStateService, HeaderGroupingService, PaginationService, ResizerService, SharedService, SlickDataView, SlickEventHandler, SlickGrid, SlickGroupItemMetadataProvider, SortService, TreeDataService, type RxJsFacade } from '@slickgrid-universal/common'; import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component'; import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component'; import { EventPubSubService } from '@slickgrid-universal/event-pub-sub'; import { IContainer, IEventAggregator, IObserverLocator, type IDisposable } from 'aurelia'; import type { AureliaGridInstance, GridOption } from '../models/index.js'; import { AureliaUtilService, ContainerService, TranslaterService } from '../services/index.js'; export interface AureliaRowDetailView { create(columns: Column[], gridOptions: GridOption): any; init(grid: SlickGrid, containerService?: ContainerService): void; } export declare class AureliaSlickgridCustomElement { protected readonly aureliaUtilService: AureliaUtilService; protected readonly observerLocator: IObserverLocator; protected readonly container: IContainer; protected readonly elm: HTMLElement; protected readonly globalEa: IEventAggregator; protected readonly containerService: ContainerService; protected readonly translaterService: TranslaterService; protected _columns: Column[]; protected _columnsObserver?: ICollectionObserver<'array'>; protected _columnsSubscriber: ICollectionSubscriber; protected _currentDatasetLength: number; protected _darkMode: boolean; protected _dataset: any[] | null; protected _eventHandler: SlickEventHandler; protected _eventPubSubService: EventPubSubService; protected _hideHeaderRowAfterPageLoad: boolean; protected _isAutosizeColsCalled: boolean; protected _isGridInitialized: boolean; protected _isDatasetInitialized: boolean; protected _isDatasetHierarchicalInitialized: boolean; protected _isPaginationInitialized: boolean; protected _isLocalGrid: boolean; protected _paginationOptions: Pagination | undefined; protected _registeredResources: Array; protected _scrollEndCalled: boolean; backendServiceApi: BackendServiceApi | undefined; locales: Locale; groupItemMetadataProvider?: SlickGroupItemMetadataProvider; metrics?: Metrics; paginationData?: { gridOptions: GridOption; paginationService: PaginationService; }; serviceList: any[]; showPagination: boolean; subscriptions: Array; slickEmptyWarning: SlickEmptyWarningComponent | undefined; slickFooter: SlickFooterComponent | undefined; paginationComponent: BasePaginationComponent | undefined; slickPagination: BasePaginationComponent | undefined; slickRowDetailView?: AureliaRowDetailView; backendUtilityService: BackendUtilityService; collectionService: CollectionService; extensionService: ExtensionService; extensionUtility: ExtensionUtility; filterFactory: FilterFactory; filterService: FilterService; gridContainer: HTMLDivElement; gridEventService: GridEventService; gridService: GridService; gridStateService: GridStateService; headerGroupingService: HeaderGroupingService; paginationService: PaginationService; resizerService: ResizerService; rxjs?: RxJsFacade; sharedService: SharedService; sortService: SortService; treeDataService: TreeDataService; columns: Column[]; element: Element; dataview: SlickDataView; grid: SlickGrid; paginationOptions: Pagination | undefined; totalItems: number; extensions: ExtensionList; instances: AureliaGridInstance | null; customDataView?: SlickDataView; dataset: any[]; datasetHierarchical?: any[] | null; gridId: string; options: GridOption; constructor(aureliaUtilService?: AureliaUtilService, observerLocator?: IObserverLocator, container?: IContainer, elm?: HTMLElement, globalEa?: IEventAggregator, containerService?: ContainerService, translaterService?: TranslaterService); get backendService(): BackendService | undefined; get eventHandler(): SlickEventHandler; get isDatasetInitialized(): boolean; set isDatasetInitialized(isInitialized: boolean); set isDatasetHierarchicalInitialized(isInitialized: boolean); get registeredResources(): Array; attached(): void; initialization(eventHandler: SlickEventHandler): void; /** Do not confuse with the Aurelia hook - it's been renamed */ detaching(shouldEmptyDomElementContainer?: boolean): void; emptyGridContainerElm(): void; /** Do not rename to `dispose` as it's an Aurelia hook */ disposeInstance(shouldEmptyDomElementContainer?: boolean): void; disposeExternalResources(): void; bound(): void; /** on columnDefinitions assignment and/or .slice() call */ columnsChanged(): void; datasetChanged(newDataset: any[], oldValue: any[]): void; datasetHierarchicalChanged(newHierarchicalDataset: any[] | undefined): void; /** * Define our internal Post Process callback, it will execute internally after we get back result from the Process backend call * Currently ONLY available with the GraphQL Backend Service. * The behavior is to refresh the Dataset & Pagination without requiring the user to create his own PostProcess every time */ createBackendApiInternalPostProcessCallback(gridOptions: GridOption): void; bindDifferentHooks(grid: SlickGrid, gridOptions: GridOption, dataView: SlickDataView): void; bindBackendCallbackFunctions(gridOptions: GridOption): void; protected addBackendInfiniteScrollCallback(): void; bindResizeHook(grid: SlickGrid, options: GridOption): void; executeAfterDataviewCreated(_grid: SlickGrid, gridOptions: GridOption): void; /** * On a Pagination changed, we will trigger a Grid State changed with the new pagination info * Also if we use Row Selection or the Checkbox Selector with a Backend Service (Odata, GraphQL), we need to reset any selection */ paginationChanged(pagination: PaginationMetadata): void; paginationOptionsChanged(newPaginationOptions: Pagination): void; /** * When dataset changes, we need to refresh the entire grid UI & possibly resize it as well * @param dataset */ refreshGridData(dataset: any[], totalCount?: number): void; /** * Show the filter row displayed on first row, we can optionally pass false to hide it. * @param showing */ showHeaderRow(showing?: boolean): boolean; setData(data: any[], shouldAutosizeColumns?: boolean): void; /** * Check if there's any Pagination Presets defined in the Grid Options, * if there are then load them in the paginationOptions object */ protected setPaginationOptionsWhenPresetDefined(gridOptions: GridOption, paginationOptions: Pagination): Pagination; setDarkMode(dark?: boolean): void; /** * Dynamically change or update the column definitions list. * We will re-render the grid so that the new header and data shows up correctly. * If using i18n, we also need to trigger a re-translate of the column headers */ updateColumnDefinitionsList(newColumns: Column[]): void; /** handler for when column definitions changes */ protected columnsHandler(): void; /** * assignment changes are not triggering a "columnDefinitionsChanged" event https://stackoverflow.com/a/30286225/1212166 * we can use array observer for these other changes done via (push, pop, ...) * see docs https://docs.aurelia.io/components/bindable-properties#calling-a-change-function-when-bindable-is-modified */ protected observeColumnDefinitions(): void; /** * Loop through all column definitions and copy the original optional `width` properties optionally provided by the user. * We will use this when doing a resize by cell content, if user provided a `width` it won't override it. */ protected copyColumnWidthsReference(columns: Column[]): void; protected displayEmptyDataWarning(showWarning?: boolean): void; /** When data changes in the DataView, we'll refresh the metrics and/or display a warning if the dataset is empty */ protected handleOnItemCountChanged(currentPageRowItemCount: number, totalItemCount: number): void; /** Initialize the Pagination Service once */ protected initializePaginationService(paginationOptions: Pagination): void; /** Load the Editor Collection asynchronously and replace the "collection" property when Promise resolves */ protected loadEditorCollectionAsync(column: Column): void; /** Load any possible Columns Grid Presets */ protected loadColumnPresetsWhenDatasetInitialized(): void; /** Load any possible Filters Grid Presets */ protected loadFilterPresetsWhenDatasetInitialized(): void; /** * local grid, check if we need to show the Pagination * if so then also check if there's any presets and finally initialize the PaginationService * a local grid with Pagination presets will potentially have a different total of items, we'll need to get it from the DataView and update our total */ protected loadLocalGridPagination(dataset?: any[]): void; /** Load any Row Selections into the DataView that were presets by the user */ protected loadRowSelectionPresetWhenExists(): void; hasBackendInfiniteScroll(gridOptions?: GridOption): boolean; protected mergeGridOptions(gridOptions: GridOption): GridOption; /** Add a register of a new external resource, user could also optional dispose all previous resources before pushing any new resources to the resources array list. */ registerExternalResources(resources: Array, disposePreviousResources?: boolean): void; resetExternalResources(): void; /** initialized & auto-enable external registered resources, e.g. if user registers `ExcelExportService` then let's auto-enable `enableExcelExport:true` */ protected autoEnableInitializedResources(resource: ExternalResource | ExternalResourceConstructor): void; protected initializeExternalResources(resources: Array): void; /** Pre-Register any Resource that don't require SlickGrid to be instantiated (for example RxJS Resource & RowDetail) */ protected preRegisterResources(): void; protected registerResources(): void; /** Register the RxJS Resource in all necessary services which uses */ protected registerRxJsResource(resource: RxJsFacade): void; /** * Render (or dispose) the Pagination Component, user can optionally provide False (to not show it) which will in term dispose of the Pagination, * also while disposing we can choose to omit the disposable of the Pagination Service (if we are simply toggling the Pagination, we want to keep the Service alive) * @param {Boolean} showPagination - show (new render) or not (dispose) the Pagination * @param {Boolean} shouldDisposePaginationService - when disposing the Pagination, do we also want to dispose of the Pagination Service? (defaults to True) */ protected renderPagination(showPagination?: boolean): Promise; /** * Takes a flat dataset with parent/child relationship, sort it (via its tree structure) and return the sorted flat array * @param {Array} flatDatasetInput - flat dataset input * @param {Boolean} forceGridRefresh - optionally force a full grid refresh * @returns {Array} sort flat parent/child dataset */ protected sortTreeDataset(flatDatasetInput: T[], forceGridRefresh?: boolean): T[]; /** Prepare and load all SlickGrid editors, if an async editor is found then we'll also execute it. */ protected loadSlickGridEditors(columns: Column[]): Column[]; protected suggestDateParsingWhenHelpful(): void; /** * When the Editor(s) has a "editor.collection" property, we'll load the async collection. * Since this is called after the async call resolves, the pointer will not be the same as the "column" argument passed. */ protected updateEditorCollection(column: Column, newCollection: T[]): void; }