import { EntityQuery, EntityType, MetadataStore, NavigationProperty, VisitContext } from "breeze-client";
import { FindOptions, IncludeOptions, Model, Transaction } from "sequelize";
import { SequelizeManager } from "./SequelizeManager";
/** Create an EntityQuery from a JSON-format breeze query string
 * @param url - url containing query, e.g. `/orders?{freight:{">":100}}`
 * @param resourceName - Name of the resource/entity.  If omitted, resourceName is derived from the pathname of the url.
*/
export declare function urlToEntityQuery(url: string, resourceName?: string): EntityQuery;
export interface SequelizeQueryOptions {
    useTransaction: boolean;
    beforeQueryEntities: (sq: SequelizeQuery) => void;
}
/** Object returned from a query with inlineCountEnabled */
export interface CountModel {
    rows: Model[];
    count: number;
}
export declare type SequelizeRawQueryResult = CountModel | Model[];
export declare type SequelizeQueryResult = {
    results: any[];
    inlineCount: number;
} | any[];
export interface SqVisitContext extends VisitContext {
    sequelizeQuery: SequelizeQuery;
}
/** Converts Breeze queries to Sequelize queries */
export declare class SequelizeQuery {
    sequelizeManager: SequelizeManager;
    metadataStore: MetadataStore;
    entityType: EntityType;
    entityQuery: EntityQuery;
    sqQuery: FindOptions;
    transaction: Transaction;
    private wasLogged;
    private _nextId;
    private _keyMap;
    private _refMap;
    /** Create instance for the given EntityQuery, and process the query into Sequelize form */
    constructor(sequelizeManager: SequelizeManager, serverSideEntityQuery: EntityQuery);
    private logQuery;
    /** Execute the current query and return data objects */
    execute(options?: SequelizeQueryOptions): Promise<SequelizeQueryResult>;
    /** Execute the current query and return the Sequelize Models */
    executeRaw(options?: SequelizeQueryOptions): Promise<SequelizeRawQueryResult>;
    private _processQuery;
    private _processWhere;
    private _processSelect;
    private _processOrderBy;
    private _processExpand;
    private _reshapeResults;
    private _reshapeSelectResults;
    private _createResult;
    private _populateExpand;
    _addInclude(parent: FindOptions, props: NavigationProperty[]): IncludeOptions;
    private _addFetchInclude;
    private _getIncludeFor;
    private _getModelAs;
}
