import { EzGridColumnConfig, IGridConfig } from '@sankhyalabs/ezui/src/components/ez-grid/controller/EzGridController';
import { ITreeItem } from '@sankhyalabs/ezui/src/components/ez-tree/interfaces/ITreeItem';
import { DataType } from '@sankhyalabs/core';
export declare class PesquisaFetcher {
  private static readonly DESCRIPTIONS_BY_CODE;
  private _defaultPageSize;
  private _templateByQuery;
  private _searchListenersByDataUnit;
  constructor();
  private buldTemplates;
  loadSearchOptions(entityName: string, argument: string, criteria?: SearchCriteria, options?: SearchOptions): Promise<any>;
  private buildDescriptionCacheKey;
  loadByCode(entityName: string, codeValue: string, criteria?: SearchCriteria, searchOptions?: SearchOptions): Promise<any>;
  loadAdvancedSearch(entityName: string, argument: string, criteria?: SearchCriteria, searchOptions?: SearchOptions, codeValue?: any): Promise<any>;
  addSearchListener(entityName: string, dataUnitID: DataUnitID, listener: ISearchListener): IRemoveSearchListener;
  private applySearchListener;
  loadPresentationConfig(entityName: string): Promise<string>;
  savePresentationConfig(entityName: string, lastUsedMode: string): Promise<void>;
  loadPesquisaGridConfig(entityName: string): Promise<IGridConfig | undefined>;
  savePesquisaGridConfig(entityName: string, columns: Array<EzGridColumnConfig>): Promise<void>;
  loadTree(entityName: string, argument: string, criteria?: SearchCriteria, searchOptions?: SearchOptions): Promise<Array<ITreeItem>>;
  private buildLoadTreeRequestBody;
  private buildParams;
}
export interface SearchCriteria {
  expression: string;
  params: Array<SearchCriteriaParam>;
}
export interface SearchCriteriaParam {
  name: string;
  dataType: DataType;
  value: any;
}
export type LegacySearchCriteriaParam = SearchCriteriaParam & {
  tipo?: string;
  $?: string;
};
export type LegacySearchCriteria = SearchCriteria & {
  params: Array<LegacySearchCriteriaParam>;
};
export interface SearchOptions {
  rootEntity: string;
  descriptionFieldName?: string;
  codeFieldName?: string;
  showInactives?: boolean;
  dataUnitId?: string;
  ignoreEntityCriteria?: boolean;
}
type DataUnitID = string;
export type IRemoveSearchListener = () => void;
export interface ISearchListener {
  [SearchListenerType.beforeSearch]?: (request: ISearchListenerRequest) => ISearchListenerRequest | undefined;
}
export declare enum SearchListenerType {
  beforeSearch = "beforeSearch"
}
export interface ISearchListenerRequest {
  argument: string;
  criteria?: SearchCriteria;
  searchOptions?: SearchOptions;
}
export {};
