///
import { StreamQueryStatistics } from "./StreamQueryStatistics";
import { RequestExecutor } from "../../Http/RequestExecutor";
import { ServerNode } from "../../Http/ServerNode";
import { ICommandData } from "../Commands/CommandData";
import { IDocumentStore } from "../IDocumentStore";
import { DocumentsChanges } from "./DocumentsChanges";
import { EntityToJson } from "./EntityToJson";
import { IMetadataDictionary } from "./IMetadataDictionary";
import { SessionEventsEmitter } from "./SessionEvents";
import { TransactionMode } from "./TransactionMode";
import { IEagerSessionOperations } from "./Operations/Lazy/IEagerSessionOperations";
import { ILazySessionOperations } from "./Operations/Lazy/ILazySessionOperations";
import { IAttachmentsSessionOperations } from "./IAttachmentsSessionOperations";
import { IRevisionsSessionOperations } from "./IRevisionsSessionOperations";
import { IClusterTransactionOperations } from "./IClusterTransactionOperations";
import { DocumentType } from "../DocumentAbstractions";
import { IRawDocumentQuery } from "./IRawDocumentQuery";
import { SessionInfo, SessionLoadStartingWithOptions } from "./IDocumentSession";
import { IDocumentQuery } from "./IDocumentQuery";
import { JavaScriptArray } from "./JavaScriptArray";
import { DocumentResultStream } from "./DocumentResultStream";
import * as stream from "readable-stream";
import { IDocumentQueryBuilder } from "./IDocumentQueryBuilder";
import { IGraphDocumentQuery } from "./IGraphDocumentQuery";
import { JavaScriptMap } from "./JavaScriptMap";
import { ConditionalLoadResult } from "./ConditionalLoadResult";
import { EntityInfo } from "./DocumentsById";
export type StreamQueryStatisticsCallback = (stats: StreamQueryStatistics) => void;
export interface IAdvancedSessionOperations extends IAdvancedDocumentSessionOperations, IDocumentQueryBuilder {
eagerly: IEagerSessionOperations;
lazily: ILazySessionOperations;
attachments: IAttachmentsSessionOperations;
revisions: IRevisionsSessionOperations;
clusterTransaction: IClusterTransactionOperations;
refresh(entity: TEntity): Promise;
refresh(entities: TEntity[]): Promise;
rawQuery(query: string, documentType?: DocumentType): IRawDocumentQuery;
graphQuery(query: string, documentType?: DocumentType): IGraphDocumentQuery;
exists(id: string): Promise;
loadStartingWith(idPrefix: string, opts: SessionLoadStartingWithOptions): Promise;
loadStartingWith(idPrefix: string): Promise;
increment(id: string, path: string, valueToAdd: UValue): void;
increment(entity: TEntity, path: string, valueToAdd: UValue): void;
patch(id: string, path: string, value: UValue): void;
patch(entity: TEntity, path: string, value: UValue): void;
patchArray(id: string, pathToArray: string, arrayAdder: (array: JavaScriptArray) => void): void;
patchArray(entity: TEntity, pathToArray: string, arrayAdder: (array: JavaScriptArray) => void): void;
patchObject(entity: TEntity, pathToObject: string, mapAdder: (map: JavaScriptMap) => void): void;
patchObject(id: string, pathToObject: string, mapAdder: (map: JavaScriptMap) => void): void;
addOrPatch(id: string, entity: TEntity, pathToObject: string, value: UValue): void;
addOrPatchArray(id: string, entity: TEntity, pathToObject: string, arrayAdder: (array: JavaScriptArray) => void): void;
addOrIncrement(id: string, entity: TEntity, pathToObject: string, valToAdd: UValue): void;
streamInto(query: IDocumentQuery, writable: stream.Writable): Promise;
streamInto(query: IRawDocumentQuery, writable: stream.Writable): Promise;
loadIntoStream(ids: string[], writable: stream.Writable): Promise;
loadStartingWithIntoStream(idPrefix: string, writable: stream.Writable): Promise;
loadStartingWithIntoStream(idPrefix: string, writable: stream.Writable, opts: SessionLoadStartingWithOptions): Promise;
stream(query: IDocumentQuery): Promise>;
stream(query: IDocumentQuery, streamQueryStats: StreamQueryStatisticsCallback): Promise>;
stream(query: IRawDocumentQuery): Promise>;
stream(query: IRawDocumentQuery, streamQueryStats: StreamQueryStatisticsCallback): Promise>;
stream(idPrefix: string): Promise>;
stream(idPrefix: string, opts: SessionLoadStartingWithOptions): Promise>;
conditionalLoad(id: string, changeVector: string, clazz: DocumentType): Promise>;
}
export interface ReplicationBatchOptions {
timeout?: number;
throwOnTimeout?: boolean;
replicas?: number;
majority?: boolean;
}
export interface IndexBatchOptions {
timeout?: number;
throwOnTimeout?: boolean;
indexes?: string[];
}
export interface IAdvancedDocumentSessionOperations extends SessionEventsEmitter {
documentStore: IDocumentStore;
externalState: Map;
getCurrentSessionNode(): Promise;
requestExecutor: RequestExecutor;
sessionInfo: SessionInfo;
hasChanges(): boolean;
maxNumberOfRequestsPerSession: number;
numberOfRequests: number;
storeIdentifier: string;
useOptimisticConcurrency: boolean;
clear(): void;
defer(...commands: ICommandData[]): void;
evict(entity: TEntity): void;
getDocumentId(entity: object): string;
getMetadataFor(instance: T): IMetadataDictionary;
getChangeVectorFor(instance: T): string;
getCountersFor(instance: T): string[];
getTimeSeriesFor(instance: T): string[];
getLastModifiedFor(instance: T): Date;
hasChanged(entity: object): boolean;
isLoaded(id: string): boolean;
ignoreChangesFor(entity: object): void;
whatChanged(): {
[id: string]: DocumentsChanges[];
};
getTrackedEntities(): Map;
waitForReplicationAfterSaveChanges(): void;
waitForReplicationAfterSaveChanges(opts: ReplicationBatchOptions): void;
waitForIndexesAfterSaveChanges(): void;
waitForIndexesAfterSaveChanges(opts: IndexBatchOptions): void;
entityToJson: EntityToJson;
transactionMode: TransactionMode;
}