import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { XrmService, XrmEntityKey, XrmQueryResult } from './xrm.service';
import { XrmContext } from './xrmform.service';
import { Fetchxml } from './fetchxml';
import * as i0 from "@angular/core";
export interface ToFunctionPropertyValue {
    functionPropertyValueAsString(): string;
}
export declare class FunctionPropertyValue implements ToFunctionPropertyValue {
    private v;
    constructor(v: string);
    functionPropertyValueAsString(): string;
}
export declare class Entity {
    _pluralName: string;
    _keyName: string;
    _updateable: boolean;
    _logicalName: string;
    id: string;
    constructor(pluralName: string, keyName: string);
    constructor(pluralName: string, keyName: string, updateable: boolean);
    constructor(pluralName: string, keyName: string, updateable: boolean, logicalname: string);
    ToEntityReference(associatednavigationproperty: string): EntityReference;
    ignoreColumn(prop: string): boolean;
    columns(): string[];
    columns(webapi: boolean): string[];
}
export declare class Entities<T extends Entity> extends Array<T> {
    constructor(fType: string, tType: string, refName: string, leftToRight: boolean, t: T);
    private parentType;
    private parentId;
    private childType;
    private refName;
    private leftToRight;
    private xrmService;
    add(entity: Entity): Observable<null>;
    remove(entity: Entity): Observable<null>;
}
export declare class EntityReference {
    constructor();
    constructor(id: string);
    constructor(id: string, pluralName: string);
    constructor(id: string, pluralName: string, associatednavigationproperty: string);
    constructor(id: string, pluralName: string, associatednavigationproperty: string, logicalname: string);
    id: string;
    name: string;
    logicalname: string;
    associatednavigationproperty: string;
    pluralName: string;
    replace(v1: string, v2: string): void;
    meta(pluralName: string, associatednavigationproperty: string): EntityReference;
    clone(): EntityReference;
    associatednavigationpropertyname(): string;
    equals(ref: EntityReference): boolean;
    toJsonProperty(): any;
    static same(ref1: EntityReference, ref2: EntityReference): boolean;
}
export declare class OptionSetValue {
    constructor();
    constructor(value: number);
    constructor(value: number, name: string);
    value: number;
    name: string;
    equals(o: OptionSetValue): boolean;
    clone(): OptionSetValue;
    toJsonProperty(): any;
    static same(o1: OptionSetValue, o2: OptionSetValue): boolean;
}
export declare enum Operator {
    And = 0,
    Or = 1
}
export declare enum Comparator {
    Equals = 1,
    NotEquals = 2,
    Contains = 3,
    NotContains = 4,
    DoesNotContainsData = 5,
    ContainsData = 6,
    StartsWith = 7,
    NotStartsWith = 8,
    EndsWith = 9,
    NotEndsWith = 10,
    GreaterThan = 11,
    GreaterThanOrEqual = 12,
    LessThan = 13,
    LessThanOrEQual = 14,
    Useroruserhierarchy = 100,
    Userteams = 101
}
export declare class ColumnBuilder {
    columns: string;
    hasEntityReference: boolean;
}
export declare class Filter {
    field: string;
    operator: Comparator;
    alias: string;
    value: any;
    constructor();
    toQueryString(prototype: Entity): string;
    toFetcmXml(): string;
    private adjustOperation;
}
export declare class Condition {
    operator: Operator;
    filter: Filter[];
    children: Condition[];
    parent: Condition;
    constructor();
    constructor(operator: Operator);
    where(field: string, opr: Comparator): Condition;
    where(field: string, opr: Comparator, value: any): Condition;
    alias(alias: string, field: string, opr: Comparator): Condition;
    alias(alias: string, field: string, opr: Comparator, value: any): Condition;
    group(opr: Operator): Condition;
    isActive(): Condition;
    isInactive(): Condition;
    owningUserIsCurrentUserOrHirachy(): Condition;
    currentUserIsMemberOfOwningTeam(): Condition;
    raw(filter: string): Condition;
    toQueryString(prototype: Entity): string;
    toFetchXml(): string;
}
export declare class XrmTransaction {
    private oprs;
    put<T extends Entity>(prototype: T, instance: T, field: string, value: any): void;
    delete<T extends Entity>(instance: T): void;
    create<T extends Entity>(prototype: T, instance: T): void;
    update<T extends Entity>(prototype: T, instance: T): void;
}
export declare class XrmAccess {
    private lazy;
    resolved: boolean;
    read: boolean;
    write: boolean;
    append: boolean;
    appendTo: boolean;
    create: boolean;
    delete: boolean;
    share: boolean;
    assign: boolean;
    constructor();
    constructor(lasy: boolean);
}
export declare class XrmContextService {
    private http;
    private xrmService;
    private context;
    private changemanager;
    private tick;
    private includeOriginalPayload$;
    pageCookieMatch: RegExp;
    constructor(http: HttpClient, xrmService: XrmService);
    setVersion(v: string): void;
    includeOroginalPayload(v: boolean): void;
    getContext(): XrmContext;
    getCurrentKey(): Observable<XrmEntityKey>;
    getCurrentKey(repeatForCreateForm: boolean): Observable<XrmEntityKey>;
    getServiceUrl(): string;
    getCurrentUserId(): Observable<string>;
    get<T extends Entity>(prototype: T, id: string): Observable<T>;
    debug(setting: boolean): void;
    count(xml: Fetchxml): Observable<number>;
    fetch<T extends Entity>(xml: Fetchxml): Observable<XrmQueryResult<T>>;
    fetchxml<T extends Entity>(prototype: T, fetchxml: string): Observable<XrmQueryResult<T>>;
    query<T extends Entity>(prototype: T, condition: Condition): Observable<XrmQueryResult<T>>;
    query<T extends Entity>(prototype: T, condition: Condition, orderBy: string): Observable<XrmQueryResult<T>>;
    query<T extends Entity>(prototype: T, condition: Condition, orderBy: string, top: number): Observable<XrmQueryResult<T>>;
    query<T extends Entity>(prototype: T, condition: Condition, orderBy: string, top: number, count: boolean): Observable<XrmQueryResult<T>>;
    create<T extends Entity>(prototype: T, instance: T): Observable<T>;
    createAll<T extends Entity>(prototype: T, instances: T[]): Observable<null>;
    update<T extends Entity>(prototype: T, instance: T): Observable<T>;
    update<T extends Entity>(prototype: T, instance: T, deleteReferenceAsEmptyGuid: boolean): Observable<T>;
    put(prototype: Entity, instance: Entity, field: string): Observable<null>;
    put(prototype: Entity, instance: Entity, field: string, value: any): Observable<null>;
    putAll(prototype: Entity, instances: Entity[], field: string, value: any): Observable<null>;
    delete<T extends Entity>(t: T): Observable<null>;
    deleteAll<T extends Entity>(instances: T[]): Observable<null>;
    markChangesCommitted(prototype: Entity, instance: Entity): void;
    func(name: string, data: any): Observable<any>;
    func(name: string, data: any, entity: Entity): Observable<any>;
    action(name: string, data: any): Observable<any>;
    action(name: string, data: any, entity: Entity): Observable<any>;
    commit(transaction: XrmTransaction): Observable<null>;
    log(type: string): void;
    clone(prototype: Entity, instance: Entity): Entity;
    applyAccess(prototype: Entity, instance: Entity): Observable<Entity>;
    private prepareUpdate;
    getCreatePayload(prototype: Entity, instance: Entity): any;
    getUpdatePayload(prototype: Entity, instance: Entity): any;
    getUpdatePayload(prototype: Entity, instance: Entity, deletedReferenceAsEmptyGuid: boolean): any;
    hasChanges(prototype: Entity, instance: Entity): boolean;
    hasChanges(prototype: Entity, instance: Entity, deletedReferenceAsEmptyGuid: boolean): boolean;
    getEntityCollectionPayload(prototype: Entity, instances: Entity[]): any[];
    private resolveAccess;
    private mapAccess;
    private preparePutValue;
    private prepareNewInstance;
    private assignValue;
    private $expandToExpand;
    private resolveFetchResult;
    private resolveQueryResult;
    private resolveNewInstance;
    private resolve;
    private updateCM;
    private columnBuilder;
    private getExpandProperties;
    private toFuncParameterString;
    private transform;
    private forceHTTPS;
    static ɵfac: i0.ɵɵFactoryDeclaration<XrmContextService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<XrmContextService>;
}
