import { IServerSideDatasource, LoadSuccessParams, SetFilterModel, SortModelItem, IServerSideGetRowsParams } from '@ag-grid-community/core'; import { Auth, Connect, MetadataDetail, DatasourceOptions } from '@genesislcap/foundation-comms'; import { UUID } from '@genesislcap/foundation-utils'; import { ServerSideDatasourceOptions } from './base.types'; import { PagingMode } from './datasource.types'; /** * Base class for server-side resource datasources used in Grid Pro SSRM implementations. * Provides common logic for filtering, sorting, and pagination. * * @beta */ export declare abstract class BaseServerSideDatasource implements IServerSideDatasource { auth: Auth; connect: Connect; uuid: UUID; protected rowId: string; rowData: Map; reloadResourceDataFunc: (params: DatasourceOptions) => Promise; errorHandlerFunc: (message: string, type: string) => void; protected onNoDataAvailableFunc?: () => void; protected onDataAvailableFunc?: () => void; protected resourceName: string; resourceParams: any; protected resourceIndexes: Map; protected resourceColDefs: MetadataDetail[]; protected maxRows: number; protected maxView: number; protected pagination: boolean; protected zeroBasedViewNumber: boolean; protected pagingMode?: PagingMode | undefined; protected criteriaOnlyRequest?: boolean; sourceRef: string; isNewPageSize: boolean; lastSuccessRowData: LoadSuccessParams; /** * The number of rows in the grid. THIS DO NOT CONSIDER CRITERIA_MATCH scenarios. * @internal */ serverRowsCount: number; /** * The number of rows in the grid. THIS IS A LOCAL COUNT CONSIDERING CONSIDER CRITERIA_MATCH scenarios. * @internal */ clientRowsCount: number; protected moreRows: boolean; protected calculatedRowsCount: number; protected currentSequenceId: any; protected currentFilterModel: SetFilterModel; protected originalCriteriaMatch: string | string[]; protected currentSortModel: SortModelItem[]; constructor(options: ServerSideDatasourceOptions); /** * Gets a resource parameter, handling both REQUEST_SERVER (DETAILS structure) and DATASERVER (flat structure) * @param key - The parameter key to retrieve * @returns The parameter value, or undefined if not found * @internal */ protected getResourceParam(key: string): any; /** * Sets a resource parameter, handling both REQUEST_SERVER (DETAILS structure) and DATASERVER (flat structure) * @param key - The parameter key to set * @param value - The value to set * @internal */ protected setResourceParam(key: string, value: any): void; getRows(params: IServerSideGetRowsParams): void; /** * Handles filtering setup for server-side datasources. * Common logic used by both dataserver and req-rep implementations. */ protected setupFiltering(params: IServerSideGetRowsParams): Promise; /** * Handles sorting setup. Must be implemented by each datasource type. * Different datasource types have different sorting requirements: * - Dataserver: Requires indexed columns * - Req-rep: Can sort by any column */ protected abstract setupSorting(params: IServerSideGetRowsParams): Promise; /** * Legacy method that combines filtering and sorting. * Kept for backward compatibility. New implementations should use setupFiltering and setupSorting directly. * @deprecated Use setupFiltering() and setupSorting() separately instead */ protected setupFilteringAndSorting(params: IServerSideGetRowsParams): Promise; destroy?(): void; refreshDatasource(params: DatasourceOptions): Promise; private updateResourceParams; protected getOrderByAndToBeSortedColIds(map: any, searchValue: any): { orderBy: any; toBeSorted: any[]; }; protected buildCriteriaMatchFromFilters(): string; protected criteriaFromFilters(): string[]; protected getFiltersByType(filterType: string): string[]; protected getPageNumber(start: number, recordsPerPage: number, totalRecords?: number, zeroBasedViewNumber?: boolean): number; protected getCorrectRowCount(params: IServerSideGetRowsParams): any; protected get isNotFirstViewNumber(): boolean; /** Completes an SSRM request with zero rows and invokes `onNoDataAvailableFunc` on the first block only. @internal */ protected completeEmptyResult(params: IServerSideGetRowsParams): void; /** Invokes `onNoDataAvailableFunc` when the first SSRM block has no rows. @internal */ protected notifyNoDataAvailableIfEmpty(params: IServerSideGetRowsParams, successRowData: LoadSuccessParams): void; protected notifyNoDataAvailable(): void; protected notifyDataAvailable(): void; /** * Determines the effective paging mode based on criteriaOnlyRequest availability and user settings */ protected getEffectivePagingMode(): PagingMode; } //# sourceMappingURL=server-side.resource-base.d.ts.map