@itwin/linear-referencing-backend 5.10.0-dev.1 → 5.10.0-dev.10

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,23 @@
1
1
  # Change Log - @itwin/linear-referencing-backend
2
2
 
3
- This log was last generated on Thu, 23 Apr 2026 18:06:53 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 08 May 2026 20:37:55 GMT and should not be manually modified.
4
+
5
+ ## 5.9.2
6
+ Fri, 08 May 2026 20:36:41 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.9.1
11
+ Tue, 05 May 2026 17:43:30 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 5.9.0
16
+ Mon, 04 May 2026 16:32:08 GMT
17
+
18
+ ### Updates
19
+
20
+ - added EditTxn apis
4
21
 
5
22
  ## 5.8.4
6
23
  Thu, 23 Apr 2026 18:05:14 GMT
@@ -39,7 +39,7 @@ export declare class LinearlyReferencedAtLocation extends LinearlyReferencedLoca
39
39
  */
40
40
  static insert(txn: EditTxn, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
41
41
  /** Insert a new aspect.
42
- * @deprecated Use LinearlyReferencedAtLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
42
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyReferencedAtLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
43
43
  */
44
44
  static insert(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
45
45
  }
@@ -61,7 +61,7 @@ export declare class LinearlyReferencedFromToLocation extends LinearlyReferenced
61
61
  */
62
62
  static insert(txn: EditTxn, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
63
63
  /** Insert a new aspect.
64
- * @deprecated Use LinearlyReferencedFromToLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
64
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyReferencedFromToLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
65
65
  */
66
66
  static insert(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
67
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LinearReferencingElementAspects.d.ts","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EACL,uBAAuB,EAAE,uCAAuC,EAAE,2CAA2C,EAC9G,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4CAA4C,EAAE,8CAA8C,EAAE,4CAA4C,EAC3I,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,qBAAa,kBAAmB,YAAW,uBAAuB;IACzD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,yBAAyB,CAAC,EAAE,MAAM,CAAC;gBAE9B,KAAK,EAAE,uBAAuB;WAO5B,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,kBAAkB;CAC1E;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,kBAAkB;IAChE,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAyC;CACxF;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,0BAA0B;IAC1E,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,C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EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI;IAEjH;;OAEG;WACW,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EACjE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI;CAYlH"}
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.LinearlyReferencedFromToLocation = exports.LinearlyReferencedAtLocation = exports.LinearlyReferencedLocation = exports.DistanceExpression = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_backend_1 = require("@itwin/core-backend");
13
- const Symbols_1 = require("@itwin/core-backend/lib/cjs/internal/Symbols");
14
13
  const core_common_1 = require("@itwin/core-common");
15
14
  const LinearReferencingRelationships_1 = require("./LinearReferencingRelationships");
16
15
  /** Core structure carrying linearly-referenced information.
@@ -64,8 +63,13 @@ class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
64
63
  return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);
65
64
  }
66
65
  static insert(txnOrIModel, locatedElementId, at, fromReferentId) {
67
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
68
- txn.insertAspect(this.toProps(locatedElementId, at, fromReferentId));
66
+ const aspectProps = this.toProps(locatedElementId, at, fromReferentId);
67
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
68
+ txnOrIModel.insertAspect(aspectProps);
69
+ else {
70
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
71
+ txnOrIModel.elements.insertAspect(aspectProps);
72
+ }
69
73
  }
70
74
  }
71
75
  exports.LinearlyReferencedAtLocation = LinearlyReferencedAtLocation;
@@ -101,8 +105,13 @@ class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {
101
105
  return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);
102
106
  }
103
107
  static insert(txnOrIModel, locatedElementId, from, to, fromReferentId, toReferentId) {
104
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
105
- txn.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));
108
+ const aspectProps = this.toProps(locatedElementId, from, to, fromReferentId, toReferentId);
109
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
110
+ txnOrIModel.insertAspect(aspectProps);
111
+ else {
112
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
113
+ txnOrIModel.elements.insertAspect(aspectProps);
114
+ }
106
115
  }
107
116
  }
108
117
  exports.LinearlyReferencedFromToLocation = LinearlyReferencedFromToLocation;
@@ -1 +1 @@
1
- {"version":3,"file":"LinearReferencingElementAspects.js","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,sDAA4E;AAC5E,0EAA4E;AAC5E,oDAAoD;AAIpD,qFAE0C;AAE1C;;GAEG;AACH,MAAa,kBAAkB;IACtB,sBAAsB,CAAS;IAC/B,+BAA+B,CAAU;IACzC,gCAAgC,CAAU;IAC1C,yBAAyB,CAAU;IAE1C,YAAY,KAA8B;QACxC,IAAI,CAAC,sBAAsB,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC/E,IAAI,CAAC,+BAA+B,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACjG,IAAI,CAAC,gCAAgC,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC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EAAE,cAA2B,EAAE,YAAyB;QACxG,MAAM,KAAK,GAAgD;YACzD,aAAa,EAAE,gCAAgC,CAAC,aAAa;YAC7D,OAAO,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE;YACjC,YAAY,EAAE,IAAI;YAClB,wBAAwB,EAAE,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,+EAA8C,CAAC,cAAc,CAAC;YACzI,UAAU,EAAE,EAAE;YACd,sBAAsB,EAAE,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,6EAA4C,CAAC,YAAY,CAAC;SAClI,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,MAAgB,EAAE,gBAA4B,EACjE,IAAwB,EAAE,EAAsB,EAAE,cAA2B,EAAE,YAAyB;QACxG,OAAO,IAAI,gCAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9H,CAAC;IAcM,MAAM,CAAC,MAAM,CAAC,WAA+B,EAAE,gBAA4B,EAChF,IAAwB,EAAE,EAAsB,EAAE,cAA2B,EAAE,YAAyB;QACxG,MAAM,GAAG,GAAG,WAAW,YAAY,sBAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,sBAAY,CAAC,CAAC;QACrF,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;IAC3F,CAAC;CACF;AArDD,4EAqDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LinearReferencing\r\n */\r\n\r\nimport { Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { EditTxn, ElementMultiAspect, IModelDb } from \"@itwin/core-backend\";\r\nimport { _implicitTxn } from \"@itwin/core-backend/lib/cjs/internal/Symbols\";\r\nimport { RelatedElement } from \"@itwin/core-common\";\r\nimport {\r\n DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps,\r\n} from \"@itwin/linear-referencing-common\";\r\nimport {\r\n LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent,\r\n} from \"./LinearReferencingRelationships\";\r\n\r\n/** Core structure carrying linearly-referenced information.\r\n * @beta\r\n */\r\nexport class DistanceExpression implements DistanceExpressionProps {\r\n public distanceAlongFromStart: number;\r\n public lateralOffsetFromILinearElement?: number;\r\n public verticalOffsetFromILinearElement?: number;\r\n public distanceAlongFromReferent?: number;\r\n\r\n constructor(props: DistanceExpressionProps) {\r\n this.distanceAlongFromStart = JsonUtils.asDouble(props.distanceAlongFromStart);\r\n this.lateralOffsetFromILinearElement = JsonUtils.asDouble(props.lateralOffsetFromILinearElement);\r\n this.verticalOffsetFromILinearElement = JsonUtils.asDouble(props.verticalOffsetFromILinearElement);\r\n this.distanceAlongFromReferent = JsonUtils.asDouble(props.distanceAlongFromReferent);\r\n }\r\n\r\n public static fromJSON(json: DistanceExpressionProps): DistanceExpression { return new DistanceExpression(json); }\r\n}\r\n\r\n/** Base class for multi-aspects carrying linearly-referenced locations.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedLocation extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedLocation\"; }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedAtLocation\"; }\r\n\r\n public atPosition: DistanceExpression;\r\n public fromReferent?: LinearlyReferencedAtPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.atPosition = DistanceExpression.fromJSON(props.atPosition);\r\n this.fromReferent = RelatedElement.fromJSON(props.fromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocationAspectProps {\r\n const props: LinearlyReferencedAtLocationAspectProps = {\r\n classFullName: LinearlyReferencedAtLocation.classFullName,\r\n element: { id: locatedElementId },\r\n atPosition: at,\r\n fromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedAtPositionRefersToReferent(fromReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation {\r\n return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);\r\n }\r\n\r\n /** Insert a new aspect using an explicit transaction.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void;\r\n\r\n /** Insert a new aspect.\r\n * @deprecated Use LinearlyReferencedAtLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\r\n */\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void;\r\n\r\n public static insert(txnOrIModel: EditTxn | IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n txn.insertAspect(this.toProps(locatedElementId, at, fromReferentId));\r\n }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedFromToLocation\"; }\r\n\r\n public fromPosition: DistanceExpression;\r\n public fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;\r\n public toPosition: DistanceExpression;\r\n public toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);\r\n this.toPosition = DistanceExpression.fromJSON(props.toPosition);\r\n this.fromPositionFromReferent = RelatedElement.fromJSON(props.fromPositionFromReferent);\r\n this.toPositionFromReferent = RelatedElement.fromJSON(props.toPositionFromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocationAspectProps {\r\n const props: LinearlyReferencedFromToLocationAspectProps = {\r\n classFullName: LinearlyReferencedFromToLocation.classFullName,\r\n element: { id: locatedElementId },\r\n fromPosition: from,\r\n fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedFromPositionRefersToReferent(fromReferentId),\r\n toPosition: to,\r\n toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearlyReferencedToPositionRefersToReferent(toReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation {\r\n return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);\r\n }\r\n\r\n /** Insert a new aspect using an explicit transaction.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;\r\n\r\n /** Insert a new aspect.\r\n * @deprecated Use LinearlyReferencedFromToLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\r\n */\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;\r\n\r\n public static insert(txnOrIModel: EditTxn | IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n txn.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"LinearReferencingElementAspects.js","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,sDAA4E;AAC5E,oDAAoD;AAIpD,qFAE0C;AAE1C;;GAEG;AACH,MAAa,kBAAkB;IACtB,sBAAsB,CAAS;IAC/B,+BAA+B,CAAU;IACzC,gCAAgC,CAAU;IAC1C,yBAAyB,CAAU;IAE1C,YAAY,KAA8B;QACxC,IAAI,CAAC,sBAAsB,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC/E,IAAI,CAAC,+BAA+B,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACjG,IAAI,CAAC,gCAAgC,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACnG,IAAI,CAAC,yBAAyB,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CAA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ACzD,aAAa,EAAE,gCAAgC,CAAC,aAAa;YAC7D,OAAO,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE;YACjC,YAAY,EAAE,IAAI;YAClB,wBAAwB,EAAE,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,+EAA8C,CAAC,cAAc,CAAC;YACzI,UAAU,EAAE,EAAE;YACd,sBAAsB,EAAE,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,6EAA4C,CAAC,YAAY,CAAC;SAClI,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,MAAgB,EAAE,gBAA4B,EACjE,IAAwB,EAAE,EAAsB,EAAE,cAA2B,EAAE,YAAyB;QACxG,OAAO,IAAI,gCAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9H,CAAC;IAcM,MAAM,CAAC,MAAM,CAAC,WAA+B,EAAE,gBAA4B,EAChF,IAAwB,EAAE,EAAsB,EAAE,cAA2B,EAAE,YAAyB;QACxG,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;QAC3F,IAAI,WAAW,YAAY,sBAAO;YAChC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;aACnC,CAAC;YACJ,mJAAmJ;YACnJ,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF;AA1DD,4EA0DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LinearReferencing\r\n */\r\n\r\nimport { Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { EditTxn, ElementMultiAspect, IModelDb } from \"@itwin/core-backend\";\r\nimport { RelatedElement } from \"@itwin/core-common\";\r\nimport {\r\n DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps,\r\n} from \"@itwin/linear-referencing-common\";\r\nimport {\r\n LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent,\r\n} from \"./LinearReferencingRelationships\";\r\n\r\n/** Core structure carrying linearly-referenced information.\r\n * @beta\r\n */\r\nexport class DistanceExpression implements DistanceExpressionProps {\r\n public distanceAlongFromStart: number;\r\n public lateralOffsetFromILinearElement?: number;\r\n public verticalOffsetFromILinearElement?: number;\r\n public distanceAlongFromReferent?: number;\r\n\r\n constructor(props: DistanceExpressionProps) {\r\n this.distanceAlongFromStart = JsonUtils.asDouble(props.distanceAlongFromStart);\r\n this.lateralOffsetFromILinearElement = JsonUtils.asDouble(props.lateralOffsetFromILinearElement);\r\n this.verticalOffsetFromILinearElement = JsonUtils.asDouble(props.verticalOffsetFromILinearElement);\r\n this.distanceAlongFromReferent = JsonUtils.asDouble(props.distanceAlongFromReferent);\r\n }\r\n\r\n public static fromJSON(json: DistanceExpressionProps): DistanceExpression { return new DistanceExpression(json); }\r\n}\r\n\r\n/** Base class for multi-aspects carrying linearly-referenced locations.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedLocation extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedLocation\"; }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedAtLocation\"; }\r\n\r\n public atPosition: DistanceExpression;\r\n public fromReferent?: LinearlyReferencedAtPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.atPosition = DistanceExpression.fromJSON(props.atPosition);\r\n this.fromReferent = RelatedElement.fromJSON(props.fromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocationAspectProps {\r\n const props: LinearlyReferencedAtLocationAspectProps = {\r\n classFullName: LinearlyReferencedAtLocation.classFullName,\r\n element: { id: locatedElementId },\r\n atPosition: at,\r\n fromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedAtPositionRefersToReferent(fromReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation {\r\n return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);\r\n }\r\n\r\n /** Insert a new aspect using an explicit transaction.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void;\r\n\r\n /** Insert a new aspect.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyReferencedAtLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\r\n */\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void;\r\n\r\n public static insert(txnOrIModel: EditTxn | IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void {\r\n const aspectProps = this.toProps(locatedElementId, at, fromReferentId);\r\n if (txnOrIModel instanceof EditTxn)\r\n txnOrIModel.insertAspect(aspectProps);\r\n else {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.\r\n txnOrIModel.elements.insertAspect(aspectProps);\r\n }\r\n }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedFromToLocation\"; }\r\n\r\n public fromPosition: DistanceExpression;\r\n public fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;\r\n public toPosition: DistanceExpression;\r\n public toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);\r\n this.toPosition = DistanceExpression.fromJSON(props.toPosition);\r\n this.fromPositionFromReferent = RelatedElement.fromJSON(props.fromPositionFromReferent);\r\n this.toPositionFromReferent = RelatedElement.fromJSON(props.toPositionFromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocationAspectProps {\r\n const props: LinearlyReferencedFromToLocationAspectProps = {\r\n classFullName: LinearlyReferencedFromToLocation.classFullName,\r\n element: { id: locatedElementId },\r\n fromPosition: from,\r\n fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedFromPositionRefersToReferent(fromReferentId),\r\n toPosition: to,\r\n toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearlyReferencedToPositionRefersToReferent(toReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation {\r\n return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);\r\n }\r\n\r\n /** Insert a new aspect using an explicit transaction.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;\r\n\r\n /** Insert a new aspect.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyReferencedFromToLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\r\n */\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;\r\n\r\n public static insert(txnOrIModel: EditTxn | IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void {\r\n const aspectProps = this.toProps(locatedElementId, from, to, fromReferentId, toReferentId);\r\n if (txnOrIModel instanceof EditTxn)\r\n txnOrIModel.insertAspect(aspectProps);\r\n else {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.\r\n txnOrIModel.elements.insertAspect(aspectProps);\r\n }\r\n }\r\n}\r\n"]}
@@ -40,7 +40,7 @@ export declare class LinearLocation extends LinearLocationElement implements Lin
40
40
  */
41
41
  static insertFromTo(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
42
42
  /** Insert a new `LinearLocation`.
43
- * @deprecated Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
43
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
44
44
  */
45
45
  static insertFromTo(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
46
46
  /** Insert this `LinearLocation` using an explicit transaction.
@@ -48,7 +48,7 @@ export declare class LinearLocation extends LinearLocationElement implements Lin
48
48
  */
49
49
  insertFromTo(txn: EditTxn, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
50
50
  /** Insert this `LinearLocation`.
51
- * @deprecated Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
51
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
52
52
  */
53
53
  insertFromTo(iModel: IModelDb, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
54
54
  /** Insert a new `LinearLocation` using an explicit transaction.
@@ -56,7 +56,7 @@ export declare class LinearLocation extends LinearLocationElement implements Lin
56
56
  */
57
57
  static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
58
58
  /** Insert a new `LinearLocation`.
59
- * @deprecated Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
59
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
60
60
  */
61
61
  static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
62
62
  /** Insert this `LinearLocation` using an explicit transaction.
@@ -64,7 +64,7 @@ export declare class LinearLocation extends LinearLocationElement implements Lin
64
64
  */
65
65
  insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
66
66
  /** Insert this `LinearLocation`.
67
- * @deprecated Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
67
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
68
68
  */
69
69
  insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
70
70
  }
@@ -100,7 +100,7 @@ export declare class Referent extends ReferentElement {
100
100
  */
101
101
  static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;
102
102
  /** Insert a new `Referent`.
103
- * @deprecated Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
103
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
104
104
  */
105
105
  static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;
106
106
  /** Insert this `Referent` using an explicit transaction.
@@ -108,7 +108,7 @@ export declare class Referent extends ReferentElement {
108
108
  */
109
109
  insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
110
110
  /** Insert this `Referent`.
111
- * @deprecated Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
111
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
112
112
  */
113
113
  insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
114
114
  }
@@ -133,7 +133,7 @@ export declare class LinearlyLocated {
133
133
  * @param atPosition Linear position.
134
134
  * @returns The newly inserted element's Id.
135
135
  * @throws [[IModelError]] if unable to insert the element.
136
- * @deprecated Use LinearlyLocated.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
136
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyLocated.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
137
137
  */
138
138
  static insertAt(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
139
139
  /** Insert a new LinearlyLocated element into an iModel at a specific from-to location along an existing Linear-Element.
@@ -152,7 +152,7 @@ export declare class LinearlyLocated {
152
152
  * @param fromToPosition Linear position.
153
153
  * @returns The newly inserted element's Id.
154
154
  * @throws [[IModelError]] if unable to insert the element.
155
- * @deprecated Use LinearlyLocated.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
155
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyLocated.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
156
156
  */
157
157
  static insertFromTo(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;
158
158
  private static getLinearLocations;
@@ -177,7 +177,7 @@ export declare class LinearlyLocated {
177
177
  * @param linearLocationProps The properties to use to update the LinearlyReferencedAtLocation aspect.
178
178
  * @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.
179
179
  * @throws [[IModelError]]
180
- * @deprecated Use LinearlyLocated.updateAtLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
180
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyLocated.updateAtLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
181
181
  */
182
182
  static updateAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;
183
183
  static updateAtLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;
@@ -187,7 +187,7 @@ export declare class LinearlyLocated {
187
187
  * @param linearLocationProps The properties to use to update the LinearlyReferencedFromToLocation aspect.
188
188
  * @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.
189
189
  * @throws [[IModelError]]
190
- * @deprecated Use LinearlyLocated.updateFromToLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
190
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use LinearlyLocated.updateFromToLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
191
191
  */
192
192
  static updateFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;
193
193
  static updateFromToLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;
@@ -1 +1 @@
1
- {"version":3,"file":"LinearReferencingElements.d.ts","sourceRoot":"","sources":["../../src/LinearReferencingElements.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAkB,OAAO,EAAiB,QAAQ,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEhI,OAAO,EAAQ,YAAY,EAAE,uBAAuB,EAAe,oBAAoB,EAAkB,MAAM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ated = exports.Referent = exports.ReferentElement = exports.LinearPhysicalElement = exports.LinearLocation = exports.LinearLocationElement = exports.LinearlyLocatedAttribution = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_backend_1 = require("@itwin/core-backend");
13
- const Symbols_1 = require("@itwin/core-backend/lib/cjs/internal/Symbols");
14
13
  const core_common_1 = require("@itwin/core-common");
15
14
  const linear_referencing_common_1 = require("@itwin/linear-referencing-common");
16
15
  const LinearReferencingElementAspects_1 = require("./LinearReferencingElementAspects");
@@ -67,28 +66,52 @@ class LinearLocation extends LinearLocationElement {
67
66
  return new LinearLocation(this.toProps(modelId, categoryId), iModel);
68
67
  }
69
68
  static insertFromTo(txnOrIModel, modelId, categoryId, linearElementId, fromToPosition, locatedElementId) {
70
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
71
- const newId = LinearlyLocated.insertFromTo(txn, this.toProps(modelId, categoryId), linearElementId, fromToPosition);
72
- LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
73
- return newId;
69
+ if (txnOrIModel instanceof core_backend_1.EditTxn) {
70
+ const newId = LinearlyLocated.insertFromTo(txnOrIModel, this.toProps(modelId, categoryId), linearElementId, fromToPosition);
71
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, newId, locatedElementId);
72
+ return newId;
73
+ }
74
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
75
+ const iModelNewId = LinearlyLocated.insertFromTo(txnOrIModel, this.toProps(modelId, categoryId), linearElementId, fromToPosition);
76
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
77
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, iModelNewId, locatedElementId);
78
+ return iModelNewId;
74
79
  }
75
80
  insertFromTo(txnOrIModel, linearElementId, fromToPosition, locatedElementId) {
76
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
77
- const newId = LinearlyLocated.insertFromTo(txn, this.toJSON(), linearElementId, fromToPosition);
78
- LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
79
- return newId;
81
+ if (txnOrIModel instanceof core_backend_1.EditTxn) {
82
+ const newId = LinearlyLocated.insertFromTo(txnOrIModel, this.toJSON(), linearElementId, fromToPosition);
83
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, newId, locatedElementId);
84
+ return newId;
85
+ }
86
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
87
+ const iModelNewId = LinearlyLocated.insertFromTo(txnOrIModel, this.toJSON(), linearElementId, fromToPosition);
88
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
89
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, iModelNewId, locatedElementId);
90
+ return iModelNewId;
80
91
  }
81
92
  static insertAt(txnOrIModel, modelId, categoryId, linearElementId, atPosition, locatedElementId) {
82
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
83
- const newId = LinearlyLocated.insertAt(txn, this.toProps(modelId, categoryId), linearElementId, atPosition);
84
- LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
85
- return newId;
93
+ if (txnOrIModel instanceof core_backend_1.EditTxn) {
94
+ const newId = LinearlyLocated.insertAt(txnOrIModel, this.toProps(modelId, categoryId), linearElementId, atPosition);
95
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, newId, locatedElementId);
96
+ return newId;
97
+ }
98
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
99
+ const iModelNewId = LinearlyLocated.insertAt(txnOrIModel, this.toProps(modelId, categoryId), linearElementId, atPosition);
100
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
101
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, iModelNewId, locatedElementId);
102
+ return iModelNewId;
86
103
  }
87
104
  insertAt(txnOrIModel, linearElementId, atPosition, locatedElementId) {
88
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
89
- const newId = LinearlyLocated.insertAt(txn, this.toJSON(), linearElementId, atPosition);
90
- LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
91
- return newId;
105
+ if (txnOrIModel instanceof core_backend_1.EditTxn) {
106
+ const newId = LinearlyLocated.insertAt(txnOrIModel, this.toJSON(), linearElementId, atPosition);
107
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, newId, locatedElementId);
108
+ return newId;
109
+ }
110
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
111
+ const iModelNewId = LinearlyLocated.insertAt(txnOrIModel, this.toJSON(), linearElementId, atPosition);
112
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
113
+ LinearReferencingRelationships_1.ILinearLocationLocatesElement.insert(txnOrIModel, iModelNewId, locatedElementId);
114
+ return iModelNewId;
92
115
  }
93
116
  }
94
117
  exports.LinearLocation = LinearLocation;
@@ -142,12 +165,16 @@ class Referent extends ReferentElement {
142
165
  return new Referent(this.toProps(modelId, categoryId, referencedElementId), iModel);
143
166
  }
144
167
  static insertAt(txnOrIModel, modelId, categoryId, linearElementId, atPosition, referencedElementId) {
145
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
146
- return LinearlyLocated.insertAt(txn, this.toProps(modelId, categoryId, referencedElementId), linearElementId, atPosition);
168
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
169
+ return LinearlyLocated.insertAt(txnOrIModel, this.toProps(modelId, categoryId, referencedElementId), linearElementId, atPosition);
170
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
171
+ return LinearlyLocated.insertAt(txnOrIModel, this.toProps(modelId, categoryId, referencedElementId), linearElementId, atPosition);
147
172
  }
148
173
  insertAt(txnOrIModel, linearElementId, atPosition) {
149
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
150
- return LinearlyLocated.insertAt(txn, this.toJSON(), linearElementId, atPosition);
174
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
175
+ return LinearlyLocated.insertAt(txnOrIModel, this.toJSON(), linearElementId, atPosition);
176
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
177
+ return LinearlyLocated.insertAt(txnOrIModel, this.toJSON(), linearElementId, atPosition);
151
178
  }
152
179
  }
153
180
  exports.Referent = Referent;
@@ -423,22 +450,39 @@ class QueryLinearLocationsECSQLGen {
423
450
  * @beta
424
451
  */
425
452
  class LinearlyLocated {
426
- static insertBasic(txn, elProps, linearElementId) {
427
- const newId = txn.insertElement(elProps);
428
- const linearlyLocatedAlongLinearElement = LinearReferencingRelationships_1.ILinearlyLocatedAlongILinearElement.create(txn.iModel, newId, linearElementId);
429
- linearlyLocatedAlongLinearElement.insert(txn);
453
+ static insertBasic(txnOrIModel, elProps, linearElementId) {
454
+ const newId = txnOrIModel instanceof core_backend_1.EditTxn
455
+ ? txnOrIModel.insertElement(elProps)
456
+ : (() => {
457
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
458
+ return txnOrIModel.elements.insertElement(elProps);
459
+ })();
460
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
461
+ LinearReferencingRelationships_1.ILinearlyLocatedAlongILinearElement.insert(txnOrIModel, newId, linearElementId);
462
+ else {
463
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
464
+ LinearReferencingRelationships_1.ILinearlyLocatedAlongILinearElement.insert(txnOrIModel, newId, linearElementId);
465
+ }
430
466
  return newId;
431
467
  }
432
468
  static insertAt(txnOrIModel, elProps, linearElementId, atPosition) {
433
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
434
- const newId = this.insertBasic(txn, elProps, linearElementId);
435
- LinearReferencingElementAspects_1.LinearlyReferencedAtLocation.insert(txn, newId, atPosition.atPosition, atPosition.fromReferent === undefined ? undefined : atPosition.fromReferent.id);
469
+ const newId = this.insertBasic(txnOrIModel, elProps, linearElementId);
470
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
471
+ LinearReferencingElementAspects_1.LinearlyReferencedAtLocation.insert(txnOrIModel, newId, atPosition.atPosition, atPosition.fromReferent === undefined ? undefined : atPosition.fromReferent.id);
472
+ else {
473
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
474
+ LinearReferencingElementAspects_1.LinearlyReferencedAtLocation.insert(txnOrIModel, newId, atPosition.atPosition, atPosition.fromReferent === undefined ? undefined : atPosition.fromReferent.id);
475
+ }
436
476
  return newId;
437
477
  }
438
478
  static insertFromTo(txnOrIModel, elProps, linearElementId, fromToPosition) {
439
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
440
- const newId = this.insertBasic(txn, elProps, linearElementId);
441
- LinearReferencingElementAspects_1.LinearlyReferencedFromToLocation.insert(txn, newId, fromToPosition.fromPosition, fromToPosition.toPosition, fromToPosition.fromPositionFromReferent === undefined ? undefined : fromToPosition.fromPositionFromReferent.id, fromToPosition.toPositionFromReferent === undefined ? undefined : fromToPosition.toPositionFromReferent.id);
479
+ const newId = this.insertBasic(txnOrIModel, elProps, linearElementId);
480
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
481
+ LinearReferencingElementAspects_1.LinearlyReferencedFromToLocation.insert(txnOrIModel, newId, fromToPosition.fromPosition, fromToPosition.toPosition, fromToPosition.fromPositionFromReferent === undefined ? undefined : fromToPosition.fromPositionFromReferent.id, fromToPosition.toPositionFromReferent === undefined ? undefined : fromToPosition.toPositionFromReferent.id);
482
+ else {
483
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
484
+ LinearReferencingElementAspects_1.LinearlyReferencedFromToLocation.insert(txnOrIModel, newId, fromToPosition.fromPosition, fromToPosition.toPosition, fromToPosition.fromPositionFromReferent === undefined ? undefined : fromToPosition.fromPositionFromReferent.id, fromToPosition.toPositionFromReferent === undefined ? undefined : fromToPosition.toPositionFromReferent.id);
485
+ }
442
486
  return newId;
443
487
  }
444
488
  static getLinearLocations(iModel, linearlyLocatedElementId, fullClassName) {
@@ -487,8 +531,7 @@ class LinearlyLocated {
487
531
  }
488
532
  }
489
533
  static updateAtLocation(txnOrIModel, linearlyLocatedElementId, linearLocationProps, aspectId) {
490
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
491
- const iModel = txn.iModel;
534
+ const iModel = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel.iModel : txnOrIModel;
492
535
  let linearLocAspectId;
493
536
  if (aspectId !== undefined)
494
537
  linearLocAspectId = aspectId;
@@ -505,11 +548,15 @@ class LinearlyLocated {
505
548
  atPosition: linearLocationProps.atPosition,
506
549
  fromReferent: linearLocationProps.fromReferent,
507
550
  };
508
- txn.updateAspect(linearLocationAspectProps);
551
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
552
+ txnOrIModel.updateAspect(linearLocationAspectProps);
553
+ else {
554
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
555
+ txnOrIModel.elements.updateAspect(linearLocationAspectProps);
556
+ }
509
557
  }
510
558
  static updateFromToLocation(txnOrIModel, linearlyLocatedElementId, linearLocationProps, aspectId) {
511
- const txn = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel : txnOrIModel[Symbols_1._implicitTxn];
512
- const iModel = txn.iModel;
559
+ const iModel = txnOrIModel instanceof core_backend_1.EditTxn ? txnOrIModel.iModel : txnOrIModel;
513
560
  let linearLocAspectId;
514
561
  if (aspectId !== undefined)
515
562
  linearLocAspectId = aspectId;
@@ -528,7 +575,12 @@ class LinearlyLocated {
528
575
  toPosition: linearLocationProps.toPosition,
529
576
  toPositionFromReferent: linearLocationProps.toPositionFromReferent,
530
577
  };
531
- txn.updateAspect(linearLocationAspectProps);
578
+ if (txnOrIModel instanceof core_backend_1.EditTxn)
579
+ txnOrIModel.updateAspect(linearLocationAspectProps);
580
+ else {
581
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated IModelDb overload is intentionally preserved for backward compatibility.
582
+ txnOrIModel.elements.updateAspect(linearLocationAspectProps);
583
+ }
532
584
  }
533
585
  /** Query for the Id of the Linear-Element along which the specified LinearlyLocated Element is located.
534
586
  * @param iModel The iModel to query from.