import { PropDef, PropDefEdge, SchemaTypeDef } from '@based/schema/def';
import { DbClient } from '../index.js';
import { Filter } from './query.js';
import { QueryByAliasObj, QueryDef } from './types.js';
export type QueryError = {
    code: number;
    payload: any;
};
export declare const ERR_TARGET_INVAL_TYPE = 1;
export declare const ERR_TARGET_INVAL_ALIAS = 2;
export declare const ERR_TARGET_EXCEED_MAX_IDS = 3;
export declare const ERR_TARGET_INVAL_IDS = 4;
export declare const ERR_TARGET_INVAL_ID = 5;
export declare const ERR_INCLUDE_ENOENT = 6;
export declare const ERR_FILTER_ENOENT = 7;
export declare const ERR_FILTER_OP_FIELD = 8;
export declare const ERR_FILTER_OP_ENOENT = 9;
export declare const ERR_FILTER_INVALID_VAL = 10;
export declare const ERR_FILTER_INVALID_OPTS = 11;
export declare const ERR_FILTER_INVALID_LANG = 12;
export declare const ERR_INCLUDE_INVALID_LANG = 13;
export declare const ERR_SORT_ENOENT = 14;
export declare const ERR_SORT_TYPE = 15;
export declare const ERR_SORT_ORDER = 16;
export declare const ERR_SORT_WRONG_TARGET = 17;
export declare const ERR_RANGE_INVALID_OFFSET = 18;
export declare const ERR_RANGE_INVALID_LIMIT = 19;
export declare const ERR_INVALID_LANG = 20;
export declare const ERR_SEARCH_ENOENT = 21;
export declare const ERR_SEARCH_TYPE = 22;
export declare const ERR_SEARCH_INCORRECT_VALUE = 23;
export declare const ERR_SORT_LANG = 24;
export declare const ERR_AGG_ENOENT = 25;
declare const messages: {
    1: (p: any) => string;
    2: (p: any) => string;
    3: (p: any) => string;
    4: (p: any) => string;
    5: (p: any) => string;
    6: (p: any) => string;
    13: (p: any) => string;
    7: (p: any) => string;
    12: (p: any) => string;
    9: (p: any) => string;
    8: (p: Filter) => string;
    11: (p: any) => string;
    10: (p: any) => string;
    14: (p: any) => string;
    17: (p: any) => string;
    16: (p: any) => string;
    15: (p: any) => string;
    18: (p: any) => string;
    19: (p: any) => string;
    20: (p: any) => string;
    21: (p: any) => string;
    22: (p: any) => string;
    23: (p: any) => string;
    24: (p: any) => string;
    25: (p: any) => string;
};
export type ErrorCode = keyof typeof messages;
export declare const searchIncorrecQueryValue: (def: QueryDef, payload: any) => void;
export declare const searchIncorrectType: (def: QueryDef, payload: PropDef | PropDefEdge) => void;
export declare const searchDoesNotExist: (def: QueryDef, field: string, isVector: boolean) => PropDef;
export declare const validateRange: (def: QueryDef, offset: number, limit: number) => boolean;
export declare const validateVal: (def: QueryDef, f: Filter, validate: (v: any, p: PropDef | PropDefEdge) => boolean) => boolean;
export declare const validateFilter: (def: QueryDef, prop: PropDef | PropDefEdge, f: Filter) => boolean;
export declare const validateType: (db: DbClient, def: QueryDef, type: string) => SchemaTypeDef;
export declare const filterOperatorDoesNotExist: (def: QueryDef, field: string) => void;
export declare const filterInvalidLang: (def: QueryDef, field: string) => void;
export declare const filterFieldDoesNotExist: (def: QueryDef, field: string) => void;
export declare const includeDoesNotExist: (def: QueryDef, field: string) => void;
export declare const includeLangDoesNotExist: (def: QueryDef, field: string) => void;
export declare const validateLocale: (def: QueryDef, lang: string) => void;
export declare const validateSort: (def: QueryDef, field: string, orderInput?: "asc" | "desc") => QueryDef["sort"];
export declare const validateAlias: (def: QueryDef, alias: QueryByAliasObj, path?: string) => {
    def: PropDef;
    value: string;
};
export declare const validateId: (def: QueryDef, id: any) => number;
export declare const validateIds: (def: QueryDef, ids: any) => Uint32Array;
export declare const handleErrors: (def: QueryDef) => void;
export declare const EMPTY_ALIAS_PROP_DEF: PropDef;
export declare const ERROR_STRING: PropDef;
export declare const ERROR_VECTOR: PropDef;
export declare const EMPTY_SCHEMA_DEF: SchemaTypeDef;
export declare const aggregationFieldDoesNotExist: (def: QueryDef, field: string) => void;
export {};
