/** @packageDocumentation * @module iModels */ import { GuidString } from "@bentley/bentleyjs-core"; import { IModelClient } from "@bentley/imodelhub-client"; import { AuthorizedClientRequestContext } from "@bentley/itwin-client"; import { ChangesetId } from "./ChangesetProps"; /** Properties for IModelVersion * @public */ export declare type IModelVersionProps = { first: true; latest?: never; afterChangeSetId?: never; versionName?: never; } | { latest: true; first?: never; afterChangeSetId?: never; versionName?: never; } | { afterChangeSetId: string; first?: never; latest?: never; versionName?: never; } | { versionName: string; first?: never; latest?: never; afterChangeSetId?: never; }; /** Option to specify the version of the iModel to be acquired and used * @public */ export declare class IModelVersion { private _first?; private _latest?; private _afterChangeSetId?; private _versionName?; private constructor(); /** Describes the first version of the iModel */ static first(): IModelVersion; /** Describes the latest version of the iModel */ static latest(): IModelVersion; /** Describes a version of the iModel by the last change set that needs * to be applied or merged to the iModel. * Note that all ChangeSets up to and and including the specified ChangeSet * needs to be applied. * If the changeSetId is an empty string, it is assumed to be the first version * before any change sets have been applied. */ static asOfChangeSet(changeSetId: string): IModelVersion; /** Describes a version of the iModel with the specified version name */ static named(versionName: string): IModelVersion; toJSON(): IModelVersionProps; /** Creates a version from an IModelVersionProps */ static fromJSON(json: IModelVersionProps): IModelVersion; /** Creates a version from an untyped JSON object * @deprecated use fromJSON */ static fromJson(jsonObj: any): IModelVersion; /** Returns true if this describes the first version */ get isFirst(): boolean; /** Returns true if this describes the latest version */ get isLatest(): boolean; /** Returns the last change set id to be applied to the iModel * to get to this specified version. @see asOfChangeSet(). * Note that this method does not attempt to resolve the change set * if this describes the first version, last version, named version, etc. * @see evaluateChangeSet() for those use cases. */ getAsOfChangeSet(): ChangesetId | undefined; /** Returns the name of the version if this describes a named version. @see named() */ getName(): string | undefined; /** Evaluate the ChangeSet Id corresponding to the version. All change sets up to and including * the returned ChangeSet Id need to be applied to update the iModel to this version. * Returns an empty string if this contains the first version (before any change sets). If the * version was already specified as of a ChangeSet, the method simply returns * that Id without any validation. * @deprecated use IModelHost/IModelApp hubAccess.getChangesetIdFromVersion */ evaluateChangeSet(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, imodelClient: IModelClient): Promise; /** Gets the last change set that was applied to the imodel * @internal - public only so tests can catch calls to it and fail. * @deprecated use IModelHost/IModelApp hubAccess.getChangesetIdFromVersion */ static getLatestChangeSetId(requestContext: AuthorizedClientRequestContext, imodelClient: IModelClient, iModelId: GuidString): Promise; /** Get the change set from the specified named version * @internal - public only so tests can catch calls to it and fail. * @deprecated use IModelHost/IModelApp hubAccess.getChangesetIdFromVersion */ static getChangeSetFromNamedVersion(requestContext: AuthorizedClientRequestContext, imodelClient: IModelClient, iModelId: GuidString, versionName: string): Promise; } //# sourceMappingURL=IModelVersion.d.ts.map