UNPKG

@itwin/core-backend

Version:
101 lines 4.33 kB
/** @packageDocumentation * @module ChangedElementsDb */ import { AccessToken, DbResult } from "@itwin/core-bentley"; import { ChangeData, ChangedElements, ChangedModels } from "@itwin/core-common"; import { IModelJsNative } from "@bentley/imodeljs-native"; import { ECDbOpenMode } from "./ECDb"; import { IModelDb } from "./IModelDb"; /** * Options for processChangesets function * @internal * */ export interface ProcessChangesetOptions { startChangesetId: string; endChangesetId: string; rulesetId: string; filterSpatial?: boolean; wantParents?: boolean; wantPropertyChecksums?: boolean; rulesetDir?: string; tempDir?: string; wantRelationshipCaching?: boolean; relationshipCacheSize?: number; wantChunkTraversal?: boolean; wantBoundingBoxes?: boolean; } /** An ChangedElementsDb file * @internal */ export declare class ChangedElementsDb implements Disposable { private _nativeDb; constructor(); [Symbol.dispose](): void; /** Create a ChangedElementsDb * @param pathName The path to the ECDb file to create. * @throws [IModelError]($common) if the operation failed. */ private _createDb; /** Open the Changed Elements Db. * @param pathName The path to the ECDb file to open * @param openMode Open mode * @throws [IModelError]($common) if the operation failed. */ private _openDb; /** Open the Changed Elements Db. * @param pathName The path to the ECDb file to open * @param openMode Open mode * @returns ChangedElementsDb */ static openDb(pathName: string, openMode?: ECDbOpenMode): ChangedElementsDb; /** Create the changed elements cache db * @param briefcase IModelDb to use * @param pathName The path to the ECDb file to create. * @returns The new cache db */ static createDb(briefcase: IModelDb, pathName: string): ChangedElementsDb; /** Processes a range of changesets and adds it to the changed elements cache * @param briefcase iModel briefcase to use * @param options Options for processing */ processChangesets(accessToken: AccessToken, briefcase: IModelDb, options: ProcessChangesetOptions): Promise<DbResult>; /** Processes a range of changesets and adds it to the changed elements cache * This call will close the IModelDb object as it is required for processing and applying changesets * @param briefcase iModel briefcase to use * @param options options for processing */ processChangesetsAndRoll(accessToken: AccessToken, briefcase: IModelDb, options: ProcessChangesetOptions): Promise<DbResult>; /** Get changed elements between two changesets * @param startChangesetId Start Changeset Id * @param endChangesetId End Changeset Id * @returns Returns the changed elements between the changesets provided * @throws [IModelError]($common) if the operation failed. */ getChangedElements(startChangesetId: string, endChangesetId: string): ChangedElements | undefined; /** Get changed models between two changesets * @param startChangesetId Start Changeset Id * @param endChangesetId End Changeset Id * @returns Returns the changed models between the changesets provided * @throws [IModelError]($common) if the operation failed. */ getChangedModels(startChangesetId: string, endChangesetId: string): ChangedModels | undefined; /** Get changed models between two changesets * @param startChangesetId Start Changeset Id * @param endChangesetId End Changeset Id * @returns Returns the changed models between the changesets provided * @throws [IModelError]($common) if the operation failed. */ getChangeData(startChangesetId: string, endChangesetId: string): ChangeData | undefined; /** Returns true if the Changed Elements Db is open */ get isOpen(): boolean; /** Returns true if the cache already contains this changeset Id */ isProcessed(changesetId: string): boolean; /** Close the Db after saving any uncommitted changes. * @throws [IModelError]($common) if the database is not open. */ closeDb(): void; cleanCaches(): void; /** @internal */ get nativeDb(): IModelJsNative.ChangedElementsECDb; } //# sourceMappingURL=ChangedElementsDb.d.ts.map