@itwin/core-frontend 5.4.0-dev.7 → 5.5.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/lib/cjs/IModelApp.d.ts +12 -0
  3. package/lib/cjs/IModelApp.d.ts.map +1 -1
  4. package/lib/cjs/IModelApp.js +9 -0
  5. package/lib/cjs/IModelApp.js.map +1 -1
  6. package/lib/cjs/IModelConnection.d.ts.map +1 -1
  7. package/lib/cjs/IModelConnection.js +6 -2
  8. package/lib/cjs/IModelConnection.js.map +1 -1
  9. package/lib/cjs/SheetViewState.d.ts +7 -5
  10. package/lib/cjs/SheetViewState.d.ts.map +1 -1
  11. package/lib/cjs/SheetViewState.js +52 -683
  12. package/lib/cjs/SheetViewState.js.map +1 -1
  13. package/lib/cjs/internal/SheetViewAttachments.d.ts +57 -0
  14. package/lib/cjs/internal/SheetViewAttachments.d.ts.map +1 -0
  15. package/lib/cjs/internal/SheetViewAttachments.js +336 -0
  16. package/lib/cjs/internal/SheetViewAttachments.js.map +1 -0
  17. package/lib/cjs/internal/ViewAttachmentRenderer.d.ts +32 -0
  18. package/lib/cjs/internal/ViewAttachmentRenderer.d.ts.map +1 -0
  19. package/lib/cjs/internal/ViewAttachmentRenderer.js +462 -0
  20. package/lib/cjs/internal/ViewAttachmentRenderer.js.map +1 -0
  21. package/lib/cjs/internal/render/webgl/SceneCompositor.js +1 -1
  22. package/lib/cjs/internal/render/webgl/SceneCompositor.js.map +1 -1
  23. package/lib/cjs/internal/render/webgl/ShaderBuilder.d.ts.map +1 -1
  24. package/lib/cjs/internal/render/webgl/ShaderBuilder.js +8 -1
  25. package/lib/cjs/internal/render/webgl/ShaderBuilder.js.map +1 -1
  26. package/lib/cjs/properties/AngleDescription.js +4 -4
  27. package/lib/cjs/properties/AngleDescription.js.map +1 -1
  28. package/lib/cjs/properties/LengthDescription.js +9 -9
  29. package/lib/cjs/properties/LengthDescription.js.map +1 -1
  30. package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  31. package/lib/cjs/quantity-formatting/QuantityFormatter.js +9 -8
  32. package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
  33. package/lib/cjs/tools/EventController.js +1 -1
  34. package/lib/cjs/tools/EventController.js.map +1 -1
  35. package/lib/cjs/tools/MeasureTool.js +21 -21
  36. package/lib/cjs/tools/MeasureTool.js.map +1 -1
  37. package/lib/esm/IModelApp.d.ts +12 -0
  38. package/lib/esm/IModelApp.d.ts.map +1 -1
  39. package/lib/esm/IModelApp.js +9 -0
  40. package/lib/esm/IModelApp.js.map +1 -1
  41. package/lib/esm/IModelConnection.d.ts.map +1 -1
  42. package/lib/esm/IModelConnection.js +7 -3
  43. package/lib/esm/IModelConnection.js.map +1 -1
  44. package/lib/esm/SheetViewState.d.ts +7 -5
  45. package/lib/esm/SheetViewState.d.ts.map +1 -1
  46. package/lib/esm/SheetViewState.js +55 -686
  47. package/lib/esm/SheetViewState.js.map +1 -1
  48. package/lib/esm/internal/SheetViewAttachments.d.ts +57 -0
  49. package/lib/esm/internal/SheetViewAttachments.d.ts.map +1 -0
  50. package/lib/esm/internal/SheetViewAttachments.js +332 -0
  51. package/lib/esm/internal/SheetViewAttachments.js.map +1 -0
  52. package/lib/esm/internal/ViewAttachmentRenderer.d.ts +32 -0
  53. package/lib/esm/internal/ViewAttachmentRenderer.d.ts.map +1 -0
  54. package/lib/esm/internal/ViewAttachmentRenderer.js +459 -0
  55. package/lib/esm/internal/ViewAttachmentRenderer.js.map +1 -0
  56. package/lib/esm/internal/render/webgl/SceneCompositor.js +1 -1
  57. package/lib/esm/internal/render/webgl/SceneCompositor.js.map +1 -1
  58. package/lib/esm/internal/render/webgl/ShaderBuilder.d.ts.map +1 -1
  59. package/lib/esm/internal/render/webgl/ShaderBuilder.js +8 -1
  60. package/lib/esm/internal/render/webgl/ShaderBuilder.js.map +1 -1
  61. package/lib/esm/properties/AngleDescription.js +4 -4
  62. package/lib/esm/properties/AngleDescription.js.map +1 -1
  63. package/lib/esm/properties/LengthDescription.js +9 -9
  64. package/lib/esm/properties/LengthDescription.js.map +1 -1
  65. package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  66. package/lib/esm/quantity-formatting/QuantityFormatter.js +9 -8
  67. package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
  68. package/lib/esm/tools/EventController.js +1 -1
  69. package/lib/esm/tools/EventController.js.map +1 -1
  70. package/lib/esm/tools/MeasureTool.js +21 -21
  71. package/lib/esm/tools/MeasureTool.js.map +1 -1
  72. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  73. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  74. package/package.json +21 -21
