@itwin/core-common
Version:
iTwin.js components common to frontend and backend
69 lines • 2.46 kB
TypeScript
/** @packageDocumentation
* @module iModels
*/
import { ChangesetId } from "./ChangesetProps";
/** Properties for IModelVersion
* @public
*/
export 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;
/** 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;
}
//# sourceMappingURL=IModelVersion.d.ts.map