import { BaseModel, ErrorResponse, Paged, SortDirection } from 'verben-workflow-ui/src/lib/models'; import { HttpWebRequestService } from 'verben-workflow-ui/src/lib/services'; import { ColumnDefinition, FilterCondition, SortCondition } from 'verben-ng-ui'; import { FilterHandlerService } from '../handlers/filter-handler.service'; import { PrimarySort, SortHandlerService } from '../handlers/sort-handler.service'; import { SearchPropertyValue } from '../models/api-payload'; import * as i0 from "@angular/core"; /** * Abstract base service for data pages. * Handles list/search/save/delete with filter and sort support. * * The concrete URLs are built by the protected `*Url` seams below. Unlike the * sibling libraries, every endpoint in the workflow API carries the sort as URL * segments — `Get{Endpoint}/{skip}/{limit}/{sortParam}/{sortOrder}`, and the * POST search does too — so the seams take sort parameters. Services whose * endpoint names or shapes deviate (plural vs singular, query-string deletes) * override just the URL rather than reimplementing `getData()`. * * When `baseUrl` is omitted, HttpWebRequestService falls back to the WorkFlowAPI * base. */ export declare abstract class BaseDataPageService { protected server: HttpWebRequestService; protected filterHandler: FilterHandlerService; protected sortHandler: SortHandlerService; protected baseUrl?: string | undefined; constructor(server: HttpWebRequestService, filterHandler: FilterHandlerService, sortHandler: SortHandlerService, baseUrl?: string | undefined); /** API endpoint name (e.g. 'FlowableStatus'). Must be implemented by child classes. */ abstract getEndpoint(): string; /** Sort property used when the user has not chosen one. */ protected defaultSortParam(): string; protected defaultSortOrder(): SortDirection; protected listUrl(skip: number, limit: number, sortParam: string, sortOrder: string): string; protected searchTermUrl(term: string, skip: number, limit: number, sortParam: string, sortOrder: string): string; protected filterSearchUrl(skip: number, limit: number, sortParam: string, sortOrder: string): string; protected saveUrl(): string; protected deleteUrl(itemIds: string[]): string; buildPayload(filters: FilterCondition[], sorts: SortCondition[], columns: ColumnDefinition[]): SearchPropertyValue[]; /** Filter-only payload (no sorts) for persisting saved filters. */ buildFilterPayloadOnly(filters: FilterCondition[], columns: ColumnDefinition[]): SearchPropertyValue[]; /** Inverse of {@link buildFilterPayloadOnly}: rebuild FilterCondition[] on restore. */ parseFilterPayload(payload: SearchPropertyValue[], columns: ColumnDefinition[]): FilterCondition[]; /** * The sort the URL will carry: the user's first sortable selection, else the * page default. */ protected resolveSort(sorts: SortCondition[] | undefined, columns: ColumnDefinition[] | undefined): PrimarySort; /** * Fetch data, automatically choosing the endpoint based on parameters: * search-only -> GET WithParam, filters -> POST Search, otherwise plain GET. * * Sorts alone do not force the POST path: the plain GET already carries sort * in its URL, so a sort-only request stays a GET. */ getData(skip: number, limit: number, filters?: FilterCondition[], sorts?: SortCondition[], searchTerm?: string, columns?: ColumnDefinition[]): Promise | ErrorResponse>; saveItems(items: T[]): Promise; deleteItems(itemIds: string[]): Promise; exportData(filters?: FilterCondition[], sorts?: SortCondition[], searchTerm?: string, columns?: ColumnDefinition[]): Promise; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; }