import { IRestEntity } from '@jacquesparis/objects-model';
import { ServiceDescription, TreatmentDescription } from '../../integration/extension-description';
import { AbstractEntityInterceptorInterface } from '../../interceptors/abstract-entity-interceptor.service';
import { EntityName } from '../../models';
import { ApplicationService, EntityActionType } from '../application.service';
import { CurrentContext } from './../application.service';
export interface EntityInterceptorInterface {
    providerId: string;
    serviceId: string;
    description: string | (() => TreatmentDescription) | (() => TreatmentDescription[]) | TreatmentDescription;
    interceptRequest(entityId: string | undefined, entity: IRestEntity | undefined, ctx: CurrentContext): Promise<boolean | IRestEntity>;
}
export interface AllInterceptorInterface {
    providerId: string;
    serviceId: string;
    description: string | (() => TreatmentDescription) | (() => TreatmentDescription[]) | TreatmentDescription;
    interceptRequest(ctx: CurrentContext): Promise<void>;
}
export interface EntityFinallyInterface {
    providerId: string;
    serviceId: string;
    description: string | (() => TreatmentDescription) | (() => TreatmentDescription[]) | TreatmentDescription;
    finallyRequest(entityId: string | undefined, entity: IRestEntity | undefined, ctx: CurrentContext): Promise<boolean | IRestEntity>;
}
export interface AllFinallyInterface {
    providerId: string;
    serviceId: string;
    description: string | (() => TreatmentDescription) | (() => TreatmentDescription[]) | TreatmentDescription;
    finallyRequest(ctx: CurrentContext): Promise<void>;
}
export declare class EntityInterceptService implements AbstractEntityInterceptorInterface, ServiceDescription {
    protected appCtx: ApplicationService;
    private entityInterceptors;
    private allInterceptors;
    private finallyInterceptors;
    private allFinalTreatments;
    registerEntityInterceptorService(resource: EntityName, scope: EntityActionType, entityInterceptor: EntityInterceptorInterface): void;
    registerAllInterceptorService(allInterceptor: AllInterceptorInterface): void;
    registerFinallyInterceptorService(resource: EntityName, scope: EntityActionType, finallyInterceptor: EntityFinallyInterface): void;
    registerAllFinalTreatmentService(allFinalTreatment: AllFinallyInterface): void;
    interceptRequest(entityName: EntityName, scope: EntityActionType, entityId: string | undefined, entity: IRestEntity | undefined, ctx: CurrentContext): Promise<boolean | IRestEntity>;
    interceptAllRequest(ctx: CurrentContext): Promise<void>;
    makeFinallyTreatment(entityName: EntityName, scope: EntityActionType, entityId: string | undefined, entity: IRestEntity | undefined, ctx: CurrentContext): Promise<void>;
    makeAllFinallyTreatment(ctx: CurrentContext): Promise<void>;
    getPreTreatmentDescription(): TreatmentDescription[];
    constructor(appCtx: ApplicationService);
}
