/*!
 * Copyright 2021 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Injector } from '@angular/core';
import { VcdApiClient } from '@vcd/angular-client';
import { GroupType, OrgType, UserType } from '@vcd/bindings/vcloud/api/rest/schema_v1_5';
import { Observable } from 'rxjs';
import { FilterBuilder } from '../filter-builder';
/**
 * Given the query name of this entity, gives the data type that it represents.
 */
declare type InferEntityType<T> = T extends 'user' ? UserType : T extends 'organization' ? OrgType : T extends 'group' ? GroupType : unknown;
/**
 * What is returned from an API query,
 */
export interface QueryResult<T> {
    record: T[];
    total: number;
}
/**
 * The main options used to create a query.
 */
export interface RestQuery {
    filter?: FilterBuilder;
    pageSize?: number;
    fields?: string[];
}
/**
 * Additional options that can be used to configure a query.
 */
export interface RestQueryOptions {
    links?: boolean;
    multisite?: boolean;
}
/**
 * Makes a query to the backend via the {@link VcdApiClient}.
 */
export declare class RestQueryService extends VcdApiClient {
    constructor(injectors: Injector);
    /**
     * Queries the given type of entity with the given options.
     */
    queryEntity<T extends string>(type: T, query: RestQuery, options?: RestQueryOptions): Observable<QueryResult<InferEntityType<T>>>;
}
export {};
