import { Injector } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { XrmFormService, XrmContext } from './xrmform.service';
import * as i0 from "@angular/core";
export declare class XrmEntityKey {
    id: string;
    entityType: string;
}
export interface XrmQueryResult<T> {
    pages: string[];
    pageIndex: number;
    top: number;
    nextLink: string;
    context: string;
    count: number;
    value: T[];
    prev(): Observable<XrmQueryResult<T>>;
    next(): Observable<XrmQueryResult<T>>;
}
export declare class Expand {
    name: string;
    select: string;
    filter: string;
    additional: Expand[];
    toExpandString(): string;
}
export declare class XrmService {
    private http;
    private injector;
    private xrmformService;
    private defaultApiUrl;
    private contextFallback;
    apiUrl: string;
    apiVersion: string;
    debug: boolean;
    token: string;
    forceHttps: boolean;
    private keyTries;
    constructor(http: HttpClient, injector: Injector, xrmformService: XrmFormService);
    setVersion(v: string): void;
    getContext(): XrmContext;
    getCurrentUserId(): Observable<string>;
    getCurrentKey(): Observable<XrmEntityKey>;
    getCurrentKey(repeatForCreateForm: boolean): Observable<XrmEntityKey>;
    get<T>(entityTypes: string, id: string, fields: string): Observable<T>;
    get<T>(entityTypes: string, id: string, fields: string, expand: Expand): Observable<T>;
    query<T>(entityTypes: string, fields: string, filter: string): Observable<XrmQueryResult<T>>;
    query<T>(entityTypes: string, fields: string, filter: string, orderBy: string): Observable<XrmQueryResult<T>>;
    query<T>(entityTypes: string, fields: string, filter: string, orderBy: string, top: number): Observable<XrmQueryResult<T>>;
    query<T>(entityTypes: string, fields: string, filter: string, orderBy: string, top: number, count: boolean): Observable<XrmQueryResult<T>>;
    create<T>(entityType: string, entity: T): Observable<T>;
    update<T>(entityType: string, entity: T, id: string): Observable<T>;
    update<T>(entityType: string, entity: T, id: string, fields: string): Observable<T>;
    put(entityType: string, id: string, field: string, value: any): Observable<null>;
    put(entityType: string, id: string, field: string, value: any, propertyValueAs: string): Observable<null>;
    delete(entityType: string, id: string): Observable<null>;
    getParameter(param: string): string;
    associate(fromType: string, fromId: string, toType: string, toId: string, refname: string): Observable<null>;
    disassociate(fromType: string, fromId: string, toType: string, toId: string, refname: string): Observable<null>;
    func(name: string, data: string): Observable<any>;
    func(name: string, data: string, boundType: string, boundId: string): Observable<any>;
    action(name: string, data: any): Observable<any>;
    action(name: string, data: any, boundType: string, boundId: string): Observable<any>;
    log(message: any): void;
    private tryGetKey;
    private initializeVersion;
    private expandString;
    private resolveQueryResult;
    private getQueryStringParameters;
    private toGuid;
    private getDefaultHeader;
    forceHTTPS(v: string): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<XrmService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<XrmService>;
}
