import { CustomLogger } from "../modules/custom-logger";
import { IGetRowsParams } from "ag-grid-community";
import { GridDataSource } from './data-source';
import * as breeze from 'breeze-client';
import { I18N } from "aurelia-i18n";
import { ValidationController } from 'aurelia-validation';
export interface QueryResults<T extends breeze.Entity> {
    fullCount?: number;
    results: T[];
    error: any;
}
export interface IRequestObject {
    predicates?: any;
    sortClause?: string;
    expands?: string[];
    queryParameters?: any;
    start?: number;
    end?: number;
}
export declare class Repository<T extends breeze.Entity> {
    private manager;
    private logger;
    private entityTypeName;
    private resourceName;
    private i18n;
    validator: ValidationController;
    constructor(manager: breeze.EntityManager, logger: CustomLogger, entityTypeName: string, resourceName: string, i18n: I18N);
    private httpClient;
    private datacontext;
    private authService;
    private dateComputation;
    private config;
    private predicateUtils;
    private box;
    fetchForDataGrid(resourceNames: string, params: IGetRowsParams, expands: any, quickFilter: string, queryCriteria: GridDataSource<T>, queryParameters?: any): Promise<QueryResults<T>>;
    getEntityById(objectId: any, expands: string[], fromLocalCache?: boolean): Promise<T>;
    getAllEntities(expands: string[]): Promise<T[]>;
    getEntities(predicates: breeze.Predicate, expands: string[], parameters: any, orderBy?: {
        propertyPaths: string;
        isDescending?: boolean;
    }, paging?: {
        skip?: number;
        take?: number;
        pageNumber?: number;
    }): Promise<T[]>;
    getEntitiesFromLocalCache(predicates: breeze.Predicate, expands: string[], orderBy?: {
        propertyPaths: string;
        isDescending?: boolean;
    }, paging?: {
        skip?: number;
        take?: number;
        pageNumber?: number;
    }): Promise<T[]>;
    getCount(predicates: breeze.Predicate, parameters: any): Promise<number>;
    firstEntity(predicates: breeze.Predicate, expands: string[], parameters: any, orderBy?: {
        propertyPaths: string;
        isDescending?: boolean;
    }, skip?: number): Promise<T>;
    getEntitiesFromCache(entityState: breeze.EntityStateSymbol): breeze.Entity[];
    addEntityInCacheIfNotPresent(id: number, observableEntity: T, initialValues?: any, entityState?: breeze.EntityStateSymbol): Promise<T>;
    findAddedEntity(initialValues: any): breeze.Entity;
    restoreDeletedEntity(initialValues: any): any;
    createEntity(initialValues?: any, entityState?: breeze.EntityStateSymbol): Promise<T>;
    private resolveReferences;
    createEntityFromFactory<TParameters>(factoryRequest: Request, overriddenInitialValues?: any): Promise<{
        entity: T;
        parameters: TParameters;
    }>;
    private setFKToUnChanged;
    private setFKDataPropertyToNullWhenNumericNonNullable;
    createEntitySync(initialValues?: any, entityState?: breeze.EntityStateSymbol): T;
    private createEntityHelper;
    detachEntity(entity: breeze.Entity): void;
    lockRecordForEditing(entity: breeze.Entity): Promise<void>;
    saveChanges(entities?: breeze.Entity[], silentSave?: boolean, byPassLocking?: boolean): Promise<void>;
    cancelChanges(silentMode?: boolean): void;
    deleteEntities(entities: T[], detachInverseFKEntities?: boolean, beforeSaveAction?: ((entity: T) => void)): Promise<void>;
    protected internalGetEntities(fetchStrategy: breeze.FetchStrategySymbol, predicates: breeze.Predicate, expands: string[], parameters: any, orderBy?: {
        propertyPaths: string;
        isDescending?: boolean;
    }, paging?: {
        skip?: number;
        take?: number;
        pageNumber?: number;
    }): Promise<T[]>;
    private getPredicatesFromParams;
    private handleTranslation;
    private handleTranslations;
    private getBreezeOperatorFromFilterType;
    private addNullabilityToPredicate;
    private fillPredicatesWithQuickFilter;
    private quickFilterGetPredicate;
    private isKnownServerSideError;
    private queryFailed;
    private getElementCouldNotBeDeletedMessage;
    private getDefaultMessage;
    private getValidationException;
}