@@ -1 +1 @@
1
- {"version":3,"file":"IModelConnection.js","sourceRoot":"","sources":["../../src/IModelConnection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,MAAM,EAAE,OAAO,EAAqB,aAAa,EAAE,gBAAgB,EAAc,IAAI,EAAgC,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EACnJ,mBAAmB,GACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EAAa,aAAa,EAAE,QAAQ,EAAsC,YAAY,EAAqB,WAAW,EACjG,OAAO,EAAE,cAAc,EAAsH,MAAM,EAAyB,WAAW,EACxN,sBAAsB,EAAE,qBAAqB,EACgG,WAAW,EACxJ,WAAW,EAAE,WAAW,EAAgB,cAAc,EAAE,UAAU,EAClE,0BAA0B,EACyC,YAAY,GAChF,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAoB,MAAM,sBAAsB,CAAC;AAGnG,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC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;QACnB,CAAC;QAED,wFAAwF;QACjF,KAAK,CAAC,gCAAgC,CAAC,SAAyB;YACrE,MAAM,SAAS,GAAG,SAAS,CAAC,mBAAmB,CAAC,aAAa,CAAC;YAC9D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAqB,SAAS,EAAE,SAAS,CAAiC,CAAC;YAEvH,IAAI,SAAS,KAAK,IAAI;gBACpB,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,yBAAyB,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAE7F,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAC/E,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,iCAAiC;YAEzD,OAAO,SAAS,CAAC;QACnB,CAAC;KACF;IAzGY,sBAAK,QAyGjB,CAAA;IAyBD;;;OAGG;IACH,MAAa,UAAU;QACrB,gBAAgB;QACA,KAAK,CAAqB;QAE1C,gBAAgB;QAChB,YAAmB,MAAwB;YACzC,IAAI,CAAC,KAAK,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;QAED,mEAAmE;QAC5D,KAAK,CAAC,eAAe,CAAC,WAAiC;YAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACjD,CAAC;QAED,sHAAsH;QAC/G,KAAK,CAAC,kBAAkB,CAAC,IAG/B;YACC,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1E,CAAC;KACF;IArBY,2BAAU,aAqBtB,CAAA;AACH,CAAC,EAptBgB,gBAAgB,KAAhB,gBAAgB,QAotBhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport {\n assert, BeEvent, CompressedId64Set, expectDefined, GeoServiceStatus, GuidString, Id64, Id64Arg, Id64Set, Id64String, IModelStatus, Logger, OneAtATimeAction, OpenMode,\n PickAsyncMethods, TransientIdSequence,\n} from \"@itwin/core-bentley\";\nimport {\n Cartographic, CodeProps, CodeScopeSpec, CodeSpec, CodeSpecProperties, DbQueryRequest, EcefLocation, EcefLocationProps, ECSqlReader, ElementLoadOptions, ElementMeshRequestProps,\n ElementProps, EntityQueryParams, FontMap, GeoCoordStatus, GeographicCRSProps, GeometryContainmentRequestProps, GeometryContainmentResponseProps, GeometrySummaryRequestProps, IModel, IModelConnectionProps, IModelError,\n IModelReadRpcInterface, mapToGeoServiceStatus, MassPropertiesPerCandidateRequestProps, MassPropertiesPerCandidateResponseProps,\n MassPropertiesRequestProps, MassPropertiesResponseProps, ModelExtentsProps, ModelIdAndGeometryGuid, ModelProps, ModelQueryParams, Placement, Placement2d,\n Placement3d, QueryBinder, QueryOptions, QueryRowFormat, RpcManager, SnapRequestProps, SnapResponseProps,\n SnapshotIModelRpcInterface, SubCategoryAppearance, SubCategoryResultRow, TextureData, TextureLoadProps, ViewDefinitionProps,\n ViewIdString, ViewQueryParams, ViewStateLoadProps, ViewStateProps, ViewStoreRpc,\n} from \"@itwin/core-common\";\nimport { Point3d, Range3d, Range3dProps, Transform, XYAndZ, XYZProps } from \"@itwin/core-geometry\";\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\nimport { CheckpointConnection } from \"./CheckpointConnection\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { EntityState } from \"./EntityState\";\nimport { GeoServices } from \"./GeoServices\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelRoutingContext } from \"./IModelRoutingContext\";\nimport { ModelState } from \"./ModelState\";\nimport { HiliteSet, SelectionSet } from \"./SelectionSet\";\nimport { SubCategoriesCache } from \"./SubCategoriesCache\";\nimport { BingElevationProvider } from \"./tile/internal\";\nimport { Tiles } from \"./Tiles\";\nimport { ViewState } from \"./ViewState\";\nimport { _requestSnap } from \"./common/internal/Symbols\";\nimport { IpcApp } from \"./IpcApp\";\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\nimport { ECSchemaRpcLocater } from '@itwin/ecschema-rpcinterface-common';\n\n\nconst loggerCategory: string = FrontendLoggerCategory.IModelConnection;\n\n/** The properties for creating a [Blank IModelConnection]($docs/learning/frontend/BlankConnection)\n * @public\n */\nexport interface BlankConnectionProps {\n /** A name for this blank connection. */\n name: string;\n /** The spatial location for the blank connection. */\n location: Cartographic | EcefLocationProps;\n /** The volume of interest, in meters, centered around `location` */\n extents: Range3dProps;\n /** An offset to be applied to all spatial coordinates. */\n globalOrigin?: XYZProps;\n /** The optional Guid that identifies the iTwin associated with the [[BlankConnection]]. */\n iTwinId?: GuidString;\n}\n\n/** A connection to a [IModelDb]($backend) hosted on the backend.\n * @public\n * @extensions\n */\nexport abstract class IModelConnection extends IModel {\n /** The [[ModelState]]s in this IModelConnection. */\n public readonly models: IModelConnection.Models;\n /** The [[ElementState]]s in this IModelConnection. */\n public readonly elements: IModelConnection.Elements;\n /** The [[CodeSpec]]s in this IModelConnection. */\n public readonly codeSpecs: IModelConnection.CodeSpecs;\n /** The [[ViewState]]s in this IModelConnection. */\n public readonly views: IModelConnection.Views;\n /** The set of currently hilited elements for this IModelConnection. */\n public readonly hilited: HiliteSet;\n /** The set of currently selected elements for this IModelConnection. */\n public readonly selectionSet: SelectionSet;\n /** The set of Tiles for this IModelConnection. */\n public readonly tiles: Tiles;\n /** The set of [Category]($backend)'s in this IModelConnection. */\n public readonly categories: IModelConnection.Categories;\n /** A cache of information about SubCategories chiefly used for rendering.\n * @internal\n */\n public get subcategories(): SubCategoriesCache { return this.categories.cache; }\n /** Generator for unique Ids of transient graphics for this IModelConnection. */\n public readonly transientIds = new TransientIdSequence();\n /** The Geographic location services available for this iModelConnection. */\n public readonly geoServices: GeoServices;\n /** @internal Whether GCS has been disabled for this iModelConnection. */\n protected _gcsDisabled = false;\n /** @internal Return true if a GCS is not defined for this iModelConnection; also returns true if GCS is defined but disabled. */\n public get noGcsDefined(): boolean { return this._gcsDisabled || undefined === this.geographicCoordinateSystem; }\n /** @internal */\n public disableGCS(disable: boolean): void { this._gcsDisabled = disable; }\n\n /** The maximum time (in milliseconds) to wait before timing out the request to open a connection to a new iModel */\n public static connectionTimeout: number = 10 * 60 * 1000;\n\n /** The RPC routing for this connection. */\n public routingContext: IModelRoutingContext = IModelRoutingContext.default;\n\n /** Type guard for instanceof [[BriefcaseConnection]] */\n public isBriefcaseConnection(): this is BriefcaseConnection { return false; }\n\n /** Type guard for instanceof [[CheckpointConnection]]\n * @beta\n */\n public isCheckpointConnection(): this is CheckpointConnection { return false; }\n\n /** Type guard for instanceof [[SnapshotConnection]] */\n public isSnapshotConnection(): this is SnapshotConnection { return false; }\n\n /** Type guard for instanceof [[BlankConnection]] */\n public isBlankConnection(): this is BlankConnection { return false; }\n\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\n public get isBriefcase(): boolean { return this.isBriefcaseConnection(); }\n\n /** Returns `true` if this is a *snapshot* iModel.\n * @see [[SnapshotConnection.openSnapshot]]\n */\n public get isSnapshot(): boolean { return this.isSnapshotConnection(); }\n\n /** True if this is a [Blank Connection]($docs/learning/frontend/BlankConnection). */\n public get isBlank(): boolean { return this.isBlankConnection(); }\n\n /** Check the [[openMode]] of this IModelConnection to see if it was opened read-only. */\n public get isReadonly(): boolean { return this.openMode === OpenMode.Readonly; }\n\n /** Check if the IModelConnection is open (i.e. it has a *connection* to a backend server).\n * Returns false for [[BlankConnection]] instances and after [[IModelConnection.close]] has been called.\n * @note no RPC operations are valid on this IModelConnection if this method returns false.\n */\n public get isOpen(): boolean { return !this.isClosed; }\n\n /** Check if the IModelConnection is closed (i.e. it has no *connection* to a backend server).\n * Returns true for [[BlankConnection]] instances and after [[IModelConnection.close]] has been called.\n * @note no RPC operations are valid on this IModelConnection if this method returns true.\n */\n public abstract get isClosed(): boolean;\n\n /** Event raised immediately before *any* IModelConnection is [[close]]d.\n * @note This static event is raised when *any* IModelConnection is closed, and the specific IModelConnection is passed as its argument. To\n * monitor closing a specific IModelConnection, listen for the `onClose` instance event instead.\n * @note Be careful not to perform any asynchronous operations on the IModelConnection because it will close before they are processed.\n */\n public static readonly onClose = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** Event called immediately after *any* IModelConnection is opened. */\n public static readonly onOpen = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** Event raised immediately before this IModelConnection is [[close]]d.\n * @note This event is raised only for this specific IModelConnection. To monitor *all* IModelConnections, listen for the static `onClose` event instead.\n * @note Be careful not to perform any asynchronous operations on the IModelConnection because it will close before they are processed.\n */\n public readonly onClose = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** The font map for this IModelConnection. Only valid after calling #loadFontMap and waiting for the returned promise to be fulfilled.\n * @deprecated in 5.0.0 - will not be removed until after 2026-06-13. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).\n */\n public fontMap?: FontMap; // eslint-disable-line @typescript-eslint/no-deprecated\n\n private _schemaContext?: SchemaContext;\n\n /** Load the FontMap for this IModelConnection.\n * @returns Returns a Promise<FontMap> that is fulfilled when the FontMap member of this IModelConnection is valid.\n * @deprecated in 5.0.0 - will not be removed until after 2026-06-13. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).\n */\n public async loadFontMap(): Promise<FontMap> { // eslint-disable-line @typescript-eslint/no-deprecated\n if (undefined === this.fontMap) { // eslint-disable-line @typescript-eslint/no-deprecated\n this.fontMap = new FontMap(); // eslint-disable-line @typescript-eslint/no-deprecated\n if (this.isOpen) {\n const fontProps = await IModelReadRpcInterface.getClientForRouting(this.routingContext.token).readFontJson(this.getRpcProps());\n this.fontMap.addFonts(fontProps.fonts); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n }\n return this.fontMap; // eslint-disable-line @typescript-eslint/no-deprecated\n }\n\n /** Find the first registered base class of the given EntityState className. This class will \"handle\" the State for the supplied className.\n * @param className The full name of the class of interest.\n * @param defaultClass If no base class of the className is registered, return this value.\n * @note this method is async since it may have to query the server to get the class hierarchy.\n */\n public async findClassFor<T extends typeof EntityState>(className: string, defaultClass: T | undefined): Promise<T | undefined> {\n let ctor = IModelApp.lookupEntityClass(className) as T | undefined;\n if (undefined !== ctor)\n return ctor;\n\n // it's not registered, we need to query its class hierarchy.\n\n // wait until we get the full list of base classes from backend\n if (this.isOpen) {\n const baseClasses = await IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getClassHierarchy(this.getRpcProps(), className);\n\n // Make sure some other async code didn't register this class while we were await-ing above\n ctor = IModelApp.lookupEntityClass(className) as T | undefined;\n if (undefined !== ctor)\n return ctor;\n\n // walk through the list until we find a registered base class\n baseClasses.some((baseClass: string) => {\n const test = IModelApp.lookupEntityClass(baseClass) as T | undefined;\n if (test === undefined)\n return false; // nope, not registered\n\n ctor = test; // found it, save it\n IModelApp.registerEntityState(className, ctor); // and register the fact that our starting class is handled by this subclass.\n return true; // stop\n });\n }\n return ctor ?? defaultClass; // either the baseClass handler or defaultClass if we didn't find a registered baseClass\n }\n\n /** @internal */\n protected constructor(iModelProps: IModelConnectionProps) {\n super(iModelProps);\n super.initialize(iModelProps.name ?? \"<undefined>\", iModelProps);\n this.models = new IModelConnection.Models(this);\n this.elements = new IModelConnection.Elements(this);\n this.codeSpecs = new IModelConnection.CodeSpecs(this);\n this.views = new IModelConnection.Views(this);\n this.categories = new IModelConnection.Categories(this);\n\n this.selectionSet = new SelectionSet(this);\n this.hilited = new HiliteSet(this);\n\n this.tiles = new Tiles(this);\n this.geoServices = GeoServices.createForIModel(this);\n\n this.hilited.onModelSubCategoryModeChanged.addListener(() => {\n IModelApp.viewManager.onSelectionSetChanged(this);\n });\n }\n\n /** Called prior to connection closing. Raises close events and calls tiles.dispose.\n * @internal\n */\n protected beforeClose(): void {\n this.onClose.raiseEvent(this); // event for this connection\n IModelConnection.onClose.raiseEvent(this); // event for all connections\n this.tiles[Symbol.dispose]();\n this.subcategories.onIModelConnectionClose();\n }\n\n /** Close this IModelConnection. */\n public abstract close(): Promise<void>;\n\n /** Allow to execute query and read results along with meta data. The result are streamed.\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/frontend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/frontend/ECSQLCodeExamples)\n * - [ECSQL Row Format]($docs/learning/ECSQLRowFormat)\n *\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param config Allow to specify certain flags which control how query is executed.\n * @returns Returns an [ECSqlReader]($common) which helps iterate over the result set and also give access to metadata.\n * @public\n * */\n public createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader {\n const executor = {\n execute: async (request: DbQueryRequest) => {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).queryRows(this.getRpcProps(), request);\n },\n };\n return new ECSqlReader(executor, ecsql, params, config);\n }\n\n /**\n * queries the BisCore.SubCategory table for the entries that are children of the passed categoryIds\n * @param compressedCategoryIds compressed category Ids\n * @returns array of SubCategoryResultRow\n * @internal\n */\n public async querySubCategories(compressedCategoryIds: CompressedId64Set): Promise<SubCategoryResultRow[]> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).querySubCategories(this.getRpcProps(), compressedCategoryIds);\n }\n\n /**\n * queries the BisCore.SubCategory table for entries that are children of used spatial categories and 3D elements.\n * @returns array of SubCategoryResultRow\n * @internal\n */\n public async queryAllUsedSpatialSubCategories(): Promise<SubCategoryResultRow[]> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).queryAllUsedSpatialSubCategories(this.getRpcProps());\n }\n\n /** Query for a set of element ids that satisfy the supplied query params\n * @param params The query parameters. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many rows.\n */\n public async queryEntityIds(params: EntityQueryParams): Promise<Id64Set> {\n return new Set(this.isOpen ? await IModelReadRpcInterface.getClientForRouting(this.routingContext.token).queryEntityIds(this.getRpcProps(), params) : undefined);\n }\n\n private _snapRpc = new OneAtATimeAction<SnapResponseProps>(\n async (props: SnapRequestProps) =>\n IModelReadRpcInterface.getClientForRouting(this.routingContext.token).requestSnap(this.getRpcProps(), IModelApp.sessionId, props),\n );\n\n /** Request a snap from the backend.\n * @note callers must gracefully handle Promise rejected with AbandonedError\n * @internal\n */\n public async [_requestSnap](props: SnapRequestProps): Promise<SnapResponseProps> {\n return this.isOpen ? this._snapRpc.request(props) : { status: 2 };\n }\n\n /** @internal\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use AccuSnap.doSnapRequest.\n */\n public async requestSnap(props: SnapRequestProps): Promise<SnapResponseProps> {\n return this[_requestSnap](props);\n }\n\n private _toolTipRpc = new OneAtATimeAction<string[]>(async (id: string) => IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getToolTipMessage(this.getRpcProps(), id));\n /** Request a tooltip from the backend.\n * @note If another call to this method occurs before preceding call(s) return, all preceding calls will be abandoned - only the most recent will resolve. Therefore callers must gracefully handle Promise rejected with AbandonedError.\n */\n public async getToolTipMessage(id: Id64String): Promise<string[]> {\n return this.isOpen ? this._toolTipRpc.request(id) : [];\n }\n\n /** Request element clip containment status from the backend. */\n public async getGeometryContainment(requestProps: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> { return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getGeometryContainment(this.getRpcProps(), requestProps); }\n\n /** Obtain a summary of the geometry belonging to one or more [GeometricElement]($backend)s suitable for debugging and diagnostics.\n * @param requestProps Specifies the elements to query and options for how to format the output.\n * @returns A string containing the summary, typically consisting of multiple lines.\n * @note Trying to parse the output to programmatically inspect an element's geometry is not recommended.\n * @see [GeometryStreamIterator]($common) to more directly inspect a geometry stream.\n */\n public async getGeometrySummary(requestProps: GeometrySummaryRequestProps): Promise<string> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getGeometrySummary(this.getRpcProps(), requestProps);\n }\n\n /** Request a named texture image from the backend.\n * @param textureLoadProps The texture load properties which must contain a name property (a valid 64-bit integer identifier). It optionally can contain the maximum texture size supported by the client.\n * @see [[Id64]]\n * @public\n */\n public async queryTextureData(textureLoadProps: TextureLoadProps): Promise<TextureData | undefined> {\n if (this.isOpen) {\n const rpcClient = IModelReadRpcInterface.getClientForRouting(this.routingContext.token);\n const img = rpcClient.queryTextureData(this.getRpcProps(), textureLoadProps);\n return img;\n }\n return undefined;\n }\n\n /** Request element mass properties from the backend. */\n public async getMassProperties(requestProps: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getMassProperties(this.getRpcProps(), requestProps);\n }\n\n /** Request mass properties for multiple elements from the backend.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[IModelConnection.getMassProperties]].\n */\n public async getMassPropertiesPerCandidate(requestProps: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]> { // eslint-disable-line @typescript-eslint/no-deprecated\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getMassPropertiesPerCandidate(this.getRpcProps(), requestProps);\n }\n\n /** Produce encoded [Polyface]($core-geometry)s from the geometry stream of a [GeometricElement]($backend).\n * A polyface is produced for each geometric entry in the element's geometry stream, excluding geometry like open curves that can't be converted into polyfaces.\n * The polyfaces can be decoded using [readElementMeshes]($common).\n * Symbology, UV parameters, and normal vectors are not included in the result.\n * @param requestProps A description of how to produce the polyfaces and from which element to obtain them.\n * @returns an encoded list of polyfaces that can be decoded by [readElementMeshes]($common).\n * @throws Error if [ElementMeshRequestProps.source]($common) does not refer to a [GeometricElement]($backend).\n * @note This function is intended to support limited analysis of an element's geometry as a mesh. It is not intended for producing graphics.\n * @see [[TileAdmin.requestElementGraphics]] to obtain meshes appropriate for display.\n * @beta\n */\n public async generateElementMeshes(requestProps: ElementMeshRequestProps): Promise<Uint8Array> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).generateElementMeshes(this.getRpcProps(), requestProps);\n }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection.\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location (Horizontal datum depends on iModel's GCS)\n * @throws IModelError if [[isGeoLocated]] is false or point could not be converted.\n * @see [[cartographicFromSpatial]] if you have more than one point to convert, or you don't know whether the iModel has a GCS.\n */\n public async spatialToCartographicFromGcs(spatial: XYAndZ, result?: Cartographic): Promise<Cartographic> {\n if (!this.isGeoLocated && this.noGcsDefined)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n const geoConverter = expectDefined(this.geoServices.getConverter());\n const coordResponse = await geoConverter.getGeoCoordinatesFromIModelCoordinates([spatial]);\n\n if (1 !== coordResponse.geoCoords.length || GeoCoordStatus.NoGCSDefined === coordResponse.geoCoords[0].s)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (GeoCoordStatus.Success !== coordResponse.geoCoords[0].s) {\n const geoServiceStatus = mapToGeoServiceStatus(coordResponse.geoCoords[0].s);\n throw new IModelError(geoServiceStatus, \"Error converting spatial to cartographic\");\n }\n\n const longLatHeight = Point3d.fromJSON(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...\n return Cartographic.fromDegrees({ longitude: longLatHeight.x, latitude: longLatHeight.y, height: longLatHeight.z }, result);\n }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection or [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location (Horizontal datum depends on iModel's GCS)\n * @throws IModelError if [[isGeoLocated]] is false or point could not be converted.\n * @see [[cartographicFromSpatial]] to convert multiple points at once.\n * @see [[spatialToCartographicFromEcef]] to synchronously convert points using the iModel's ECEF transform.\n */\n public async spatialToCartographic(spatial: XYAndZ, result?: Cartographic): Promise<Cartographic> {\n return (this.noGcsDefined ? this.spatialToCartographicFromEcef(spatial, result) : this.spatialToCartographicFromGcs(spatial, result));\n }\n\n /** Convert points in this iModel's spatial coordinate system to [Cartographic]($common) coordinates using either a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param spatial Coordinates to be converted from the iModel's spatial coordinate system\n * @returns The `spatial` coordinates converted to cartographic coordinates, of the same length and order as the `spatial`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @see [[spatialFromCartographic]] to perform the inverse conversion.\n * @see [[spatialToCartographicFromEcef]] to synchronously convert points using the iModel's ECEF transform.\n */\n public async cartographicFromSpatial(spatial: XYAndZ[]): Promise<Cartographic[]> {\n return this.cartographicFromSpatialWithGcs(spatial);\n }\n\n /** Convert points in this iModel's spatial coordinate system to [Cartographic]($common) coordinates using either a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param spatial Coordinates to be converted from the iModel's spatial coordinate system\n * @returns The `spatial` coordinates converted to cartographic coordinates (WGS84 horizontal datum), of the same length and order as the `spatial`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @see [[cartographicFromSpatial]] to perform conversion using iModel's GCS horizontal datum\n * @beta\n */\n public async wgs84CartographicFromSpatial(spatial: XYAndZ[]): Promise<Cartographic[]> {\n return this.cartographicFromSpatialWithGcs(spatial, \"WGS84\");\n }\n\n /** @internal */\n public async cartographicFromSpatialWithGcs(spatial: XYAndZ[], datumOrGCRS?: string | GeographicCRSProps): Promise<Cartographic[]> {\n if (this.noGcsDefined)\n return spatial.map((p) => this.spatialToCartographicFromEcef(p));\n\n if (!this.isGeoLocated)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (!this.isOpen)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not open\");\n\n if (spatial.length === 0)\n return [];\n\n const geoConverter = this.geoServices.getConverter(datumOrGCRS);\n assert(undefined !== geoConverter);\n\n const coordResponse = await geoConverter.getGeoCoordinatesFromIModelCoordinates(spatial);\n if (coordResponse.geoCoords.length !== spatial.length)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n return coordResponse.geoCoords.map((coord) => {\n switch (coord.s) {\n case GeoCoordStatus.NoGCSDefined:\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n case GeoCoordStatus.Success:\n const llh = Point3d.fromJSON(coord.p);\n return Cartographic.fromDegrees({ longitude: llh.x, latitude: llh.y, height: llh.z });\n default:\n throw new IModelError(mapToGeoServiceStatus(coord.s), \"Error converting spatial to cartographic\");\n }\n });\n }\n\n /** Convert a [Cartographic]($common) to a point in this iModel's spatial coordinate system using a [[GeoConverter]].\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false or cartographic location could not be converted.\n * @see [[spatialFromCartographic]] to convert multiple points at once, or you don't know whether the iModel has a GCS.\n */\n public async cartographicToSpatialFromGcs(cartographic: Cartographic, result?: Point3d): Promise<Point3d> {\n if (!this.isGeoLocated && this.noGcsDefined)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n const geoConverter = expectDefined(this.geoServices.getConverter());\n const geoCoord = Point3d.create(cartographic.longitudeDegrees, cartographic.latitudeDegrees, cartographic.height); // x is longitude in degrees, y is latitude in degrees, z is height in meters...\n const coordResponse = await geoConverter.getIModelCoordinatesFromGeoCoordinates([geoCoord]);\n\n if (1 !== coordResponse.iModelCoords.length || GeoCoordStatus.NoGCSDefined === coordResponse.iModelCoords[0].s)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (GeoCoordStatus.Success !== coordResponse.iModelCoords[0].s) {\n const geoServiceStatus = mapToGeoServiceStatus(coordResponse.iModelCoords[0].s);\n throw new IModelError(geoServiceStatus, \"Error converting cartographic to spatial\");\n }\n\n result = result ? result : Point3d.createZero();\n result.setFromJSON(coordResponse.iModelCoords[0].p);\n return result;\n }\n\n /** Convert a [Cartographic]($common) to a point in this iModel's Spatial coordinates using a [[GeoConverter]] or[[IModel.ecefLocation]($common).\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false or cartographic location could not be converted.\n * @see [[spatialFromCartographic]] to convert multiple points at once.\n * @see [[cartographicToSpatialFromEcef]] to synchronously convert points using the iModel's ECEF transform.\n */\n public async cartographicToSpatial(cartographic: Cartographic, result?: Point3d): Promise<Point3d> {\n return (this.noGcsDefined ? this.cartographicToSpatialFromEcef(cartographic, result) : this.cartographicToSpatialFromGcs(cartographic, result));\n }\n\n /** Convert [Cartographic]($common) coordinates into points in this iModel's spatial coordinate system using a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param cartographic Coordinates to be converted to the iModel's spatial coordinate system.\n * @returns The `cartographic` coordinates converted to spatial coordinates, of the same length and order as `cartographic`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @see [[cartographicFromSpatial]] to perform the inverse conversion.\n */\n public async spatialFromCartographic(cartographic: Cartographic[]): Promise<Point3d[]> {\n if (this.noGcsDefined)\n return cartographic.map((p) => this.cartographicToSpatialFromEcef(p));\n\n const geoCoords = cartographic.map((p) => Point3d.create(p.longitudeDegrees, p.latitudeDegrees, p.height));\n return this.toSpatialFromGcs(geoCoords);\n }\n\n /** Convert geographic coordinates into points in this iModel's spatial coordinate system using a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param geoCoords Coordinates to be converted are in the coordinate system described by the `datumOrGCRS` parameter. Defaults iModel's spatial coordinate system otherwise.\n * @param datumOrGCRS Datum name or Geographic CRS object definition to use for the conversion.\n * @returns The `geographics` coordinates converted to spatial coordinates, of the same length and order as `geographics`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @beta\n */\n public async toSpatialFromGcs(geoCoords: XYAndZ[], datumOrGCRS?: string | GeographicCRSProps): Promise<Point3d[]> {\n\n if (!this.isGeoLocated)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (!this.isOpen)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not open\");\n\n if (geoCoords.length === 0)\n return [];\n\n const geoConverter = this.geoServices.getConverter(datumOrGCRS);\n assert(undefined !== geoConverter);\n\n const coordResponse = await geoConverter.getIModelCoordinatesFromGeoCoordinates(geoCoords);\n if (coordResponse.iModelCoords.length !== geoCoords.length)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n return coordResponse.iModelCoords.map((coord) => {\n switch (coord.s) {\n case GeoCoordStatus.NoGCSDefined:\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n case GeoCoordStatus.Success:\n return Point3d.fromJSON(coord.p);\n default:\n throw new IModelError(mapToGeoServiceStatus(coord.s), \"Error converting cartographic to spatial\");\n }\n });\n }\n\n /** @internal */\n public getMapEcefToDb(bimElevationBias: number): Transform {\n if (!this.ecefLocation)\n return Transform.createIdentity();\n\n const mapEcefToDb = this.ecefLocation.getTransform().inverse();\n if (!mapEcefToDb) {\n assert(false);\n return Transform.createIdentity();\n }\n mapEcefToDb.origin.z += bimElevationBias;\n\n return mapEcefToDb;\n }\n private _geodeticToSeaLevel?: number | Promise<number>;\n private _projectCenterAltitude?: number | Promise<number>;\n\n /** Event called immediately after map elevation request is completed. This occurs only in the case where background map terrain is displayed\n * with either geoid or ground offset. These require a query to BingElevation and therefore synching the view may be required\n * when the request is completed.\n * @internal\n */\n public readonly onMapElevationLoaded = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** The offset between sea level and the geodetic ellipsoid. This will return undefined only if the request for the offset to Bing Elevation\n * is required, and in this case the [[onMapElevationLoaded]] event is raised when the request is completed.\n * @internal\n */\n public get geodeticToSeaLevel(): number | undefined {\n if (undefined === this._geodeticToSeaLevel) {\n const elevationProvider = new BingElevationProvider();\n this._geodeticToSeaLevel = elevationProvider.getGeodeticToSeaLevelOffset(this.projectExtents.center, this);\n this._geodeticToSeaLevel.then((geodeticToSeaLevel) => {\n this._geodeticToSeaLevel = geodeticToSeaLevel;\n this.onMapElevationLoaded.raiseEvent(this);\n }).catch((_error) => this._geodeticToSeaLevel = 0.0);\n }\n return (\"number\" === typeof this._geodeticToSeaLevel) ? this._geodeticToSeaLevel : undefined;\n }\n\n /** The altitude (geodetic) at the project center. This will return undefined only if the request for the offset to Bing Elevation\n * is required, and in this case the [[onMapElevationLoaded]] event is raised when the request is completed.\n * @internal\n */\n public get projectCenterAltitude(): number | undefined {\n if (undefined === this._projectCenterAltitude) {\n const elevationProvider = new BingElevationProvider();\n this._projectCenterAltitude = elevationProvider.getHeightValue(this.projectExtents.center, this);\n this._projectCenterAltitude.then((projectCenterAltitude) => {\n this._projectCenterAltitude = projectCenterAltitude;\n this.onMapElevationLoaded.raiseEvent(this);\n }).catch((_error) => this._projectCenterAltitude = 0.0);\n }\n return (\"number\" === typeof this._projectCenterAltitude) ? this._projectCenterAltitude : undefined;\n }\n\n /**\n * Gets the context that allows accessing the metadata (see `@itwin/ecschema-metadata` package) of this iModel.\n * The context is created lazily when this property is accessed for the first time, with an `ECSchemaRpcLocater` registered as a fallback locater, enabling users to register their own locater that'd take more priority.\n * This means to correctly access schema context, client-side applications must register `ECSchemaRpcInterface` following instructions for [RPC configuration]($docs/learning/rpcinterface/#client-side-configuration).\n * Server-side applications would also [configure RPC]($docs/learning/rpcinterface/#server-side-configuration) as needed.\n *\n * @note While a `BlankConnection` returns a valid `schemaContext`, it has an invalid locater registered by default, and will throw an error when trying to call it's methods.\n * @beta\n */\n public get schemaContext(): SchemaContext {\n if (this._schemaContext === undefined) {\n const context = new SchemaContext();\n const locater = new ECSchemaRpcLocater(this._getRpcProps());\n context.addFallbackLocater(locater);\n this._schemaContext = context;\n }\n\n return this._schemaContext;\n }\n}\n\n/** A connection that exists without an iModel. Useful for connecting to Reality Data services.\n * @note This class exists because our display system requires an IModelConnection type even if only reality data is drawn.\n * @public\n */\nexport class BlankConnection extends IModelConnection {\n public override isBlankConnection(): this is BlankConnection { return true; }\n\n /** The Guid that identifies the iTwin for this BlankConnection.\n * @note This can also be set via the [[create]] method using [[BlankConnectionProps.iTwinId]].\n */\n public override get iTwinId(): GuidString | undefined { return this._iTwinId; }\n public override set iTwinId(iTwinId: GuidString | undefined) { this._iTwinId = iTwinId; }\n /** A BlankConnection does not have an associated iModel, so its `iModelId` is alway `undefined`. */\n public override get iModelId(): undefined { return undefined; } // GuidString | undefined for the superclass, but always undefined for BlankConnection\n\n /** A BlankConnection is always considered closed because it does not have a specific backend nor associated iModel.\n * @returns `true` is always returned since RPC operations and iModel queries are not valid.\n * @note Even though true is always returned, it is still valid to call [[close]] to dispose frontend resources.\n */\n public get isClosed(): boolean { return true; }\n\n /** Create a new [Blank IModelConnection]($docs/learning/frontend/BlankConnection).\n * @param props The properties to use for the new BlankConnection.\n */\n public static create(props: BlankConnectionProps): BlankConnection {\n const connection = new BlankConnection({\n name: props.name,\n rootSubject: { name: props.name },\n projectExtents: props.extents,\n globalOrigin: props.globalOrigin,\n ecefLocation: props.location instanceof Cartographic ? EcefLocation.createFromCartographicOrigin(props.location) : props.location,\n key: \"\",\n iTwinId: props.iTwinId,\n });\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** There are no connections to the backend to close in the case of a BlankConnection.\n * However, there are frontend resources (like the tile cache) that can be disposed.\n * @note A BlankConnection should not be used after calling `close`.\n */\n public async close(): Promise<void> {\n this.beforeClose();\n }\n\n /** @internal */\n public closeSync(): void {\n this.beforeClose();\n }\n}\n\n/** A connection to a [SnapshotDb]($backend) hosted on a backend.\n * @public\n */\nexport class SnapshotConnection extends IModelConnection {\n /** Type guard for instanceof [[SnapshotConnection]] */\n public override isSnapshotConnection(): this is SnapshotConnection { return true; }\n\n /** The Guid that identifies this iModel. */\n public override get iModelId(): GuidString { return expectDefined(super.iModelId); } // GuidString | undefined for the superclass, but required for SnapshotConnection\n\n /** Returns `true` if [[close]] has already been called. */\n public get isClosed(): boolean { return this._isClosed ? true : false; }\n private _isClosed?: boolean;\n\n /** Returns `true` if this is a connection to a remote snapshot iModel resolved by the backend.\n * @see [[openRemote]]\n */\n public get isRemote(): boolean { return this._isRemote ? true : false; }\n private _isRemote?: boolean;\n\n /** Open an IModelConnection to a read-only snapshot iModel from a file name.\n * @note This method is intended for desktop or mobile applications and is not available for web applications.\n */\n public static async openFile(filePath: string): Promise<SnapshotConnection> {\n if (!IpcApp.isValid)\n throw new Error(\"IPC required to open a snapshot\");\n\n Logger.logTrace(loggerCategory, \"SnapshotConnection.openFile\", () => ({ filePath }));\n\n const connectionProps = await IpcApp.appFunctionIpc.openSnapshot(filePath);\n const connection = new SnapshotConnection(connectionProps);\n IModelConnection.onOpen.raiseEvent(connection);\n\n return connection;\n }\n\n /** Open an IModelConnection to a remote read-only snapshot iModel from a key that will be resolved by the backend.\n * @note This method is intended for web applications.\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [[CheckpointConnection.openRemote]].\n */\n public static async openRemote(fileKey: string): Promise<SnapshotConnection> {\n const routingContext = IModelRoutingContext.current || IModelRoutingContext.default;\n RpcManager.setIModel({ iModelId: \"undefined\", key: fileKey });\n\n const openResponse = await SnapshotIModelRpcInterface.getClientForRouting(routingContext.token).openRemote(fileKey); // eslint-disable-line @typescript-eslint/no-deprecated\n Logger.logTrace(loggerCategory, \"SnapshotConnection.openRemote\", () => ({ fileKey }));\n const connection = new SnapshotConnection(openResponse);\n connection.routingContext = routingContext;\n connection._isRemote = true;\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** Close this SnapshotConnection.\n * @note For local snapshot files, `close` closes the connection and the underlying [SnapshotDb]($backend) database file.\n * For remote snapshots, `close` only closes the connection and frees any frontend resources allocated to the connection.\n * @see [[openFile]], [[openRemote]]\n */\n public async close(): Promise<void> {\n if (this.isClosed)\n return;\n\n this.beforeClose();\n try {\n if (!this.isRemote) {\n await IpcApp.appFunctionIpc.closeIModel(this.key);\n }\n } finally {\n this._isClosed = true;\n }\n }\n}\n\n/** @public */\nexport namespace IModelConnection {\n\n /** The id/name/class of a ViewDefinition. Returned by [[IModelConnection.Views.getViewList]] */\n export interface ViewSpec {\n /** The element id of the ViewDefinition. This string may be passed to [[IModelConnection.Views.load]]. */\n id: string;\n /** The name of the view. This string may be used to create a list with the possible view names. */\n name: string;\n /** The fullClassName of the ViewDefinition. Useful for sorting the list of views. */\n class: string;\n }\n\n /** The collection of loaded ModelState objects for an [[IModelConnection]]. */\n export class Models implements Iterable<ModelState> {\n private readonly _modelExtentsQuery = `\n SELECT\n Model.Id AS ECInstanceId,\n iModel_bbox_union(\n iModel_placement_aabb(\n iModel_placement(\n iModel_point(Origin.X, Origin.Y, 0),\n iModel_angles(Rotation, 0, 0),\n iModel_bbox(\n BBoxLow.X, BBoxLow.Y, -1,\n BBoxHigh.X, BBoxHigh.Y, 1\n )\n )\n )\n ) AS bbox\n FROM bis.GeometricElement2d\n WHERE InVirtualSet(:ids64, Model.Id) AND Origin.X IS NOT NULL\n GROUP BY Model.Id\n UNION\n SELECT\n ge.Model.Id AS ECInstanceId,\n iModel_bbox(\n min(i.MinX), min(i.MinY), min(i.MinZ),\n max(i.MaxX), max(i.MaxY), max(i.MaxZ)\n ) AS bbox\n FROM bis.SpatialIndex AS i, bis.GeometricElement3d AS ge, bis.GeometricModel3d AS gm\n WHERE InVirtualSet(:ids64, ge.Model.Id) AND ge.ECInstanceId=i.ECInstanceId AND InVirtualSet(:ids64, gm.ECInstanceId) AND (gm.$->isNotSpatiallyLocated?=false OR gm.$->isNotSpatiallyLocated? IS NULL)\n GROUP BY ge.Model.Id\n UNION\n SELECT\n ge.Model.Id AS ECInstanceId,\n iModel_bbox_union(\n iModel_placement_aabb(\n iModel_placement(\n iModel_point(ge.Origin.X, ge.Origin.Y, ge.Origin.Z),\n iModel_angles(ge.Yaw, ge.Pitch, ge.Roll),\n iModel_bbox(\n ge.BBoxLow.X, ge.BBoxLow.Y, ge.BBoxLow.Z,\n ge.BBoxHigh.X, ge.BBoxHigh.Y, ge.BBoxHigh.Z\n )\n )\n )\n ) AS bbox\n FROM bis.GeometricElement3d AS ge, bis.GeometricModel3d as gm\n WHERE InVirtualSet(:ids64, ge.Model.Id) AND ge.Origin.X IS NOT NULL AND InVirtualSet(:ids64, gm.ECInstanceId) AND gm.$->isNotSpatiallyLocated?=true\n GROUP BY ge.Model.Id`;\n\n private readonly _modelExistenceQuery = `\n WITH\n GeometricModels AS(\n SELECT\n ECInstanceId\n FROM bis.GeometricModel\n WHERE InVirtualSet(: ids64, ECInstanceId)\n )\n SELECT\n ECInstanceId,\n true AS isGeometricModel\n FROM GeometricModels\n UNION ALL\n SELECT\n ECInstanceId,\n false AS isGeometricModel\n FROM bis.Model\n WHERE InVirtualSet(: ids64, ECInstanceId)\n AND ECInstanceId NOT IN(SELECT ECInstanceId FROM GeometricModels)`;\n\n private _loadedExtents: ModelExtentsProps[] = [];\n private _geometryChangedListener?: (changes: readonly ModelIdAndGeometryGuid[]) => void;\n\n private _loaded = new Map<string, ModelState>();\n\n /** @internal */\n public get loaded(): Map<string, ModelState> { return this._loaded; }\n\n /** An iterator over all currently-loaded models. */\n public [Symbol.iterator](): Iterator<ModelState> {\n return this._loaded.values()[Symbol.iterator]();\n }\n\n /** @internal */\n constructor(private _iModel: IModelConnection) {\n IModelConnection.onOpen.addListener(() => {\n if (this._iModel.isBriefcaseConnection()) {\n this._geometryChangedListener = (changes) => {\n this._loadedExtents = this._loadedExtents.filter((extent) => !changes.some((change) => change.id === extent.id));\n };\n\n this._iModel.txns.onModelGeometryChanged.addListener(this._geometryChangedListener);\n }\n });\n\n IModelConnection.onClose.addListener(() => {\n if (this._iModel.isBriefcaseConnection() && this._geometryChangedListener) {\n this._iModel.txns.onModelGeometryChanged.removeListener(this._geometryChangedListener);\n this._geometryChangedListener = undefined;\n }\n });\n }\n\n /** The Id of the [RepositoryModel]($backend). */\n public get repositoryModelId(): string { return \"0x1\"; }\n\n /** @internal */\n public async getDictionaryModel(): Promise<Id64String> {\n const res = await this._iModel.models.queryProps({ from: \"bis.DictionaryModel\", wantPrivate: true });\n if (res.length !== 1 || res[0].id === undefined)\n throw new IModelError(IModelStatus.BadModel, \"bis.DictionaryModel\");\n return res[0].id;\n }\n\n /** Get a batch of [[ModelProps]] given a list of Model ids. */\n public async getProps(modelIds: Id64Arg): Promise<ModelProps[]> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).getModelProps(iModel.getRpcProps(), [...Id64.toIdSet(modelIds)]) : [];\n }\n\n /** Find a ModelState in the set of loaded Models by ModelId. */\n public getLoaded(id: string): ModelState | undefined {\n return this._loaded.get(id);\n }\n\n /** Given a set of modelIds, return the subset of corresponding models that are not currently loaded.\n * @param modelIds The set of model Ids\n * @returns The subset of the supplied Ids corresponding to models that are not currently loaded, or undefined if all of the specified models are loaded.\n */\n public filterLoaded(modelIds: Id64Arg): Id64Set | undefined {\n let unloaded: Set<string> | undefined;\n for (const id of Id64.iterable(modelIds)) {\n if (undefined === this.getLoaded(id)) {\n if (undefined === unloaded)\n unloaded = new Set<string>();\n\n unloaded.add(id);\n }\n }\n\n return unloaded;\n }\n\n /** load a set of Models by Ids. After the returned Promise resolves, you may get the ModelState objects by calling getLoadedModel. */\n public async load(modelIds: Id64Arg): Promise<void> {\n const notLoaded = this.filterLoaded(modelIds);\n if (undefined === notLoaded)\n return; // all requested models are already loaded\n\n try {\n const propArray = await this.getProps(notLoaded);\n await this.updateLoadedWithModelProps(propArray);\n } catch {\n // ignore error, we had nothing to do.\n }\n }\n\n /** Given an array of modelProps, find the class for each model and construct it. save it in the iModelConnection's loaded set. */\n public async updateLoadedWithModelProps(modelProps: ModelProps[]): Promise<void> {\n try {\n for (const props of modelProps) {\n const ctor = await this._iModel.findClassFor(props.classFullName, ModelState);\n if (undefined !== ctor && undefined !== props.id && undefined === this.getLoaded(props.id)) { // do not overwrite if someone else loads it while we await\n const modelState = new ctor(props, this._iModel); // create a new instance of the appropriate ModelState subclass\n this._loaded.set(modelState.id, modelState); // save it in loaded set\n }\n }\n } catch {\n // ignore error, we had nothing to do.\n }\n }\n\n /** Remove a model from the set of loaded models. Used internally by BriefcaseConnection in response to txn events.\n * @internal\n */\n public unload(modelId: Id64String): void {\n this._loaded.delete(modelId);\n }\n\n /** Query for a set of model ranges by ModelIds.\n * @param modelIds the Id or Ids of the [GeometricModel]($backend)s for which to query the ranges.\n * @returns An array containing the range of each model of each unique model Id, omitting the range for any Id which did no identify a GeometricModel.\n * @note The contents of the returned array do not follow a deterministic order.\n * @throws [IModelError]($common) if exactly one model Id is specified and that Id does not identify a GeometricModel.\n * @see [[queryExtents]] for a similar function that does not throw and produces a deterministically-ordered result.\n */\n public async queryModelRanges(modelIds: Id64Arg): Promise<Range3dProps[]> {\n const results = await this.queryExtents([...Id64.toIdSet(modelIds)]);\n\n if (results.length === 1 && results[0].status !== IModelStatus.Success) {\n throw new IModelError(results[0].status, \"error querying model range\");\n }\n\n return results.filter((x) => x.status === IModelStatus.Success).map((x) => x.extents);\n }\n\n /** For each [GeometricModel]($backend) specified by Id, attempts to obtain the union of the volumes of all geometric elements within that model.\n * @param modelIds The Id or Ids of the geometric models for which to obtain the extents.\n * @returns An array of results, one per supplied Id, in the order in which the Ids were supplied. If the extents could not be obtained, the\n * corresponding results entry's `extents` will be a \"null\" range (@see [Range3d.isNull]($geometry) and its `status` will indicate\n * why the extents could not be obtained (e.g., because the Id did not identify a [GeometricModel]($backend)).\n */\n public async queryExtents(modelIds: Id64String | Id64String[]): Promise<ModelExtentsProps[]> {\n if (!this._iModel.isOpen)\n return [];\n\n if (typeof modelIds === \"string\")\n modelIds = [modelIds];\n\n const modelExtents: ModelExtentsProps[] = [];\n\n for (const modelId of modelIds) {\n if (!Id64.isValidId64(modelId)) {\n modelExtents.push({ id: modelId, extents: Range3d.createNull(), status: IModelStatus.InvalidId });\n }\n }\n\n const getUnloadedModelIds = () => modelIds.filter((modelId) => !modelExtents.some((loadedExtent) => loadedExtent.id === modelId));\n\n let remainingModelIds = getUnloadedModelIds();\n for (const modelId of remainingModelIds) {\n const modelExtent = this._loadedExtents.find((extent) => modelId === extent.id);\n if (modelExtent) {\n modelExtents.push(modelExtent);\n }\n }\n\n remainingModelIds = getUnloadedModelIds();\n if (remainingModelIds.length > 0) {\n const params = new QueryBinder();\n params.bindIdSet(\"ids64\", remainingModelIds);\n\n const extentsQueryReader = this._iModel.createQueryReader(this._modelExtentsQuery, params, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n });\n\n for await (const row of extentsQueryReader) {\n const byteArray = new Uint8Array(Object.values(row.bbox));\n const extents = Range3d.fromArrayBuffer(byteArray.buffer);\n\n const extent = { id: row.ECInstanceId, extents, status: IModelStatus.Success };\n modelExtents.push(extent);\n this._loadedExtents.push(extent);\n }\n }\n\n remainingModelIds = getUnloadedModelIds();\n if (remainingModelIds.length > 0) {\n const params = new QueryBinder();\n params.bindIdSet(\"ids64\", remainingModelIds);\n\n const modelExistenceQueryReader = this._iModel.createQueryReader(this._modelExistenceQuery, params, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n });\n\n for await (const row of modelExistenceQueryReader) {\n let extent: ModelExtentsProps;\n if (row.isGeometricModel) {\n extent = { id: row.ECInstanceId, extents: Range3d.createNull(), status: IModelStatus.Success };\n } else {\n extent = { id: row.ECInstanceId, extents: Range3d.createNull(), status: IModelStatus.WrongModel };\n }\n modelExtents.push(extent);\n this._loadedExtents.push(extent);\n }\n }\n\n return modelIds.map((modelId) => {\n let extent = modelExtents.find((loadedExtent) => loadedExtent.id === modelId);\n\n if (extent === undefined) {\n extent = { id: modelId, extents: Range3d.createNull(), status: IModelStatus.NotFound };\n this._loadedExtents.push(extent);\n return extent;\n } else if (extent.status === IModelStatus.InvalidId) {\n extent.id = \"0\";\n return extent;\n }\n\n return extent;\n });\n }\n\n /** Query for a set of ModelProps of the specified ModelQueryParams.\n * @param queryParams The query parameters. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async queryProps(queryParams: ModelQueryParams): Promise<ModelProps[]> {\n const iModel = this._iModel;\n if (!iModel.isOpen)\n return [];\n const params: ModelQueryParams = { ...queryParams }; // make a copy\n params.from = queryParams.from || ModelState.classFullName; // use \"BisCore:Model\" as default class name\n params.where = queryParams.where || \"\";\n if (!queryParams.wantPrivate) {\n if (params.where.length > 0)\n params.where += \" AND \";\n\n params.where += \"IsPrivate=FALSE \";\n }\n if (!queryParams.wantTemplate) {\n if (params.where.length > 0)\n params.where += \" AND \";\n\n params.where += \"IsTemplate=FALSE \";\n }\n return IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).queryModelProps(iModel.getRpcProps(), params);\n }\n\n /** Asynchronously stream ModelProps using the specified ModelQueryParams. */\n public async * query(queryParams: ModelQueryParams): AsyncIterableIterator<ModelProps> {\n // NOTE: this implementation has the desired API signature, but its implementation must be improved to actually page results\n const modelPropsArray: ModelProps[] = await this.queryProps(queryParams);\n for (const modelProps of modelPropsArray) {\n yield modelProps;\n }\n }\n }\n\n /** Options controlling the results produced by [[IModelConnection.Elements.getPlacements]].\n * @public\n */\n export interface GetPlacementsOptions {\n /** The types of elements for which to query [Placement]($common)s:\n * - \"2d\": Include only [GeometricElement2d]($backend)s.\n * - \"3d\": Include only [GeometricElement3d]($backend)s.\n * - `undefined`: Include both 2d and 3d [GeometricElement]($backend)s.\n */\n type?: \"3d\" | \"2d\";\n }\n\n /** The collection of Elements for an [[IModelConnection]]. */\n export class Elements {\n /** @internal */\n public constructor(private _iModel: IModelConnection) { }\n\n /** The Id of the [root subject element]($docs/bis/guide/references/glossary.md#subject-root) for this iModel. */\n public get rootSubjectId(): Id64String { return \"0x1\"; }\n\n /** Get a set of element ids that satisfy a query */\n public async queryIds(params: EntityQueryParams): Promise<Id64Set> { return this._iModel.queryEntityIds(params); }\n\n /** Get an array of [[ElementProps]] given one or more element ids.\n * @note This method returns **all** of the properties of the element (excluding GeometryStream), which may be a very large amount of data - consider using\n * [[IModelConnection.query]] to select only those properties of interest to limit the amount of data returned.\n */\n public async getProps(arg: Id64Arg): Promise<ElementProps[]> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).getElementProps(this._iModel.getRpcProps(), [...Id64.toIdSet(arg)]) : [];\n }\n\n /** Obtain the properties of a single element, optionally specifying specific properties to include or exclude.\n * For example, [[getProps]] and [[queryProps]] omit the [GeometryStreamProps]($common) property of [GeometricElementProps]($common) and [GeometryPartProps]($common)\n * because it can be quite large and is generally not useful to frontend code. The following code requests that the geometry stream be included:\n * ```ts\n * const props = await iModel.elements.loadProps(elementId, { wantGeometry: true });\n * ```\n * @param identifier Identifies the element by its Id, federation Guid, or [Code]($common).\n * @param options Optionally includes or excludes specific properties.\n * @returns The properties of the requested element; or `undefined` if no element exists with the specified identifier or the iModel is not open.\n * @throws [IModelError]($common) if the element exists but could not be loaded.\n */\n public async loadProps(identifier: Id64String | GuidString | CodeProps, options?: ElementLoadOptions): Promise<ElementProps | undefined> {\n const imodel = this._iModel;\n return imodel.isOpen ? IModelReadRpcInterface.getClientForRouting(imodel.routingContext.token).loadElementProps(imodel.getRpcProps(), identifier, options) : undefined;\n }\n\n /** Get an array of [[ElementProps]] that satisfy a query\n * @param params The query parameters. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async queryProps(params: EntityQueryParams): Promise<ElementProps[]> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).queryElementProps(iModel.getRpcProps(), params) : [];\n }\n\n /** Obtain the [Placement]($common)s of a set of [GeometricElement]($backend)s.\n * @param elementIds The Ids of the elements whose placements are to be queried.\n * @param options Options customizing how the placements are queried.\n * @returns an array of placements, each having an additional `elementId` property identifying the element from which the placement was obtained.\n * @note Any Id that does not identify a geometric element with a valid bounding box and origin is omitted from the returned array.\n */\n public async getPlacements(elementIds: Iterable<Id64String>, options?: Readonly<GetPlacementsOptions>): Promise<Array<Placement & { elementId: Id64String }>> {\n let ids: Id64String[];\n if (typeof elementIds === \"string\")\n ids = [elementIds];\n else if (!Array.isArray(elementIds))\n ids = Array.from(elementIds);\n else\n ids = elementIds;\n\n if (ids.length === 0)\n return [];\n\n const select3d = `\n SELECT\n ECInstanceId,\n Origin.x as x, Origin.y as y, Origin.z as z,\n BBoxLow.x as lx, BBoxLow.y as ly, BBoxLow.z as lz,\n BBoxHigh.x as hx, BBoxHigh.y as hy, BBoxHigh.z as hz,\n Yaw, Pitch, Roll,\n NULL as Rotation\n FROM bis.GeometricElement3d\n WHERE Origin IS NOT NULL AND BBoxLow IS NOT NULL AND BBoxHigh IS NOT NULL`;\n\n // Note: For the UNION ALL statement, the column aliases in select2d are ignored - so they\n // must match those in select3d.\n const select2d = `\n SELECT\n ECInstanceId,\n Origin.x as x, Origin.y as y, NULL as z,\n BBoxLow.x as lx, BBoxLow.y as ly, NULL as lz,\n BBoxHigh.x as hx, BBoxHigh.y as hy, NULL as hz,\n NULL as yaw, NULL as pitch, NULL as roll,\n Rotation\n FROM bis.GeometricElement2d\n WHERE Origin IS NOT NULL AND BBoxLow IS NOT NULL AND BBoxHigh IS NOT NULL`;\n\n const idCriterion = `ECInstanceId IN (${ids.join(\",\")})`;\n\n let ecsql;\n switch (options?.type) {\n case \"3d\":\n ecsql = `${select3d} AND ${idCriterion}`;\n break;\n case \"2d\":\n ecsql = `${select2d} AND ${idCriterion}`;\n break;\n default:\n ecsql = `\n SELECT * FROM (\n ${select3d}\n UNION ALL\n ${select2d}\n ) WHERE ${idCriterion}`;\n break;\n }\n\n const placements = new Array<Placement & { elementId: Id64String }>();\n for await (const queryRow of this._iModel.createQueryReader(ecsql, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames })) {\n const row = queryRow.toRow();\n const origin = [row.x, row.y, row.z];\n const bbox = {\n low: { x: row.lx, y: row.ly, z: row.lz },\n high: { x: row.hx, y: row.hy, z: row.hz },\n };\n\n let placement;\n if (undefined === row.lz)\n placement = Placement2d.fromJSON({ bbox, origin, angle: row.rotation });\n else\n placement = Placement3d.fromJSON({ bbox, origin, angles: { yaw: row.yaw, pitch: row.pitch, roll: row.roll } });\n\n const placementWithId = (placement as Placement & { elementId: Id64String });\n placementWithId.elementId = row.id;\n placements.push(placementWithId);\n }\n\n return placements;\n }\n }\n\n /** The collection of [[CodeSpec]] entities for an [[IModelConnection]]. */\n export class CodeSpecs {\n /** @internal */\n constructor(private _iModel: IModelConnection) { }\n\n private _isCodeSpecProperties(x: any): x is CodeSpecProperties {\n if (!x || !x.scopeSpec || !Object.values(CodeScopeSpec.Type).includes(x.scopeSpec.type))\n return false;\n\n if (typeof x.scopeSpec.fGuidRequired !== \"boolean\" && typeof x.scopeSpec.fGuidRequired !== \"undefined\")\n return false;\n\n if (typeof x.scopeSpec.relationship !== \"string\" && typeof x.scopeSpec.relationship !== \"undefined\")\n return false;\n\n if (typeof x.spec?.isManagedWithDgnDb !== \"boolean\" && typeof x.spec?.isManagedWithDgnDb !== \"undefined\")\n return false;\n\n if (typeof x.version !== \"string\" && typeof x.version !== \"undefined\")\n return false;\n\n return true;\n }\n\n private async _loadCodeSpec(identifier: { name: string; id?: undefined } | { id: string; name?: undefined }): Promise<CodeSpec> {\n const isNameDefined = identifier.name !== undefined;\n const query = `\n SELECT ECInstanceId AS Id, Name, JsonProperties\n FROM BisCore.CodeSpec\n WHERE ${isNameDefined ? `Name=:name` : `Id=:id`}`;\n\n const params = new QueryBinder();\n if (isNameDefined) {\n params.bindString(\"name\", identifier.name);\n } else {\n params.bindId(\"id\", identifier.id);\n }\n\n const queryReader = this._iModel.createQueryReader(query, params, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n });\n\n const queryResult = await queryReader.next();\n\n if (queryResult.done) throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\");\n\n const codeSpecResult = queryResult.value;\n\n if (\n typeof codeSpecResult.Id !== \"string\" ||\n typeof codeSpecResult.Name !== \"string\" ||\n typeof codeSpecResult.JsonProperties !== \"string\"\n )\n throw new Error(\"Invalid CodeSpec was returned\");\n\n const jsonProperties = JSON.parse(codeSpecResult.JsonProperties);\n\n if (!this._isCodeSpecProperties(jsonProperties))\n throw new Error(\"Invalid CodeSpecProperties returned in the CodeSpec\");\n\n const codeSpec = CodeSpec.createFromJson(\n this._iModel,\n Id64.fromString(codeSpecResult.Id),\n codeSpecResult.Name,\n jsonProperties\n );\n return codeSpec;\n }\n\n /** Look up a CodeSpec by Id.\n * @param codeSpecId The Id of the CodeSpec to load\n * @returns The CodeSpec with the specified Id\n * @throws [[IModelError]] if the Id is invalid or if no CodeSpec with that Id could be found.\n */\n public async getById(codeSpecId: Id64String): Promise<CodeSpec> {\n if (codeSpecId === \"\") throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\");\n if (!Id64.isValid(codeSpecId))\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\", () => ({ codeSpecId }));\n\n return this._loadCodeSpec({ id: codeSpecId });\n }\n\n /** Look up a CodeSpec by name.\n * @param name The name of the CodeSpec to load\n * @returns The CodeSpec with the specified name\n * @throws [[IModelError]] if no CodeSpec with the specified name could be found.\n */\n public async getByName(name: string): Promise<CodeSpec> {\n if (name === \"\") throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\");\n\n return this._loadCodeSpec({ name });\n }\n }\n\n /** The collection of views for an [[IModelConnection]]. */\n export class Views {\n /** @internal */\n constructor(private _iModel: IModelConnection) { }\n private _writeViewStoreProxy?: PickAsyncMethods<ViewStoreRpc.Writer>;\n private _readViewStoreProxy?: PickAsyncMethods<ViewStoreRpc.Reader>;\n\n public get viewStoreWriter() {\n return this._writeViewStoreProxy ??= new Proxy(this, {\n get(views, methodName: string) {\n const iModel = views._iModel;\n return async (...args: any[]) => IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).callViewStore(iModel.getRpcProps(), ViewStoreRpc.version, true, methodName, ...args);\n },\n }) as unknown as PickAsyncMethods<ViewStoreRpc.Writer>;\n }\n public get viewsStoreReader() {\n return this._readViewStoreProxy ??= new Proxy(this, {\n get(views, methodName: string) {\n const iModel = views._iModel;\n return async (...args: any[]) => IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).callViewStore(iModel.getRpcProps(), ViewStoreRpc.version, false, methodName, ...args);\n },\n }) as unknown as PickAsyncMethods<ViewStoreRpc.Reader>;\n }\n\n /** Query for an array of ViewDefinitionProps\n * @param queryParams Query parameters specifying the views to return. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async queryProps(queryParams: ViewQueryParams): Promise<ViewDefinitionProps[]> {\n const iModel = this._iModel;\n if (iModel.isClosed)\n return [];\n\n const params: ViewQueryParams = { ...queryParams }; // make a copy\n params.from = queryParams.from || ViewState.classFullName; // use \"BisCore:ViewDefinition\" as default class name\n params.where = queryParams.where || \"\";\n if (queryParams.wantPrivate === undefined || !queryParams.wantPrivate) {\n if (params.where.length > 0)\n params.where += \" AND \";\n\n params.where += \"IsPrivate=FALSE \";\n }\n const viewProps = await IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).queryElementProps(iModel.getRpcProps(), params);\n assert((viewProps.length === 0) || (\"categorySelectorId\" in viewProps[0]), \"invalid view definition\"); // spot check that the first returned element is-a ViewDefinitionProps\n return viewProps as ViewDefinitionProps[];\n }\n\n /** Get an array of the ViewSpecs for all views in this IModel that satisfy a ViewQueryParams.\n *\n * This is typically used to create a list for UI.\n *\n * For example:\n * ```ts\n * [[include:IModelConnection.Views.getSpatialViewList]]\n * ```\n * @param queryParams The parameters for the views to find. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async getViewList(queryParams: ViewQueryParams): Promise<ViewSpec[]> {\n const views: ViewSpec[] = [];\n const viewProps: ViewDefinitionProps[] = await this.queryProps(queryParams);\n viewProps.forEach((viewProp) => {\n views.push({ id: viewProp.id as string, name: viewProp.code.value ?? \"\", class: viewProp.classFullName });\n });\n\n return views;\n }\n\n /** Query the Id of the default [ViewDefinition]($backend), if any, stored in this iModel's property table.\n * The default view is typically chosen by the application (such as a connector) that created the iModel.\n * There is no guarantee that this view will be suitable for the purposes of any other applications.\n * Most applications should ignore the default view and instead create a [[ViewState]] that fits their own requirements using APIs like [[ViewCreator3d]].\n * @returns the Id of the default view as defined in the iModel's property table, or an invalid ID if no default view is defined.\n * @deprecated in 4.2 - will not be removed until after 2026-06-13. Create a ViewState to your own specifications.\n */\n public async queryDefaultViewId(): Promise<Id64String> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).getDefaultViewId(iModel.getRpcProps()) : Id64.invalid;\n }\n\n /** Load a [[ViewState]] object from the specified [[ViewDefinition]] id. */\n public async load(viewDefinitionId: ViewIdString): Promise<ViewState> {\n const options: ViewStateLoadProps = {\n displayStyle: {\n omitScheduleScriptElementIds: !IModelApp.tileAdmin.enableFrontendScheduleScripts,\n compressExcludedElementIds: true,\n },\n };\n const viewProps = await IModelReadRpcInterface.getClientForRouting(this._iModel.routingContext.token).getViewStateData(this._iModel.getRpcProps(), viewDefinitionId, options);\n const viewState = await this.convertViewStatePropsToViewState(viewProps);\n return viewState;\n }\n\n /** Return the [[ViewState]] object associated with the [[ViewStateProps]] passed in. */\n public async convertViewStatePropsToViewState(viewProps: ViewStateProps): Promise<ViewState> {\n const className = viewProps.viewDefinitionProps.classFullName;\n const ctor = await this._iModel.findClassFor<typeof EntityState>(className, undefined) as typeof ViewState | undefined;\n\n if (undefined === ctor)\n throw new IModelError(IModelStatus.WrongClass, \"Invalid ViewState class\", () => viewProps);\n\n const viewState = expectDefined(ctor.createFromProps(viewProps, this._iModel));\n await viewState.load(); // loads models for ModelSelector\n\n return viewState;\n }\n }\n\n /** @public */\n export namespace Categories {\n /** A subset of the information describing a [SubCategory]($backend), supplied by [[IModelConnection.Categories.getCategoryInfo]]\n * or [[IModelConnection.Categories.getSubCategoryInfo]].\n */\n export interface SubCategoryInfo {\n /** The [SubCategory]($backend)'s element Id. */\n readonly id: Id64String;\n /** The Id of the [Category]($backend) to which this [SubCategory]($backend) belongs. */\n readonly categoryId: Id64String;\n /** Visual parameters applied to geometry belonging to this [SubCategory]($backend). */\n readonly appearance: Readonly<SubCategoryAppearance>;\n }\n\n /** A subset of the information describing a [Category]($backend), supplied by [[IModelConnection.Categories.getCategoryInfo]]. */\n export interface CategoryInfo {\n /** The category's element Id. */\n readonly id: Id64String;\n /** For each [SubCategory]($backend) belonging to this [Category]($backend), a mapping from the SubCategory's element Id to its properties. */\n readonly subCategories: Map<Id64String, SubCategoryInfo>;\n }\n }\n\n /** Provides access to information about the [Category]($backend)'s stored in an [[IModelConnection]].\n * This information is cached internally so that repeated requests need not query the backend.\n * @see [[IModelConnection.categories]] for the categories associated with a specific iModel.\n */\n export class Categories {\n /** @internal */\n public readonly cache: SubCategoriesCache;\n\n /** @internal */\n public constructor(iModel: IModelConnection) {\n this.cache = new SubCategoriesCache(iModel);\n }\n\n /** Obtain information about one or more [Category]($backend)'s. */\n public async getCategoryInfo(categoryIds: Iterable<Id64String>): Promise<Map<Id64String, Categories.CategoryInfo>> {\n return this.cache.getCategoryInfo(categoryIds);\n }\n\n /** Obtain information about one or more [SubCategory]($backend)'s belonging to the specified [Category]($backend). */\n public async getSubCategoryInfo(args: {\n category: Id64String;\n subCategories: Iterable<Id64String>;\n }): Promise<Map<Id64String, Categories.SubCategoryInfo>> {\n return this.cache.getSubCategoryInfo(args.category, args.subCategories);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EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAE7F,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAC/E,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,iCAAiC;YAEzD,OAAO,SAAS,CAAC;QACnB,CAAC;KACF;IAzGY,sBAAK,QAyGjB,CAAA;IAyBD;;;OAGG;IACH,MAAa,UAAU;QACrB,gBAAgB;QACA,KAAK,CAAqB;QAE1C,gBAAgB;QAChB,YAAmB,MAAwB;YACzC,IAAI,CAAC,KAAK,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;QAED,mEAAmE;QAC5D,KAAK,CAAC,eAAe,CAAC,WAAiC;YAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACjD,CAAC;QAED,sHAAsH;QAC/G,KAAK,CAAC,kBAAkB,CAAC,IAG/B;YACC,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1E,CAAC;KACF;IArBY,2BAAU,aAqBtB,CAAA;AACH,CAAC,EAptBgB,gBAAgB,KAAhB,gBAAgB,QAotBhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport {\n assert, BeEvent, CompressedId64Set, expectDefined, GeoServiceStatus, GuidString, Id64, Id64Arg, Id64Set, Id64String, IModelStatus, Logger, OneAtATimeAction, OpenMode,\n PickAsyncMethods, TransientIdSequence,\n} from \"@itwin/core-bentley\";\nimport {\n Cartographic, CodeProps, CodeScopeSpec, CodeSpec, CodeSpecProperties, DbQueryRequest, EcefLocation, EcefLocationProps, ECSqlReader, ElementLoadOptions, ElementMeshRequestProps,\n ElementProps, EntityQueryParams, FontMap, GeoCoordStatus, GeographicCRSProps, GeometryContainmentRequestProps, GeometryContainmentResponseProps, GeometrySummaryRequestProps, IModel, IModelConnectionProps, IModelError,\n IModelReadRpcInterface, mapToGeoServiceStatus, MassPropertiesPerCandidateRequestProps, MassPropertiesPerCandidateResponseProps,\n MassPropertiesRequestProps, MassPropertiesResponseProps, ModelExtentsProps, ModelIdAndGeometryGuid, ModelProps, ModelQueryParams, Placement, Placement2d,\n Placement3d, QueryBinder, QueryOptions, QueryRowFormat, RpcManager, SnapRequestProps, SnapResponseProps,\n SnapshotIModelRpcInterface, SubCategoryAppearance, SubCategoryResultRow, TextureData, TextureLoadProps, ViewDefinitionProps,\n ViewIdString, ViewQueryParams, ViewStateLoadProps, ViewStateProps, ViewStoreRpc,\n} from \"@itwin/core-common\";\nimport { Point3d, Range3d, Range3dProps, Transform, XYAndZ, XYZProps } from \"@itwin/core-geometry\";\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\nimport { CheckpointConnection } from \"./CheckpointConnection\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { EntityState } from \"./EntityState\";\nimport { GeoServices } from \"./GeoServices\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelRoutingContext } from \"./IModelRoutingContext\";\nimport { ModelState } from \"./ModelState\";\nimport { HiliteSet, SelectionSet } from \"./SelectionSet\";\nimport { SubCategoriesCache } from \"./SubCategoriesCache\";\nimport { BingElevationProvider } from \"./tile/internal\";\nimport { Tiles } from \"./Tiles\";\nimport { ViewState } from \"./ViewState\";\nimport { _requestSnap } from \"./common/internal/Symbols\";\nimport { IpcApp } from \"./IpcApp\";\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\nimport { ECSchemaRpcLocater, RpcIncrementalSchemaLocater } from '@itwin/ecschema-rpcinterface-common';\n\n\nconst loggerCategory: string = FrontendLoggerCategory.IModelConnection;\n\n/** The properties for creating a [Blank IModelConnection]($docs/learning/frontend/BlankConnection)\n * @public\n */\nexport interface BlankConnectionProps {\n /** A name for this blank connection. */\n name: string;\n /** The spatial location for the blank connection. */\n location: Cartographic | EcefLocationProps;\n /** The volume of interest, in meters, centered around `location` */\n extents: Range3dProps;\n /** An offset to be applied to all spatial coordinates. */\n globalOrigin?: XYZProps;\n /** The optional Guid that identifies the iTwin associated with the [[BlankConnection]]. */\n iTwinId?: GuidString;\n}\n\n/** A connection to a [IModelDb]($backend) hosted on the backend.\n * @public\n * @extensions\n */\nexport abstract class IModelConnection extends IModel {\n /** The [[ModelState]]s in this IModelConnection. */\n public readonly models: IModelConnection.Models;\n /** The [[ElementState]]s in this IModelConnection. */\n public readonly elements: IModelConnection.Elements;\n /** The [[CodeSpec]]s in this IModelConnection. */\n public readonly codeSpecs: IModelConnection.CodeSpecs;\n /** The [[ViewState]]s in this IModelConnection. */\n public readonly views: IModelConnection.Views;\n /** The set of currently hilited elements for this IModelConnection. */\n public readonly hilited: HiliteSet;\n /** The set of currently selected elements for this IModelConnection. */\n public readonly selectionSet: SelectionSet;\n /** The set of Tiles for this IModelConnection. */\n public readonly tiles: Tiles;\n /** The set of [Category]($backend)'s in this IModelConnection. */\n public readonly categories: IModelConnection.Categories;\n /** A cache of information about SubCategories chiefly used for rendering.\n * @internal\n */\n public get subcategories(): SubCategoriesCache { return this.categories.cache; }\n /** Generator for unique Ids of transient graphics for this IModelConnection. */\n public readonly transientIds = new TransientIdSequence();\n /** The Geographic location services available for this iModelConnection. */\n public readonly geoServices: GeoServices;\n /** @internal Whether GCS has been disabled for this iModelConnection. */\n protected _gcsDisabled = false;\n /** @internal Return true if a GCS is not defined for this iModelConnection; also returns true if GCS is defined but disabled. */\n public get noGcsDefined(): boolean { return this._gcsDisabled || undefined === this.geographicCoordinateSystem; }\n /** @internal */\n public disableGCS(disable: boolean): void { this._gcsDisabled = disable; }\n\n /** The maximum time (in milliseconds) to wait before timing out the request to open a connection to a new iModel */\n public static connectionTimeout: number = 10 * 60 * 1000;\n\n /** The RPC routing for this connection. */\n public routingContext: IModelRoutingContext = IModelRoutingContext.default;\n\n /** Type guard for instanceof [[BriefcaseConnection]] */\n public isBriefcaseConnection(): this is BriefcaseConnection { return false; }\n\n /** Type guard for instanceof [[CheckpointConnection]]\n * @beta\n */\n public isCheckpointConnection(): this is CheckpointConnection { return false; }\n\n /** Type guard for instanceof [[SnapshotConnection]] */\n public isSnapshotConnection(): this is SnapshotConnection { return false; }\n\n /** Type guard for instanceof [[BlankConnection]] */\n public isBlankConnection(): this is BlankConnection { return false; }\n\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\n public get isBriefcase(): boolean { return this.isBriefcaseConnection(); }\n\n /** Returns `true` if this is a *snapshot* iModel.\n * @see [[SnapshotConnection.openSnapshot]]\n */\n public get isSnapshot(): boolean { return this.isSnapshotConnection(); }\n\n /** True if this is a [Blank Connection]($docs/learning/frontend/BlankConnection). */\n public get isBlank(): boolean { return this.isBlankConnection(); }\n\n /** Check the [[openMode]] of this IModelConnection to see if it was opened read-only. */\n public get isReadonly(): boolean { return this.openMode === OpenMode.Readonly; }\n\n /** Check if the IModelConnection is open (i.e. it has a *connection* to a backend server).\n * Returns false for [[BlankConnection]] instances and after [[IModelConnection.close]] has been called.\n * @note no RPC operations are valid on this IModelConnection if this method returns false.\n */\n public get isOpen(): boolean { return !this.isClosed; }\n\n /** Check if the IModelConnection is closed (i.e. it has no *connection* to a backend server).\n * Returns true for [[BlankConnection]] instances and after [[IModelConnection.close]] has been called.\n * @note no RPC operations are valid on this IModelConnection if this method returns true.\n */\n public abstract get isClosed(): boolean;\n\n /** Event raised immediately before *any* IModelConnection is [[close]]d.\n * @note This static event is raised when *any* IModelConnection is closed, and the specific IModelConnection is passed as its argument. To\n * monitor closing a specific IModelConnection, listen for the `onClose` instance event instead.\n * @note Be careful not to perform any asynchronous operations on the IModelConnection because it will close before they are processed.\n */\n public static readonly onClose = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** Event called immediately after *any* IModelConnection is opened. */\n public static readonly onOpen = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** Event raised immediately before this IModelConnection is [[close]]d.\n * @note This event is raised only for this specific IModelConnection. To monitor *all* IModelConnections, listen for the static `onClose` event instead.\n * @note Be careful not to perform any asynchronous operations on the IModelConnection because it will close before they are processed.\n */\n public readonly onClose = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** The font map for this IModelConnection. Only valid after calling #loadFontMap and waiting for the returned promise to be fulfilled.\n * @deprecated in 5.0.0 - will not be removed until after 2026-06-13. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).\n */\n public fontMap?: FontMap; // eslint-disable-line @typescript-eslint/no-deprecated\n\n private _schemaContext?: SchemaContext;\n\n /** Load the FontMap for this IModelConnection.\n * @returns Returns a Promise<FontMap> that is fulfilled when the FontMap member of this IModelConnection is valid.\n * @deprecated in 5.0.0 - will not be removed until after 2026-06-13. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).\n */\n public async loadFontMap(): Promise<FontMap> { // eslint-disable-line @typescript-eslint/no-deprecated\n if (undefined === this.fontMap) { // eslint-disable-line @typescript-eslint/no-deprecated\n this.fontMap = new FontMap(); // eslint-disable-line @typescript-eslint/no-deprecated\n if (this.isOpen) {\n const fontProps = await IModelReadRpcInterface.getClientForRouting(this.routingContext.token).readFontJson(this.getRpcProps());\n this.fontMap.addFonts(fontProps.fonts); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n }\n return this.fontMap; // eslint-disable-line @typescript-eslint/no-deprecated\n }\n\n /** Find the first registered base class of the given EntityState className. This class will \"handle\" the State for the supplied className.\n * @param className The full name of the class of interest.\n * @param defaultClass If no base class of the className is registered, return this value.\n * @note this method is async since it may have to query the server to get the class hierarchy.\n */\n public async findClassFor<T extends typeof EntityState>(className: string, defaultClass: T | undefined): Promise<T | undefined> {\n let ctor = IModelApp.lookupEntityClass(className) as T | undefined;\n if (undefined !== ctor)\n return ctor;\n\n // it's not registered, we need to query its class hierarchy.\n\n // wait until we get the full list of base classes from backend\n if (this.isOpen) {\n const baseClasses = await IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getClassHierarchy(this.getRpcProps(), className);\n\n // Make sure some other async code didn't register this class while we were await-ing above\n ctor = IModelApp.lookupEntityClass(className) as T | undefined;\n if (undefined !== ctor)\n return ctor;\n\n // walk through the list until we find a registered base class\n baseClasses.some((baseClass: string) => {\n const test = IModelApp.lookupEntityClass(baseClass) as T | undefined;\n if (test === undefined)\n return false; // nope, not registered\n\n ctor = test; // found it, save it\n IModelApp.registerEntityState(className, ctor); // and register the fact that our starting class is handled by this subclass.\n return true; // stop\n });\n }\n return ctor ?? defaultClass; // either the baseClass handler or defaultClass if we didn't find a registered baseClass\n }\n\n /** @internal */\n protected constructor(iModelProps: IModelConnectionProps) {\n super(iModelProps);\n super.initialize(iModelProps.name ?? \"<undefined>\", iModelProps);\n this.models = new IModelConnection.Models(this);\n this.elements = new IModelConnection.Elements(this);\n this.codeSpecs = new IModelConnection.CodeSpecs(this);\n this.views = new IModelConnection.Views(this);\n this.categories = new IModelConnection.Categories(this);\n\n this.selectionSet = new SelectionSet(this);\n this.hilited = new HiliteSet(this);\n\n this.tiles = new Tiles(this);\n this.geoServices = GeoServices.createForIModel(this);\n\n this.hilited.onModelSubCategoryModeChanged.addListener(() => {\n IModelApp.viewManager.onSelectionSetChanged(this);\n });\n }\n\n /** Called prior to connection closing. Raises close events and calls tiles.dispose.\n * @internal\n */\n protected beforeClose(): void {\n this.onClose.raiseEvent(this); // event for this connection\n IModelConnection.onClose.raiseEvent(this); // event for all connections\n this.tiles[Symbol.dispose]();\n this.subcategories.onIModelConnectionClose();\n }\n\n /** Close this IModelConnection. */\n public abstract close(): Promise<void>;\n\n /** Allow to execute query and read results along with meta data. The result are streamed.\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/frontend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/frontend/ECSQLCodeExamples)\n * - [ECSQL Row Format]($docs/learning/ECSQLRowFormat)\n *\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param config Allow to specify certain flags which control how query is executed.\n * @returns Returns an [ECSqlReader]($common) which helps iterate over the result set and also give access to metadata.\n * @public\n * */\n public createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader {\n const executor = {\n execute: async (request: DbQueryRequest) => {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).queryRows(this.getRpcProps(), request);\n },\n };\n return new ECSqlReader(executor, ecsql, params, config);\n }\n\n /**\n * queries the BisCore.SubCategory table for the entries that are children of the passed categoryIds\n * @param compressedCategoryIds compressed category Ids\n * @returns array of SubCategoryResultRow\n * @internal\n */\n public async querySubCategories(compressedCategoryIds: CompressedId64Set): Promise<SubCategoryResultRow[]> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).querySubCategories(this.getRpcProps(), compressedCategoryIds);\n }\n\n /**\n * queries the BisCore.SubCategory table for entries that are children of used spatial categories and 3D elements.\n * @returns array of SubCategoryResultRow\n * @internal\n */\n public async queryAllUsedSpatialSubCategories(): Promise<SubCategoryResultRow[]> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).queryAllUsedSpatialSubCategories(this.getRpcProps());\n }\n\n /** Query for a set of element ids that satisfy the supplied query params\n * @param params The query parameters. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many rows.\n */\n public async queryEntityIds(params: EntityQueryParams): Promise<Id64Set> {\n return new Set(this.isOpen ? await IModelReadRpcInterface.getClientForRouting(this.routingContext.token).queryEntityIds(this.getRpcProps(), params) : undefined);\n }\n\n private _snapRpc = new OneAtATimeAction<SnapResponseProps>(\n async (props: SnapRequestProps) =>\n IModelReadRpcInterface.getClientForRouting(this.routingContext.token).requestSnap(this.getRpcProps(), IModelApp.sessionId, props),\n );\n\n /** Request a snap from the backend.\n * @note callers must gracefully handle Promise rejected with AbandonedError\n * @internal\n */\n public async [_requestSnap](props: SnapRequestProps): Promise<SnapResponseProps> {\n return this.isOpen ? this._snapRpc.request(props) : { status: 2 };\n }\n\n /** @internal\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use AccuSnap.doSnapRequest.\n */\n public async requestSnap(props: SnapRequestProps): Promise<SnapResponseProps> {\n return this[_requestSnap](props);\n }\n\n private _toolTipRpc = new OneAtATimeAction<string[]>(async (id: string) => IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getToolTipMessage(this.getRpcProps(), id));\n /** Request a tooltip from the backend.\n * @note If another call to this method occurs before preceding call(s) return, all preceding calls will be abandoned - only the most recent will resolve. Therefore callers must gracefully handle Promise rejected with AbandonedError.\n */\n public async getToolTipMessage(id: Id64String): Promise<string[]> {\n return this.isOpen ? this._toolTipRpc.request(id) : [];\n }\n\n /** Request element clip containment status from the backend. */\n public async getGeometryContainment(requestProps: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> { return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getGeometryContainment(this.getRpcProps(), requestProps); }\n\n /** Obtain a summary of the geometry belonging to one or more [GeometricElement]($backend)s suitable for debugging and diagnostics.\n * @param requestProps Specifies the elements to query and options for how to format the output.\n * @returns A string containing the summary, typically consisting of multiple lines.\n * @note Trying to parse the output to programmatically inspect an element's geometry is not recommended.\n * @see [GeometryStreamIterator]($common) to more directly inspect a geometry stream.\n */\n public async getGeometrySummary(requestProps: GeometrySummaryRequestProps): Promise<string> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getGeometrySummary(this.getRpcProps(), requestProps);\n }\n\n /** Request a named texture image from the backend.\n * @param textureLoadProps The texture load properties which must contain a name property (a valid 64-bit integer identifier). It optionally can contain the maximum texture size supported by the client.\n * @see [[Id64]]\n * @public\n */\n public async queryTextureData(textureLoadProps: TextureLoadProps): Promise<TextureData | undefined> {\n if (this.isOpen) {\n const rpcClient = IModelReadRpcInterface.getClientForRouting(this.routingContext.token);\n const img = rpcClient.queryTextureData(this.getRpcProps(), textureLoadProps);\n return img;\n }\n return undefined;\n }\n\n /** Request element mass properties from the backend. */\n public async getMassProperties(requestProps: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getMassProperties(this.getRpcProps(), requestProps);\n }\n\n /** Request mass properties for multiple elements from the backend.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[IModelConnection.getMassProperties]].\n */\n public async getMassPropertiesPerCandidate(requestProps: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]> { // eslint-disable-line @typescript-eslint/no-deprecated\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getMassPropertiesPerCandidate(this.getRpcProps(), requestProps);\n }\n\n /** Produce encoded [Polyface]($core-geometry)s from the geometry stream of a [GeometricElement]($backend).\n * A polyface is produced for each geometric entry in the element's geometry stream, excluding geometry like open curves that can't be converted into polyfaces.\n * The polyfaces can be decoded using [readElementMeshes]($common).\n * Symbology, UV parameters, and normal vectors are not included in the result.\n * @param requestProps A description of how to produce the polyfaces and from which element to obtain them.\n * @returns an encoded list of polyfaces that can be decoded by [readElementMeshes]($common).\n * @throws Error if [ElementMeshRequestProps.source]($common) does not refer to a [GeometricElement]($backend).\n * @note This function is intended to support limited analysis of an element's geometry as a mesh. It is not intended for producing graphics.\n * @see [[TileAdmin.requestElementGraphics]] to obtain meshes appropriate for display.\n * @beta\n */\n public async generateElementMeshes(requestProps: ElementMeshRequestProps): Promise<Uint8Array> {\n return IModelReadRpcInterface.getClientForRouting(this.routingContext.token).generateElementMeshes(this.getRpcProps(), requestProps);\n }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection.\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location (Horizontal datum depends on iModel's GCS)\n * @throws IModelError if [[isGeoLocated]] is false or point could not be converted.\n * @see [[cartographicFromSpatial]] if you have more than one point to convert, or you don't know whether the iModel has a GCS.\n */\n public async spatialToCartographicFromGcs(spatial: XYAndZ, result?: Cartographic): Promise<Cartographic> {\n if (!this.isGeoLocated && this.noGcsDefined)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n const geoConverter = expectDefined(this.geoServices.getConverter());\n const coordResponse = await geoConverter.getGeoCoordinatesFromIModelCoordinates([spatial]);\n\n if (1 !== coordResponse.geoCoords.length || GeoCoordStatus.NoGCSDefined === coordResponse.geoCoords[0].s)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (GeoCoordStatus.Success !== coordResponse.geoCoords[0].s) {\n const geoServiceStatus = mapToGeoServiceStatus(coordResponse.geoCoords[0].s);\n throw new IModelError(geoServiceStatus, \"Error converting spatial to cartographic\");\n }\n\n const longLatHeight = Point3d.fromJSON(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...\n return Cartographic.fromDegrees({ longitude: longLatHeight.x, latitude: longLatHeight.y, height: longLatHeight.z }, result);\n }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection or [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location (Horizontal datum depends on iModel's GCS)\n * @throws IModelError if [[isGeoLocated]] is false or point could not be converted.\n * @see [[cartographicFromSpatial]] to convert multiple points at once.\n * @see [[spatialToCartographicFromEcef]] to synchronously convert points using the iModel's ECEF transform.\n */\n public async spatialToCartographic(spatial: XYAndZ, result?: Cartographic): Promise<Cartographic> {\n return (this.noGcsDefined ? this.spatialToCartographicFromEcef(spatial, result) : this.spatialToCartographicFromGcs(spatial, result));\n }\n\n /** Convert points in this iModel's spatial coordinate system to [Cartographic]($common) coordinates using either a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param spatial Coordinates to be converted from the iModel's spatial coordinate system\n * @returns The `spatial` coordinates converted to cartographic coordinates, of the same length and order as the `spatial`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @see [[spatialFromCartographic]] to perform the inverse conversion.\n * @see [[spatialToCartographicFromEcef]] to synchronously convert points using the iModel's ECEF transform.\n */\n public async cartographicFromSpatial(spatial: XYAndZ[]): Promise<Cartographic[]> {\n return this.cartographicFromSpatialWithGcs(spatial);\n }\n\n /** Convert points in this iModel's spatial coordinate system to [Cartographic]($common) coordinates using either a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param spatial Coordinates to be converted from the iModel's spatial coordinate system\n * @returns The `spatial` coordinates converted to cartographic coordinates (WGS84 horizontal datum), of the same length and order as the `spatial`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @see [[cartographicFromSpatial]] to perform conversion using iModel's GCS horizontal datum\n * @beta\n */\n public async wgs84CartographicFromSpatial(spatial: XYAndZ[]): Promise<Cartographic[]> {\n return this.cartographicFromSpatialWithGcs(spatial, \"WGS84\");\n }\n\n /** @internal */\n public async cartographicFromSpatialWithGcs(spatial: XYAndZ[], datumOrGCRS?: string | GeographicCRSProps): Promise<Cartographic[]> {\n if (this.noGcsDefined)\n return spatial.map((p) => this.spatialToCartographicFromEcef(p));\n\n if (!this.isGeoLocated)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (!this.isOpen)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not open\");\n\n if (spatial.length === 0)\n return [];\n\n const geoConverter = this.geoServices.getConverter(datumOrGCRS);\n assert(undefined !== geoConverter);\n\n const coordResponse = await geoConverter.getGeoCoordinatesFromIModelCoordinates(spatial);\n if (coordResponse.geoCoords.length !== spatial.length)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n return coordResponse.geoCoords.map((coord) => {\n switch (coord.s) {\n case GeoCoordStatus.NoGCSDefined:\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n case GeoCoordStatus.Success:\n const llh = Point3d.fromJSON(coord.p);\n return Cartographic.fromDegrees({ longitude: llh.x, latitude: llh.y, height: llh.z });\n default:\n throw new IModelError(mapToGeoServiceStatus(coord.s), \"Error converting spatial to cartographic\");\n }\n });\n }\n\n /** Convert a [Cartographic]($common) to a point in this iModel's spatial coordinate system using a [[GeoConverter]].\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false or cartographic location could not be converted.\n * @see [[spatialFromCartographic]] to convert multiple points at once, or you don't know whether the iModel has a GCS.\n */\n public async cartographicToSpatialFromGcs(cartographic: Cartographic, result?: Point3d): Promise<Point3d> {\n if (!this.isGeoLocated && this.noGcsDefined)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n const geoConverter = expectDefined(this.geoServices.getConverter());\n const geoCoord = Point3d.create(cartographic.longitudeDegrees, cartographic.latitudeDegrees, cartographic.height); // x is longitude in degrees, y is latitude in degrees, z is height in meters...\n const coordResponse = await geoConverter.getIModelCoordinatesFromGeoCoordinates([geoCoord]);\n\n if (1 !== coordResponse.iModelCoords.length || GeoCoordStatus.NoGCSDefined === coordResponse.iModelCoords[0].s)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (GeoCoordStatus.Success !== coordResponse.iModelCoords[0].s) {\n const geoServiceStatus = mapToGeoServiceStatus(coordResponse.iModelCoords[0].s);\n throw new IModelError(geoServiceStatus, \"Error converting cartographic to spatial\");\n }\n\n result = result ? result : Point3d.createZero();\n result.setFromJSON(coordResponse.iModelCoords[0].p);\n return result;\n }\n\n /** Convert a [Cartographic]($common) to a point in this iModel's Spatial coordinates using a [[GeoConverter]] or[[IModel.ecefLocation]($common).\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false or cartographic location could not be converted.\n * @see [[spatialFromCartographic]] to convert multiple points at once.\n * @see [[cartographicToSpatialFromEcef]] to synchronously convert points using the iModel's ECEF transform.\n */\n public async cartographicToSpatial(cartographic: Cartographic, result?: Point3d): Promise<Point3d> {\n return (this.noGcsDefined ? this.cartographicToSpatialFromEcef(cartographic, result) : this.cartographicToSpatialFromGcs(cartographic, result));\n }\n\n /** Convert [Cartographic]($common) coordinates into points in this iModel's spatial coordinate system using a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param cartographic Coordinates to be converted to the iModel's spatial coordinate system.\n * @returns The `cartographic` coordinates converted to spatial coordinates, of the same length and order as `cartographic`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @see [[cartographicFromSpatial]] to perform the inverse conversion.\n */\n public async spatialFromCartographic(cartographic: Cartographic[]): Promise<Point3d[]> {\n if (this.noGcsDefined)\n return cartographic.map((p) => this.cartographicToSpatialFromEcef(p));\n\n const geoCoords = cartographic.map((p) => Point3d.create(p.longitudeDegrees, p.latitudeDegrees, p.height));\n return this.toSpatialFromGcs(geoCoords);\n }\n\n /** Convert geographic coordinates into points in this iModel's spatial coordinate system using a [[GeoConverter]] or the iModel's [EcefLocation]($common).\n * @param geoCoords Coordinates to be converted are in the coordinate system described by the `datumOrGCRS` parameter. Defaults iModel's spatial coordinate system otherwise.\n * @param datumOrGCRS Datum name or Geographic CRS object definition to use for the conversion.\n * @returns The `geographics` coordinates converted to spatial coordinates, of the same length and order as `geographics`.\n * @throws IModelError if [[isGeoLocated]] is false or any point could not be converted.\n * @beta\n */\n public async toSpatialFromGcs(geoCoords: XYAndZ[], datumOrGCRS?: string | GeographicCRSProps): Promise<Point3d[]> {\n\n if (!this.isGeoLocated)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n if (!this.isOpen)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not open\");\n\n if (geoCoords.length === 0)\n return [];\n\n const geoConverter = this.geoServices.getConverter(datumOrGCRS);\n assert(undefined !== geoConverter);\n\n const coordResponse = await geoConverter.getIModelCoordinatesFromGeoCoordinates(geoCoords);\n if (coordResponse.iModelCoords.length !== geoCoords.length)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n\n return coordResponse.iModelCoords.map((coord) => {\n switch (coord.s) {\n case GeoCoordStatus.NoGCSDefined:\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n case GeoCoordStatus.Success:\n return Point3d.fromJSON(coord.p);\n default:\n throw new IModelError(mapToGeoServiceStatus(coord.s), \"Error converting cartographic to spatial\");\n }\n });\n }\n\n /** @internal */\n public getMapEcefToDb(bimElevationBias: number): Transform {\n if (!this.ecefLocation)\n return Transform.createIdentity();\n\n const mapEcefToDb = this.ecefLocation.getTransform().inverse();\n if (!mapEcefToDb) {\n assert(false);\n return Transform.createIdentity();\n }\n mapEcefToDb.origin.z += bimElevationBias;\n\n return mapEcefToDb;\n }\n private _geodeticToSeaLevel?: number | Promise<number>;\n private _projectCenterAltitude?: number | Promise<number>;\n\n /** Event called immediately after map elevation request is completed. This occurs only in the case where background map terrain is displayed\n * with either geoid or ground offset. These require a query to BingElevation and therefore synching the view may be required\n * when the request is completed.\n * @internal\n */\n public readonly onMapElevationLoaded = new BeEvent<(_imodel: IModelConnection) => void>();\n\n /** The offset between sea level and the geodetic ellipsoid. This will return undefined only if the request for the offset to Bing Elevation\n * is required, and in this case the [[onMapElevationLoaded]] event is raised when the request is completed.\n * @internal\n */\n public get geodeticToSeaLevel(): number | undefined {\n if (undefined === this._geodeticToSeaLevel) {\n const elevationProvider = new BingElevationProvider();\n this._geodeticToSeaLevel = elevationProvider.getGeodeticToSeaLevelOffset(this.projectExtents.center, this);\n this._geodeticToSeaLevel.then((geodeticToSeaLevel) => {\n this._geodeticToSeaLevel = geodeticToSeaLevel;\n this.onMapElevationLoaded.raiseEvent(this);\n }).catch((_error) => this._geodeticToSeaLevel = 0.0);\n }\n return (\"number\" === typeof this._geodeticToSeaLevel) ? this._geodeticToSeaLevel : undefined;\n }\n\n /** The altitude (geodetic) at the project center. This will return undefined only if the request for the offset to Bing Elevation\n * is required, and in this case the [[onMapElevationLoaded]] event is raised when the request is completed.\n * @internal\n */\n public get projectCenterAltitude(): number | undefined {\n if (undefined === this._projectCenterAltitude) {\n const elevationProvider = new BingElevationProvider();\n this._projectCenterAltitude = elevationProvider.getHeightValue(this.projectExtents.center, this);\n this._projectCenterAltitude.then((projectCenterAltitude) => {\n this._projectCenterAltitude = projectCenterAltitude;\n this.onMapElevationLoaded.raiseEvent(this);\n }).catch((_error) => this._projectCenterAltitude = 0.0);\n }\n return (\"number\" === typeof this._projectCenterAltitude) ? this._projectCenterAltitude : undefined;\n }\n\n /**\n * Gets the context that allows accessing the metadata (see `@itwin/ecschema-metadata` package) of this iModel.\n * The context is created lazily when this property is accessed for the first time, with an `ECSchemaRpcLocater` registered as a fallback locater, enabling users to register their own locater that'd take more priority.\n * This means to correctly access schema context, client-side applications must register `ECSchemaRpcInterface` following instructions for [RPC configuration]($docs/learning/rpcinterface/#client-side-configuration).\n * Server-side applications would also [configure RPC]($docs/learning/rpcinterface/#server-side-configuration) as needed.\n *\n * @note While a `BlankConnection` returns a valid `schemaContext`, it has an invalid locater registered by default, and will throw an error when trying to call it's methods.\n * @beta\n */\n public get schemaContext(): SchemaContext {\n if (this._schemaContext === undefined) {\n const context = new SchemaContext();\n // While incremental schema loading is the prefered way to load schemas on the frontend, there might be cases where clients\n // would want to use their own locaters, so if incremenal schema loading is disabled, the locater is not registered.\n if(IModelApp.isIncrementalSchemaLoadingEnabled) {\n context.addLocater(new RpcIncrementalSchemaLocater(this._getRpcProps()));\n }\n context.addFallbackLocater(new ECSchemaRpcLocater(this._getRpcProps()));\n this._schemaContext = context;\n }\n\n return this._schemaContext;\n }\n}\n\n/** A connection that exists without an iModel. Useful for connecting to Reality Data services.\n * @note This class exists because our display system requires an IModelConnection type even if only reality data is drawn.\n * @public\n */\nexport class BlankConnection extends IModelConnection {\n public override isBlankConnection(): this is BlankConnection { return true; }\n\n /** The Guid that identifies the iTwin for this BlankConnection.\n * @note This can also be set via the [[create]] method using [[BlankConnectionProps.iTwinId]].\n */\n public override get iTwinId(): GuidString | undefined { return this._iTwinId; }\n public override set iTwinId(iTwinId: GuidString | undefined) { this._iTwinId = iTwinId; }\n /** A BlankConnection does not have an associated iModel, so its `iModelId` is alway `undefined`. */\n public override get iModelId(): undefined { return undefined; } // GuidString | undefined for the superclass, but always undefined for BlankConnection\n\n /** A BlankConnection is always considered closed because it does not have a specific backend nor associated iModel.\n * @returns `true` is always returned since RPC operations and iModel queries are not valid.\n * @note Even though true is always returned, it is still valid to call [[close]] to dispose frontend resources.\n */\n public get isClosed(): boolean { return true; }\n\n /** Create a new [Blank IModelConnection]($docs/learning/frontend/BlankConnection).\n * @param props The properties to use for the new BlankConnection.\n */\n public static create(props: BlankConnectionProps): BlankConnection {\n const connection = new BlankConnection({\n name: props.name,\n rootSubject: { name: props.name },\n projectExtents: props.extents,\n globalOrigin: props.globalOrigin,\n ecefLocation: props.location instanceof Cartographic ? EcefLocation.createFromCartographicOrigin(props.location) : props.location,\n key: \"\",\n iTwinId: props.iTwinId,\n });\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** There are no connections to the backend to close in the case of a BlankConnection.\n * However, there are frontend resources (like the tile cache) that can be disposed.\n * @note A BlankConnection should not be used after calling `close`.\n */\n public async close(): Promise<void> {\n this.beforeClose();\n }\n\n /** @internal */\n public closeSync(): void {\n this.beforeClose();\n }\n}\n\n/** A connection to a [SnapshotDb]($backend) hosted on a backend.\n * @public\n */\nexport class SnapshotConnection extends IModelConnection {\n /** Type guard for instanceof [[SnapshotConnection]] */\n public override isSnapshotConnection(): this is SnapshotConnection { return true; }\n\n /** The Guid that identifies this iModel. */\n public override get iModelId(): GuidString { return expectDefined(super.iModelId); } // GuidString | undefined for the superclass, but required for SnapshotConnection\n\n /** Returns `true` if [[close]] has already been called. */\n public get isClosed(): boolean { return this._isClosed ? true : false; }\n private _isClosed?: boolean;\n\n /** Returns `true` if this is a connection to a remote snapshot iModel resolved by the backend.\n * @see [[openRemote]]\n */\n public get isRemote(): boolean { return this._isRemote ? true : false; }\n private _isRemote?: boolean;\n\n /** Open an IModelConnection to a read-only snapshot iModel from a file name.\n * @note This method is intended for desktop or mobile applications and is not available for web applications.\n */\n public static async openFile(filePath: string): Promise<SnapshotConnection> {\n if (!IpcApp.isValid)\n throw new Error(\"IPC required to open a snapshot\");\n\n Logger.logTrace(loggerCategory, \"SnapshotConnection.openFile\", () => ({ filePath }));\n\n const connectionProps = await IpcApp.appFunctionIpc.openSnapshot(filePath);\n const connection = new SnapshotConnection(connectionProps);\n IModelConnection.onOpen.raiseEvent(connection);\n\n return connection;\n }\n\n /** Open an IModelConnection to a remote read-only snapshot iModel from a key that will be resolved by the backend.\n * @note This method is intended for web applications.\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [[CheckpointConnection.openRemote]].\n */\n public static async openRemote(fileKey: string): Promise<SnapshotConnection> {\n const routingContext = IModelRoutingContext.current || IModelRoutingContext.default;\n RpcManager.setIModel({ iModelId: \"undefined\", key: fileKey });\n\n const openResponse = await SnapshotIModelRpcInterface.getClientForRouting(routingContext.token).openRemote(fileKey); // eslint-disable-line @typescript-eslint/no-deprecated\n Logger.logTrace(loggerCategory, \"SnapshotConnection.openRemote\", () => ({ fileKey }));\n const connection = new SnapshotConnection(openResponse);\n connection.routingContext = routingContext;\n connection._isRemote = true;\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** Close this SnapshotConnection.\n * @note For local snapshot files, `close` closes the connection and the underlying [SnapshotDb]($backend) database file.\n * For remote snapshots, `close` only closes the connection and frees any frontend resources allocated to the connection.\n * @see [[openFile]], [[openRemote]]\n */\n public async close(): Promise<void> {\n if (this.isClosed)\n return;\n\n this.beforeClose();\n try {\n if (!this.isRemote) {\n await IpcApp.appFunctionIpc.closeIModel(this.key);\n }\n } finally {\n this._isClosed = true;\n }\n }\n}\n\n/** @public */\nexport namespace IModelConnection {\n\n /** The id/name/class of a ViewDefinition. Returned by [[IModelConnection.Views.getViewList]] */\n export interface ViewSpec {\n /** The element id of the ViewDefinition. This string may be passed to [[IModelConnection.Views.load]]. */\n id: string;\n /** The name of the view. This string may be used to create a list with the possible view names. */\n name: string;\n /** The fullClassName of the ViewDefinition. Useful for sorting the list of views. */\n class: string;\n }\n\n /** The collection of loaded ModelState objects for an [[IModelConnection]]. */\n export class Models implements Iterable<ModelState> {\n private readonly _modelExtentsQuery = `\n SELECT\n Model.Id AS ECInstanceId,\n iModel_bbox_union(\n iModel_placement_aabb(\n iModel_placement(\n iModel_point(Origin.X, Origin.Y, 0),\n iModel_angles(Rotation, 0, 0),\n iModel_bbox(\n BBoxLow.X, BBoxLow.Y, -1,\n BBoxHigh.X, BBoxHigh.Y, 1\n )\n )\n )\n ) AS bbox\n FROM bis.GeometricElement2d\n WHERE InVirtualSet(:ids64, Model.Id) AND Origin.X IS NOT NULL\n GROUP BY Model.Id\n UNION\n SELECT\n ge.Model.Id AS ECInstanceId,\n iModel_bbox(\n min(i.MinX), min(i.MinY), min(i.MinZ),\n max(i.MaxX), max(i.MaxY), max(i.MaxZ)\n ) AS bbox\n FROM bis.SpatialIndex AS i, bis.GeometricElement3d AS ge, bis.GeometricModel3d AS gm\n WHERE InVirtualSet(:ids64, ge.Model.Id) AND ge.ECInstanceId=i.ECInstanceId AND InVirtualSet(:ids64, gm.ECInstanceId) AND (gm.$->isNotSpatiallyLocated?=false OR gm.$->isNotSpatiallyLocated? IS NULL)\n GROUP BY ge.Model.Id\n UNION\n SELECT\n ge.Model.Id AS ECInstanceId,\n iModel_bbox_union(\n iModel_placement_aabb(\n iModel_placement(\n iModel_point(ge.Origin.X, ge.Origin.Y, ge.Origin.Z),\n iModel_angles(ge.Yaw, ge.Pitch, ge.Roll),\n iModel_bbox(\n ge.BBoxLow.X, ge.BBoxLow.Y, ge.BBoxLow.Z,\n ge.BBoxHigh.X, ge.BBoxHigh.Y, ge.BBoxHigh.Z\n )\n )\n )\n ) AS bbox\n FROM bis.GeometricElement3d AS ge, bis.GeometricModel3d as gm\n WHERE InVirtualSet(:ids64, ge.Model.Id) AND ge.Origin.X IS NOT NULL AND InVirtualSet(:ids64, gm.ECInstanceId) AND gm.$->isNotSpatiallyLocated?=true\n GROUP BY ge.Model.Id`;\n\n private readonly _modelExistenceQuery = `\n WITH\n GeometricModels AS(\n SELECT\n ECInstanceId\n FROM bis.GeometricModel\n WHERE InVirtualSet(: ids64, ECInstanceId)\n )\n SELECT\n ECInstanceId,\n true AS isGeometricModel\n FROM GeometricModels\n UNION ALL\n SELECT\n ECInstanceId,\n false AS isGeometricModel\n FROM bis.Model\n WHERE InVirtualSet(: ids64, ECInstanceId)\n AND ECInstanceId NOT IN(SELECT ECInstanceId FROM GeometricModels)`;\n\n private _loadedExtents: ModelExtentsProps[] = [];\n private _geometryChangedListener?: (changes: readonly ModelIdAndGeometryGuid[]) => void;\n\n private _loaded = new Map<string, ModelState>();\n\n /** @internal */\n public get loaded(): Map<string, ModelState> { return this._loaded; }\n\n /** An iterator over all currently-loaded models. */\n public [Symbol.iterator](): Iterator<ModelState> {\n return this._loaded.values()[Symbol.iterator]();\n }\n\n /** @internal */\n constructor(private _iModel: IModelConnection) {\n IModelConnection.onOpen.addListener(() => {\n if (this._iModel.isBriefcaseConnection()) {\n this._geometryChangedListener = (changes) => {\n this._loadedExtents = this._loadedExtents.filter((extent) => !changes.some((change) => change.id === extent.id));\n };\n\n this._iModel.txns.onModelGeometryChanged.addListener(this._geometryChangedListener);\n }\n });\n\n IModelConnection.onClose.addListener(() => {\n if (this._iModel.isBriefcaseConnection() && this._geometryChangedListener) {\n this._iModel.txns.onModelGeometryChanged.removeListener(this._geometryChangedListener);\n this._geometryChangedListener = undefined;\n }\n });\n }\n\n /** The Id of the [RepositoryModel]($backend). */\n public get repositoryModelId(): string { return \"0x1\"; }\n\n /** @internal */\n public async getDictionaryModel(): Promise<Id64String> {\n const res = await this._iModel.models.queryProps({ from: \"bis.DictionaryModel\", wantPrivate: true });\n if (res.length !== 1 || res[0].id === undefined)\n throw new IModelError(IModelStatus.BadModel, \"bis.DictionaryModel\");\n return res[0].id;\n }\n\n /** Get a batch of [[ModelProps]] given a list of Model ids. */\n public async getProps(modelIds: Id64Arg): Promise<ModelProps[]> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).getModelProps(iModel.getRpcProps(), [...Id64.toIdSet(modelIds)]) : [];\n }\n\n /** Find a ModelState in the set of loaded Models by ModelId. */\n public getLoaded(id: string): ModelState | undefined {\n return this._loaded.get(id);\n }\n\n /** Given a set of modelIds, return the subset of corresponding models that are not currently loaded.\n * @param modelIds The set of model Ids\n * @returns The subset of the supplied Ids corresponding to models that are not currently loaded, or undefined if all of the specified models are loaded.\n */\n public filterLoaded(modelIds: Id64Arg): Id64Set | undefined {\n let unloaded: Set<string> | undefined;\n for (const id of Id64.iterable(modelIds)) {\n if (undefined === this.getLoaded(id)) {\n if (undefined === unloaded)\n unloaded = new Set<string>();\n\n unloaded.add(id);\n }\n }\n\n return unloaded;\n }\n\n /** load a set of Models by Ids. After the returned Promise resolves, you may get the ModelState objects by calling getLoadedModel. */\n public async load(modelIds: Id64Arg): Promise<void> {\n const notLoaded = this.filterLoaded(modelIds);\n if (undefined === notLoaded)\n return; // all requested models are already loaded\n\n try {\n const propArray = await this.getProps(notLoaded);\n await this.updateLoadedWithModelProps(propArray);\n } catch {\n // ignore error, we had nothing to do.\n }\n }\n\n /** Given an array of modelProps, find the class for each model and construct it. save it in the iModelConnection's loaded set. */\n public async updateLoadedWithModelProps(modelProps: ModelProps[]): Promise<void> {\n try {\n for (const props of modelProps) {\n const ctor = await this._iModel.findClassFor(props.classFullName, ModelState);\n if (undefined !== ctor && undefined !== props.id && undefined === this.getLoaded(props.id)) { // do not overwrite if someone else loads it while we await\n const modelState = new ctor(props, this._iModel); // create a new instance of the appropriate ModelState subclass\n this._loaded.set(modelState.id, modelState); // save it in loaded set\n }\n }\n } catch {\n // ignore error, we had nothing to do.\n }\n }\n\n /** Remove a model from the set of loaded models. Used internally by BriefcaseConnection in response to txn events.\n * @internal\n */\n public unload(modelId: Id64String): void {\n this._loaded.delete(modelId);\n }\n\n /** Query for a set of model ranges by ModelIds.\n * @param modelIds the Id or Ids of the [GeometricModel]($backend)s for which to query the ranges.\n * @returns An array containing the range of each model of each unique model Id, omitting the range for any Id which did no identify a GeometricModel.\n * @note The contents of the returned array do not follow a deterministic order.\n * @throws [IModelError]($common) if exactly one model Id is specified and that Id does not identify a GeometricModel.\n * @see [[queryExtents]] for a similar function that does not throw and produces a deterministically-ordered result.\n */\n public async queryModelRanges(modelIds: Id64Arg): Promise<Range3dProps[]> {\n const results = await this.queryExtents([...Id64.toIdSet(modelIds)]);\n\n if (results.length === 1 && results[0].status !== IModelStatus.Success) {\n throw new IModelError(results[0].status, \"error querying model range\");\n }\n\n return results.filter((x) => x.status === IModelStatus.Success).map((x) => x.extents);\n }\n\n /** For each [GeometricModel]($backend) specified by Id, attempts to obtain the union of the volumes of all geometric elements within that model.\n * @param modelIds The Id or Ids of the geometric models for which to obtain the extents.\n * @returns An array of results, one per supplied Id, in the order in which the Ids were supplied. If the extents could not be obtained, the\n * corresponding results entry's `extents` will be a \"null\" range (@see [Range3d.isNull]($geometry) and its `status` will indicate\n * why the extents could not be obtained (e.g., because the Id did not identify a [GeometricModel]($backend)).\n */\n public async queryExtents(modelIds: Id64String | Id64String[]): Promise<ModelExtentsProps[]> {\n if (!this._iModel.isOpen)\n return [];\n\n if (typeof modelIds === \"string\")\n modelIds = [modelIds];\n\n const modelExtents: ModelExtentsProps[] = [];\n\n for (const modelId of modelIds) {\n if (!Id64.isValidId64(modelId)) {\n modelExtents.push({ id: modelId, extents: Range3d.createNull(), status: IModelStatus.InvalidId });\n }\n }\n\n const getUnloadedModelIds = () => modelIds.filter((modelId) => !modelExtents.some((loadedExtent) => loadedExtent.id === modelId));\n\n let remainingModelIds = getUnloadedModelIds();\n for (const modelId of remainingModelIds) {\n const modelExtent = this._loadedExtents.find((extent) => modelId === extent.id);\n if (modelExtent) {\n modelExtents.push(modelExtent);\n }\n }\n\n remainingModelIds = getUnloadedModelIds();\n if (remainingModelIds.length > 0) {\n const params = new QueryBinder();\n params.bindIdSet(\"ids64\", remainingModelIds);\n\n const extentsQueryReader = this._iModel.createQueryReader(this._modelExtentsQuery, params, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n });\n\n for await (const row of extentsQueryReader) {\n const byteArray = new Uint8Array(Object.values(row.bbox));\n const extents = Range3d.fromArrayBuffer(byteArray.buffer);\n\n const extent = { id: row.ECInstanceId, extents, status: IModelStatus.Success };\n modelExtents.push(extent);\n this._loadedExtents.push(extent);\n }\n }\n\n remainingModelIds = getUnloadedModelIds();\n if (remainingModelIds.length > 0) {\n const params = new QueryBinder();\n params.bindIdSet(\"ids64\", remainingModelIds);\n\n const modelExistenceQueryReader = this._iModel.createQueryReader(this._modelExistenceQuery, params, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n });\n\n for await (const row of modelExistenceQueryReader) {\n let extent: ModelExtentsProps;\n if (row.isGeometricModel) {\n extent = { id: row.ECInstanceId, extents: Range3d.createNull(), status: IModelStatus.Success };\n } else {\n extent = { id: row.ECInstanceId, extents: Range3d.createNull(), status: IModelStatus.WrongModel };\n }\n modelExtents.push(extent);\n this._loadedExtents.push(extent);\n }\n }\n\n return modelIds.map((modelId) => {\n let extent = modelExtents.find((loadedExtent) => loadedExtent.id === modelId);\n\n if (extent === undefined) {\n extent = { id: modelId, extents: Range3d.createNull(), status: IModelStatus.NotFound };\n this._loadedExtents.push(extent);\n return extent;\n } else if (extent.status === IModelStatus.InvalidId) {\n extent.id = \"0\";\n return extent;\n }\n\n return extent;\n });\n }\n\n /** Query for a set of ModelProps of the specified ModelQueryParams.\n * @param queryParams The query parameters. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async queryProps(queryParams: ModelQueryParams): Promise<ModelProps[]> {\n const iModel = this._iModel;\n if (!iModel.isOpen)\n return [];\n const params: ModelQueryParams = { ...queryParams }; // make a copy\n params.from = queryParams.from || ModelState.classFullName; // use \"BisCore:Model\" as default class name\n params.where = queryParams.where || \"\";\n if (!queryParams.wantPrivate) {\n if (params.where.length > 0)\n params.where += \" AND \";\n\n params.where += \"IsPrivate=FALSE \";\n }\n if (!queryParams.wantTemplate) {\n if (params.where.length > 0)\n params.where += \" AND \";\n\n params.where += \"IsTemplate=FALSE \";\n }\n return IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).queryModelProps(iModel.getRpcProps(), params);\n }\n\n /** Asynchronously stream ModelProps using the specified ModelQueryParams. */\n public async * query(queryParams: ModelQueryParams): AsyncIterableIterator<ModelProps> {\n // NOTE: this implementation has the desired API signature, but its implementation must be improved to actually page results\n const modelPropsArray: ModelProps[] = await this.queryProps(queryParams);\n for (const modelProps of modelPropsArray) {\n yield modelProps;\n }\n }\n }\n\n /** Options controlling the results produced by [[IModelConnection.Elements.getPlacements]].\n * @public\n */\n export interface GetPlacementsOptions {\n /** The types of elements for which to query [Placement]($common)s:\n * - \"2d\": Include only [GeometricElement2d]($backend)s.\n * - \"3d\": Include only [GeometricElement3d]($backend)s.\n * - `undefined`: Include both 2d and 3d [GeometricElement]($backend)s.\n */\n type?: \"3d\" | \"2d\";\n }\n\n /** The collection of Elements for an [[IModelConnection]]. */\n export class Elements {\n /** @internal */\n public constructor(private _iModel: IModelConnection) { }\n\n /** The Id of the [root subject element]($docs/bis/guide/references/glossary.md#subject-root) for this iModel. */\n public get rootSubjectId(): Id64String { return \"0x1\"; }\n\n /** Get a set of element ids that satisfy a query */\n public async queryIds(params: EntityQueryParams): Promise<Id64Set> { return this._iModel.queryEntityIds(params); }\n\n /** Get an array of [[ElementProps]] given one or more element ids.\n * @note This method returns **all** of the properties of the element (excluding GeometryStream), which may be a very large amount of data - consider using\n * [[IModelConnection.query]] to select only those properties of interest to limit the amount of data returned.\n */\n public async getProps(arg: Id64Arg): Promise<ElementProps[]> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).getElementProps(this._iModel.getRpcProps(), [...Id64.toIdSet(arg)]) : [];\n }\n\n /** Obtain the properties of a single element, optionally specifying specific properties to include or exclude.\n * For example, [[getProps]] and [[queryProps]] omit the [GeometryStreamProps]($common) property of [GeometricElementProps]($common) and [GeometryPartProps]($common)\n * because it can be quite large and is generally not useful to frontend code. The following code requests that the geometry stream be included:\n * ```ts\n * const props = await iModel.elements.loadProps(elementId, { wantGeometry: true });\n * ```\n * @param identifier Identifies the element by its Id, federation Guid, or [Code]($common).\n * @param options Optionally includes or excludes specific properties.\n * @returns The properties of the requested element; or `undefined` if no element exists with the specified identifier or the iModel is not open.\n * @throws [IModelError]($common) if the element exists but could not be loaded.\n */\n public async loadProps(identifier: Id64String | GuidString | CodeProps, options?: ElementLoadOptions): Promise<ElementProps | undefined> {\n const imodel = this._iModel;\n return imodel.isOpen ? IModelReadRpcInterface.getClientForRouting(imodel.routingContext.token).loadElementProps(imodel.getRpcProps(), identifier, options) : undefined;\n }\n\n /** Get an array of [[ElementProps]] that satisfy a query\n * @param params The query parameters. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async queryProps(params: EntityQueryParams): Promise<ElementProps[]> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).queryElementProps(iModel.getRpcProps(), params) : [];\n }\n\n /** Obtain the [Placement]($common)s of a set of [GeometricElement]($backend)s.\n * @param elementIds The Ids of the elements whose placements are to be queried.\n * @param options Options customizing how the placements are queried.\n * @returns an array of placements, each having an additional `elementId` property identifying the element from which the placement was obtained.\n * @note Any Id that does not identify a geometric element with a valid bounding box and origin is omitted from the returned array.\n */\n public async getPlacements(elementIds: Iterable<Id64String>, options?: Readonly<GetPlacementsOptions>): Promise<Array<Placement & { elementId: Id64String }>> {\n let ids: Id64String[];\n if (typeof elementIds === \"string\")\n ids = [elementIds];\n else if (!Array.isArray(elementIds))\n ids = Array.from(elementIds);\n else\n ids = elementIds;\n\n if (ids.length === 0)\n return [];\n\n const select3d = `\n SELECT\n ECInstanceId,\n Origin.x as x, Origin.y as y, Origin.z as z,\n BBoxLow.x as lx, BBoxLow.y as ly, BBoxLow.z as lz,\n BBoxHigh.x as hx, BBoxHigh.y as hy, BBoxHigh.z as hz,\n Yaw, Pitch, Roll,\n NULL as Rotation\n FROM bis.GeometricElement3d\n WHERE Origin IS NOT NULL AND BBoxLow IS NOT NULL AND BBoxHigh IS NOT NULL`;\n\n // Note: For the UNION ALL statement, the column aliases in select2d are ignored - so they\n // must match those in select3d.\n const select2d = `\n SELECT\n ECInstanceId,\n Origin.x as x, Origin.y as y, NULL as z,\n BBoxLow.x as lx, BBoxLow.y as ly, NULL as lz,\n BBoxHigh.x as hx, BBoxHigh.y as hy, NULL as hz,\n NULL as yaw, NULL as pitch, NULL as roll,\n Rotation\n FROM bis.GeometricElement2d\n WHERE Origin IS NOT NULL AND BBoxLow IS NOT NULL AND BBoxHigh IS NOT NULL`;\n\n const idCriterion = `ECInstanceId IN (${ids.join(\",\")})`;\n\n let ecsql;\n switch (options?.type) {\n case \"3d\":\n ecsql = `${select3d} AND ${idCriterion}`;\n break;\n case \"2d\":\n ecsql = `${select2d} AND ${idCriterion}`;\n break;\n default:\n ecsql = `\n SELECT * FROM (\n ${select3d}\n UNION ALL\n ${select2d}\n ) WHERE ${idCriterion}`;\n break;\n }\n\n const placements = new Array<Placement & { elementId: Id64String }>();\n for await (const queryRow of this._iModel.createQueryReader(ecsql, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames })) {\n const row = queryRow.toRow();\n const origin = [row.x, row.y, row.z];\n const bbox = {\n low: { x: row.lx, y: row.ly, z: row.lz },\n high: { x: row.hx, y: row.hy, z: row.hz },\n };\n\n let placement;\n if (undefined === row.lz)\n placement = Placement2d.fromJSON({ bbox, origin, angle: row.rotation });\n else\n placement = Placement3d.fromJSON({ bbox, origin, angles: { yaw: row.yaw, pitch: row.pitch, roll: row.roll } });\n\n const placementWithId = (placement as Placement & { elementId: Id64String });\n placementWithId.elementId = row.id;\n placements.push(placementWithId);\n }\n\n return placements;\n }\n }\n\n /** The collection of [[CodeSpec]] entities for an [[IModelConnection]]. */\n export class CodeSpecs {\n /** @internal */\n constructor(private _iModel: IModelConnection) { }\n\n private _isCodeSpecProperties(x: any): x is CodeSpecProperties {\n if (!x || !x.scopeSpec || !Object.values(CodeScopeSpec.Type).includes(x.scopeSpec.type))\n return false;\n\n if (typeof x.scopeSpec.fGuidRequired !== \"boolean\" && typeof x.scopeSpec.fGuidRequired !== \"undefined\")\n return false;\n\n if (typeof x.scopeSpec.relationship !== \"string\" && typeof x.scopeSpec.relationship !== \"undefined\")\n return false;\n\n if (typeof x.spec?.isManagedWithDgnDb !== \"boolean\" && typeof x.spec?.isManagedWithDgnDb !== \"undefined\")\n return false;\n\n if (typeof x.version !== \"string\" && typeof x.version !== \"undefined\")\n return false;\n\n return true;\n }\n\n private async _loadCodeSpec(identifier: { name: string; id?: undefined } | { id: string; name?: undefined }): Promise<CodeSpec> {\n const isNameDefined = identifier.name !== undefined;\n const query = `\n SELECT ECInstanceId AS Id, Name, JsonProperties\n FROM BisCore.CodeSpec\n WHERE ${isNameDefined ? `Name=:name` : `Id=:id`}`;\n\n const params = new QueryBinder();\n if (isNameDefined) {\n params.bindString(\"name\", identifier.name);\n } else {\n params.bindId(\"id\", identifier.id);\n }\n\n const queryReader = this._iModel.createQueryReader(query, params, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n });\n\n const queryResult = await queryReader.next();\n\n if (queryResult.done) throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\");\n\n const codeSpecResult = queryResult.value;\n\n if (\n typeof codeSpecResult.Id !== \"string\" ||\n typeof codeSpecResult.Name !== \"string\" ||\n typeof codeSpecResult.JsonProperties !== \"string\"\n )\n throw new Error(\"Invalid CodeSpec was returned\");\n\n const jsonProperties = JSON.parse(codeSpecResult.JsonProperties);\n\n if (!this._isCodeSpecProperties(jsonProperties))\n throw new Error(\"Invalid CodeSpecProperties returned in the CodeSpec\");\n\n const codeSpec = CodeSpec.createFromJson(\n this._iModel,\n Id64.fromString(codeSpecResult.Id),\n codeSpecResult.Name,\n jsonProperties\n );\n return codeSpec;\n }\n\n /** Look up a CodeSpec by Id.\n * @param codeSpecId The Id of the CodeSpec to load\n * @returns The CodeSpec with the specified Id\n * @throws [[IModelError]] if the Id is invalid or if no CodeSpec with that Id could be found.\n */\n public async getById(codeSpecId: Id64String): Promise<CodeSpec> {\n if (codeSpecId === \"\") throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\");\n if (!Id64.isValid(codeSpecId))\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\", () => ({ codeSpecId }));\n\n return this._loadCodeSpec({ id: codeSpecId });\n }\n\n /** Look up a CodeSpec by name.\n * @param name The name of the CodeSpec to load\n * @returns The CodeSpec with the specified name\n * @throws [[IModelError]] if no CodeSpec with the specified name could be found.\n */\n public async getByName(name: string): Promise<CodeSpec> {\n if (name === \"\") throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\");\n\n return this._loadCodeSpec({ name });\n }\n }\n\n /** The collection of views for an [[IModelConnection]]. */\n export class Views {\n /** @internal */\n constructor(private _iModel: IModelConnection) { }\n private _writeViewStoreProxy?: PickAsyncMethods<ViewStoreRpc.Writer>;\n private _readViewStoreProxy?: PickAsyncMethods<ViewStoreRpc.Reader>;\n\n public get viewStoreWriter() {\n return this._writeViewStoreProxy ??= new Proxy(this, {\n get(views, methodName: string) {\n const iModel = views._iModel;\n return async (...args: any[]) => IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).callViewStore(iModel.getRpcProps(), ViewStoreRpc.version, true, methodName, ...args);\n },\n }) as unknown as PickAsyncMethods<ViewStoreRpc.Writer>;\n }\n public get viewsStoreReader() {\n return this._readViewStoreProxy ??= new Proxy(this, {\n get(views, methodName: string) {\n const iModel = views._iModel;\n return async (...args: any[]) => IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).callViewStore(iModel.getRpcProps(), ViewStoreRpc.version, false, methodName, ...args);\n },\n }) as unknown as PickAsyncMethods<ViewStoreRpc.Reader>;\n }\n\n /** Query for an array of ViewDefinitionProps\n * @param queryParams Query parameters specifying the views to return. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async queryProps(queryParams: ViewQueryParams): Promise<ViewDefinitionProps[]> {\n const iModel = this._iModel;\n if (iModel.isClosed)\n return [];\n\n const params: ViewQueryParams = { ...queryParams }; // make a copy\n params.from = queryParams.from || ViewState.classFullName; // use \"BisCore:ViewDefinition\" as default class name\n params.where = queryParams.where || \"\";\n if (queryParams.wantPrivate === undefined || !queryParams.wantPrivate) {\n if (params.where.length > 0)\n params.where += \" AND \";\n\n params.where += \"IsPrivate=FALSE \";\n }\n const viewProps = await IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).queryElementProps(iModel.getRpcProps(), params);\n assert((viewProps.length === 0) || (\"categorySelectorId\" in viewProps[0]), \"invalid view definition\"); // spot check that the first returned element is-a ViewDefinitionProps\n return viewProps as ViewDefinitionProps[];\n }\n\n /** Get an array of the ViewSpecs for all views in this IModel that satisfy a ViewQueryParams.\n *\n * This is typically used to create a list for UI.\n *\n * For example:\n * ```ts\n * [[include:IModelConnection.Views.getSpatialViewList]]\n * ```\n * @param queryParams The parameters for the views to find. The `limit` and `offset` members should be used to page results.\n * @throws [IModelError]($common) If the generated statement is invalid or would return too many props.\n */\n public async getViewList(queryParams: ViewQueryParams): Promise<ViewSpec[]> {\n const views: ViewSpec[] = [];\n const viewProps: ViewDefinitionProps[] = await this.queryProps(queryParams);\n viewProps.forEach((viewProp) => {\n views.push({ id: viewProp.id as string, name: viewProp.code.value ?? \"\", class: viewProp.classFullName });\n });\n\n return views;\n }\n\n /** Query the Id of the default [ViewDefinition]($backend), if any, stored in this iModel's property table.\n * The default view is typically chosen by the application (such as a connector) that created the iModel.\n * There is no guarantee that this view will be suitable for the purposes of any other applications.\n * Most applications should ignore the default view and instead create a [[ViewState]] that fits their own requirements using APIs like [[ViewCreator3d]].\n * @returns the Id of the default view as defined in the iModel's property table, or an invalid ID if no default view is defined.\n * @deprecated in 4.2 - will not be removed until after 2026-06-13. Create a ViewState to your own specifications.\n */\n public async queryDefaultViewId(): Promise<Id64String> {\n const iModel = this._iModel;\n return iModel.isOpen ? IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token).getDefaultViewId(iModel.getRpcProps()) : Id64.invalid;\n }\n\n /** Load a [[ViewState]] object from the specified [[ViewDefinition]] id. */\n public async load(viewDefinitionId: ViewIdString): Promise<ViewState> {\n const options: ViewStateLoadProps = {\n displayStyle: {\n omitScheduleScriptElementIds: !IModelApp.tileAdmin.enableFrontendScheduleScripts,\n compressExcludedElementIds: true,\n },\n };\n const viewProps = await IModelReadRpcInterface.getClientForRouting(this._iModel.routingContext.token).getViewStateData(this._iModel.getRpcProps(), viewDefinitionId, options);\n const viewState = await this.convertViewStatePropsToViewState(viewProps);\n return viewState;\n }\n\n /** Return the [[ViewState]] object associated with the [[ViewStateProps]] passed in. */\n public async convertViewStatePropsToViewState(viewProps: ViewStateProps): Promise<ViewState> {\n const className = viewProps.viewDefinitionProps.classFullName;\n const ctor = await this._iModel.findClassFor<typeof EntityState>(className, undefined) as typeof ViewState | undefined;\n\n if (undefined === ctor)\n throw new IModelError(IModelStatus.WrongClass, \"Invalid ViewState class\", () => viewProps);\n\n const viewState = expectDefined(ctor.createFromProps(viewProps, this._iModel));\n await viewState.load(); // loads models for ModelSelector\n\n return viewState;\n }\n }\n\n /** @public */\n export namespace Categories {\n /** A subset of the information describing a [SubCategory]($backend), supplied by [[IModelConnection.Categories.getCategoryInfo]]\n * or [[IModelConnection.Categories.getSubCategoryInfo]].\n */\n export interface SubCategoryInfo {\n /** The [SubCategory]($backend)'s element Id. */\n readonly id: Id64String;\n /** The Id of the [Category]($backend) to which this [SubCategory]($backend) belongs. */\n readonly categoryId: Id64String;\n /** Visual parameters applied to geometry belonging to this [SubCategory]($backend). */\n readonly appearance: Readonly<SubCategoryAppearance>;\n }\n\n /** A subset of the information describing a [Category]($backend), supplied by [[IModelConnection.Categories.getCategoryInfo]]. */\n export interface CategoryInfo {\n /** The category's element Id. */\n readonly id: Id64String;\n /** For each [SubCategory]($backend) belonging to this [Category]($backend), a mapping from the SubCategory's element Id to its properties. */\n readonly subCategories: Map<Id64String, SubCategoryInfo>;\n }\n }\n\n /** Provides access to information about the [Category]($backend)'s stored in an [[IModelConnection]].\n * This information is cached internally so that repeated requests need not query the backend.\n * @see [[IModelConnection.categories]] for the categories associated with a specific iModel.\n */\n export class Categories {\n /** @internal */\n public readonly cache: SubCategoriesCache;\n\n /** @internal */\n public constructor(iModel: IModelConnection) {\n this.cache = new SubCategoriesCache(iModel);\n }\n\n /** Obtain information about one or more [Category]($backend)'s. */\n public async getCategoryInfo(categoryIds: Iterable<Id64String>): Promise<Map<Id64String, Categories.CategoryInfo>> {\n return this.cache.getCategoryInfo(categoryIds);\n }\n\n /** Obtain information about one or more [SubCategory]($backend)'s belonging to the specified [Category]($backend). */\n public async getSubCategoryInfo(args: {\n category: Id64String;\n subCategories: Iterable<Id64String>;\n }): Promise<Map<Id64String, Categories.SubCategoryInfo>> {\n return this.cache.getSubCategoryInfo(args.category, args.subCategories);\n }\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Views
3
3
  */
4
- import { Id64Array, Id64String } from "@itwin/core-bentley";
4
+ import { BeEvent, Id64Array, Id64String } from "@itwin/core-bentley";
5
5
  import { Point2d, Point3d, Range3d, Transform } from "@itwin/core-geometry";
6
6
  import { AxisAlignedBox3d, HydrateViewStateRequestProps, HydrateViewStateResponseProps, SheetProps, ViewAttachmentProps, ViewDefinition2dProps, ViewStateProps } from "@itwin/core-common";
7
7
  import { CategorySelectorState } from "./CategorySelectorState";
@@ -20,17 +20,19 @@ import { DisclosedTileTreeSet } from "./tile/internal";
20
20
  export declare class SheetViewState extends ViewState2d {
21
21
  /** The width and height of the sheet in world coordinates. */
22
22
  readonly sheetSize: Point2d;
23
- private _attachmentsInfo;
24
- private _attachments?;
23
+ private _viewAttachments;
25
24
  private readonly _viewedExtents;
26
- get attachmentIds(): Id64Array;
25
+ private _onViewAttachmentsReloaded;
26
+ /** Strictly for tests. */
27
+ readonly onViewAttachmentsReloaded: BeEvent<() => void>;
28
+ get attachmentIds(): readonly string[];
27
29
  static get className(): string;
28
30
  static createFromProps(viewStateData: ViewStateProps, iModel: IModelConnection): SheetViewState;
29
31
  toProps(): ViewStateProps;
30
32
  /** Strictly for testing. @internal */
31
33
  get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>>;
32
34
  /** Strictly for testing. @internal */
33
- get viewAttachmentInfos(): Id64Array | Array<{
35
+ get viewAttachmentInfos(): readonly Id64String[] | Array<{
34
36
  attachedView: ViewState;
35
37
  }>;
36
38
  /** Strictly for testing. @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"SheetViewState.d.ts","sourceRoot":"","sources":["../../src/SheetViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAqD,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/G,OAAO,EAAoD,OAAO,EAAE,OAAO,EAA4B,OAAO,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvK,OAAO,EACL,gBAAgB,EAAiF,4BAA4B,EAAE,6BAA6B,EAAmC,UAAU,EACpL,mBAAmB,EAAE,qBAAqB,EAAqB,cAAc,E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