import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export interface SortMeta {
    field: string;
    order: number;
}
export interface ListParams {
    page?: number;
    size?: number;
    sort?: SortMeta[];
    filterQuery?: string;
    displayFields?: string[];
}
export interface BodyParams {
    offset?: number;
    size?: number;
    orderBy?: string;
    filter?: string;
    displayfields?: string;
}
export interface EntityListResponse<T> {
    contents: T[];
    totalElements: number;
    totalPages: number;
    size?: number;
    number?: number;
    first?: boolean;
    last?: boolean;
}
export interface TranslationService {
    translate(key: string, params?: any): string;
}
export declare abstract class EntityService<T> {
    protected http: HttpClient;
    protected translationService?: TranslationService | undefined;
    protected abstract entityUrl: string;
    protected abstract actionsUrl: string;
    protected queriesUrl: string;
    constructor(http: HttpClient, translationService?: TranslationService | undefined);
    /**
     * Initialize the service - call this after setting actionsUrl
     */
    protected initializeService(): void;
    /**
     * Convert ListParams to HttpParams for GET requests
     */
    protected getListQueryParams(listParams: ListParams): HttpParams;
    /**
     * Convert ListParams to body parameters for POST requests
     */
    protected getBodyParams(listParams: ListParams): BodyParams;
    /**
     * Default error handler
     * Note: This just logs the error and re-throws the original HttpErrorResponse
     * so that the HTTP interceptor can handle it properly (show toast, etc.)
     */
    protected handleError: (error: any) => Observable<never>;
    /**
     * List entities with pagination, sorting, and filtering
     */
    list(listParams?: ListParams): Observable<EntityListResponse<T>>;
    /**
     * Get entity by ID
     */
    get(id: any): Observable<T>;
    /**
     * Sanitiza a entidade/resposta removendo propriedades $ref que vêm do
     * backend (Jackson @JsonIdentityInfo), substituindo-as pelo objeto real
     * referenciado no payload original.
     */
    protected sanitizeEntity(entity: any): any;
    /**
     * Percorre recursivamente o objeto e resolve qualquer { $ref: "..." }
     * buscando o valor real no root do payload usando o path JSON.
     */
    private resolveRefs;
    /**
     * Resolve um path JSON no formato $["key"][index]["key"] ou $.key.key[index]
     */
    private resolveJsonPath;
    /**
     * Create new entity
     */
    insert(entity: T): Observable<T>;
    /**
     * Update existing entity
     */
    update(id: any, entity: T): Observable<T>;
    /**
     * Delete entity by ID
     */
    delete(id: any): Observable<void>;
    /**
     * Execute custom filter action
     */
    listCustomFilter(listParams: ListParams, action: string): Observable<EntityListResponse<T>>;
    /**
     * Execute custom query
     */
    executeQuery(queryName: string, params?: any): Observable<any>;
    /**
     * Execute custom action
     */
    executeAction(actionName: string, params?: any): Observable<any>;
    /**
     * Check if entity exists by ID
     */
    exists(id: any): Observable<boolean>;
    /**
     * Bulk delete entities
     */
    bulkDelete(ids: any[]): Observable<void>;
    static ɵfac: i0.ɵɵFactoryDeclaration<EntityService<any>, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<EntityService<any>>;
}
