@itwin/core-common 5.0.0-dev.57 → 5.0.0-dev.58

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 (115) hide show
  1. package/lib/cjs/Code.d.ts +0 -5
  2. package/lib/cjs/Code.d.ts.map +1 -1
  3. package/lib/cjs/Code.js +0 -11
  4. package/lib/cjs/Code.js.map +1 -1
  5. package/lib/cjs/FeatureSymbology.d.ts +0 -27
  6. package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
  7. package/lib/cjs/FeatureSymbology.js +0 -33
  8. package/lib/cjs/FeatureSymbology.js.map +1 -1
  9. package/lib/cjs/Localization.d.ts +0 -10
  10. package/lib/cjs/Localization.d.ts.map +1 -1
  11. package/lib/cjs/Localization.js +0 -1
  12. package/lib/cjs/Localization.js.map +1 -1
  13. package/lib/cjs/RenderMaterial.d.ts +0 -43
  14. package/lib/cjs/RenderMaterial.d.ts.map +1 -1
  15. package/lib/cjs/RenderMaterial.js +0 -62
  16. package/lib/cjs/RenderMaterial.js.map +1 -1
  17. package/lib/cjs/RenderTexture.d.ts +0 -20
  18. package/lib/cjs/RenderTexture.d.ts.map +1 -1
  19. package/lib/cjs/RenderTexture.js +0 -25
  20. package/lib/cjs/RenderTexture.js.map +1 -1
  21. package/lib/cjs/TerrainSettings.d.ts +0 -7
  22. package/lib/cjs/TerrainSettings.d.ts.map +1 -1
  23. package/lib/cjs/TerrainSettings.js.map +1 -1
  24. package/lib/cjs/ViewProps.d.ts +0 -4
  25. package/lib/cjs/ViewProps.d.ts.map +1 -1
  26. package/lib/cjs/ViewProps.js.map +1 -1
  27. package/lib/cjs/core-common.d.ts +0 -1
  28. package/lib/cjs/core-common.d.ts.map +1 -1
  29. package/lib/cjs/core-common.js +0 -1
  30. package/lib/cjs/core-common.js.map +1 -1
  31. package/lib/cjs/{BackendTypes.d.ts → internal/BackendTypes.d.ts} +2 -2
  32. package/lib/cjs/internal/BackendTypes.d.ts.map +1 -0
  33. package/lib/cjs/internal/BackendTypes.js.map +1 -0
  34. package/lib/cjs/internal/RenderMaterialParams.d.ts +47 -0
  35. package/lib/cjs/internal/RenderMaterialParams.d.ts.map +1 -0
  36. package/lib/cjs/internal/RenderMaterialParams.js +68 -0
  37. package/lib/cjs/internal/RenderMaterialParams.js.map +1 -0
  38. package/lib/cjs/internal/RenderTextureParams.d.ts +25 -0
  39. package/lib/cjs/internal/RenderTextureParams.d.ts.map +1 -0
  40. package/lib/cjs/internal/RenderTextureParams.js +37 -0
  41. package/lib/cjs/internal/RenderTextureParams.js.map +1 -0
  42. package/lib/cjs/internal/cross-package.d.ts +3 -0
  43. package/lib/cjs/internal/cross-package.d.ts.map +1 -1
  44. package/lib/cjs/internal/cross-package.js +5 -1
  45. package/lib/cjs/internal/cross-package.js.map +1 -1
  46. package/lib/cjs/rpc/core/RpcMarshaling.d.ts +1 -1
  47. package/lib/cjs/rpc/core/RpcMarshaling.d.ts.map +1 -1
  48. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  49. package/lib/cjs/rpc/web/RpcMultipart.d.ts +1 -1
  50. package/lib/cjs/rpc/web/RpcMultipart.d.ts.map +1 -1
  51. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  52. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +1 -1
  53. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  54. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  55. package/lib/esm/Code.d.ts +0 -5
  56. package/lib/esm/Code.d.ts.map +1 -1
  57. package/lib/esm/Code.js +0 -11
  58. package/lib/esm/Code.js.map +1 -1
  59. package/lib/esm/FeatureSymbology.d.ts +0 -27
  60. package/lib/esm/FeatureSymbology.d.ts.map +1 -1
  61. package/lib/esm/FeatureSymbology.js +0 -33
  62. package/lib/esm/FeatureSymbology.js.map +1 -1
  63. package/lib/esm/Localization.d.ts +0 -10
  64. package/lib/esm/Localization.d.ts.map +1 -1
  65. package/lib/esm/Localization.js +0 -1
  66. package/lib/esm/Localization.js.map +1 -1
  67. package/lib/esm/RenderMaterial.d.ts +0 -43
  68. package/lib/esm/RenderMaterial.d.ts.map +1 -1
  69. package/lib/esm/RenderMaterial.js +0 -62
  70. package/lib/esm/RenderMaterial.js.map +1 -1
  71. package/lib/esm/RenderTexture.d.ts +0 -20
  72. package/lib/esm/RenderTexture.d.ts.map +1 -1
  73. package/lib/esm/RenderTexture.js +0 -25
  74. package/lib/esm/RenderTexture.js.map +1 -1
  75. package/lib/esm/TerrainSettings.d.ts +0 -7
  76. package/lib/esm/TerrainSettings.d.ts.map +1 -1
  77. package/lib/esm/TerrainSettings.js.map +1 -1
  78. package/lib/esm/ViewProps.d.ts +0 -4
  79. package/lib/esm/ViewProps.d.ts.map +1 -1
  80. package/lib/esm/ViewProps.js.map +1 -1
  81. package/lib/esm/core-common.d.ts +0 -1
  82. package/lib/esm/core-common.d.ts.map +1 -1
  83. package/lib/esm/core-common.js +0 -1
  84. package/lib/esm/core-common.js.map +1 -1
  85. package/lib/esm/{BackendTypes.d.ts → internal/BackendTypes.d.ts} +2 -2
  86. package/lib/esm/internal/BackendTypes.d.ts.map +1 -0
  87. package/lib/esm/internal/BackendTypes.js.map +1 -0
  88. package/lib/esm/internal/RenderMaterialParams.d.ts +47 -0
  89. package/lib/esm/internal/RenderMaterialParams.d.ts.map +1 -0
  90. package/lib/esm/internal/RenderMaterialParams.js +64 -0
  91. package/lib/esm/internal/RenderMaterialParams.js.map +1 -0
  92. package/lib/esm/internal/RenderTextureParams.d.ts +25 -0
  93. package/lib/esm/internal/RenderTextureParams.d.ts.map +1 -0
  94. package/lib/esm/internal/RenderTextureParams.js +33 -0
  95. package/lib/esm/internal/RenderTextureParams.js.map +1 -0
  96. package/lib/esm/internal/cross-package.d.ts +3 -0
  97. package/lib/esm/internal/cross-package.d.ts.map +1 -1
  98. package/lib/esm/internal/cross-package.js +2 -0
  99. package/lib/esm/internal/cross-package.js.map +1 -1
  100. package/lib/esm/rpc/core/RpcMarshaling.d.ts +1 -1
  101. package/lib/esm/rpc/core/RpcMarshaling.d.ts.map +1 -1
  102. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  103. package/lib/esm/rpc/web/RpcMultipart.d.ts +1 -1
  104. package/lib/esm/rpc/web/RpcMultipart.d.ts.map +1 -1
  105. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  106. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +1 -1
  107. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  108. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  109. package/package.json +6 -6
  110. package/lib/cjs/BackendTypes.d.ts.map +0 -1
  111. package/lib/cjs/BackendTypes.js.map +0 -1
  112. package/lib/esm/BackendTypes.d.ts.map +0 -1
  113. package/lib/esm/BackendTypes.js.map +0 -1
  114. /package/lib/cjs/{BackendTypes.js → internal/BackendTypes.js} +0 -0
  115. /package/lib/esm/{BackendTypes.js → internal/BackendTypes.js} +0 -0
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Rendering
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.RenderMaterialParams = void 0;
11
+ function clampToNormalizedRange(value) {
12
+ return Math.max(0.0, Math.min(1.0, value));
13
+ }
14
+ /** Params for use in old CreateMaterial functions. Use [CreateRenderMaterialArgs]($frontend) instead.
15
+ * @internal
16
+ */
17
+ class RenderMaterialParams {
18
+ /** If the material originates from a Material element in the [[IModel]], the Id of that element. */
19
+ key;
20
+ /** Diffuse color, or undefined if this material does not override the surface's own color. */
21
+ diffuseColor;
22
+ /** Specular color. Defaults to white if undefined. */
23
+ specularColor;
24
+ /** Currently unused. @alpha */
25
+ emissiveColor;
26
+ /** Currently unused. @alpha */
27
+ reflectColor;
28
+ /** Optional pattern mapping applied to the surface. */
29
+ textureMapping;
30
+ /** Diffuse weight in [0..1] */
31
+ diffuse = 0.6;
32
+ /** Specular weight in [0..1] */
33
+ specular = 0.4;
34
+ specularExponent = 13.5;
35
+ /** Currently unused. @alpha */
36
+ reflect = 0.0;
37
+ /** Currently unused. @alpha */
38
+ refract = 1.0;
39
+ /** Currently unused. @alpha */
40
+ ambient = .3;
41
+ /** Currently unused. @alpha */
42
+ shadows = true;
43
+ _alpha;
44
+ constructor(key) { this.key = key; }
45
+ /** Obtain an immutable instance of a RenderMaterial with all default properties. */
46
+ static defaults = new RenderMaterialParams();
47
+ /** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied;
48
+ * or undefined if this material does not override surface transparency.
49
+ */
50
+ get alpha() { return this._alpha; }
51
+ set alpha(alpha) {
52
+ this._alpha = undefined !== alpha ? clampToNormalizedRange(alpha) : undefined;
53
+ }
54
+ /** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */
55
+ static fromColors(key, diffuseColor, specularColor, emissiveColor, reflectColor, textureMap) {
56
+ const materialParams = new RenderMaterialParams();
57
+ materialParams.key = key;
58
+ materialParams.diffuseColor = diffuseColor;
59
+ materialParams.specularColor = specularColor;
60
+ materialParams.emissiveColor = emissiveColor;
61
+ materialParams.reflectColor = reflectColor;
62
+ materialParams.textureMapping = textureMap;
63
+ return materialParams;
64
+ }
65
+ }
66
+ exports.RenderMaterialParams = RenderMaterialParams;
67
+ Object.freeze(RenderMaterialParams.defaults);
68
+ //# sourceMappingURL=RenderMaterialParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderMaterialParams.js","sourceRoot":"","sources":["../../../src/internal/RenderMaterialParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH,SAAS,sBAAsB,CAAC,KAAa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AE,CAAC;QAClD,cAAc,CAAC,GAAG,GAAG,GAAG,CAAC;QACzB,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;QAC3C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;QAC3C,cAAc,CAAC,cAAc,GAAG,UAAU,CAAC;QAC3C,OAAO,cAAc,CAAC;IACxB,CAAC;;AAnDH,oDAoDC;AAED,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC","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 Rendering\n */\n\nimport { ColorDef } from \"../ColorDef\";\nimport { TextureMapping } from \"../TextureMapping\";\n\nfunction clampToNormalizedRange(value: number): number {\n return Math.max(0.0, Math.min(1.0, value));\n}\n\n/** Params for use in old CreateMaterial functions. Use [CreateRenderMaterialArgs]($frontend) instead.\n * @internal\n*/\nexport class RenderMaterialParams {\n /** If the material originates from a Material element in the [[IModel]], the Id of that element. */\n public key?: string;\n /** Diffuse color, or undefined if this material does not override the surface's own color. */\n public diffuseColor?: ColorDef;\n /** Specular color. Defaults to white if undefined. */\n public specularColor?: ColorDef;\n /** Currently unused. @alpha */\n public emissiveColor?: ColorDef;\n /** Currently unused. @alpha */\n public reflectColor?: ColorDef;\n /** Optional pattern mapping applied to the surface. */\n public textureMapping?: TextureMapping;\n /** Diffuse weight in [0..1] */\n public diffuse: number = 0.6;\n /** Specular weight in [0..1] */\n public specular: number = 0.4;\n public specularExponent: number = 13.5;\n /** Currently unused. @alpha */\n public reflect: number = 0.0;\n /** Currently unused. @alpha */\n public refract: number = 1.0;\n /** Currently unused. @alpha */\n public ambient: number = .3;\n /** Currently unused. @alpha */\n public shadows = true;\n private _alpha?: number;\n\n public constructor(key?: string) { this.key = key; }\n\n /** Obtain an immutable instance of a RenderMaterial with all default properties. */\n public static readonly defaults = new RenderMaterialParams();\n\n /** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied;\n * or undefined if this material does not override surface transparency.\n */\n public get alpha(): number | undefined { return this._alpha; }\n public set alpha(alpha: number | undefined) {\n this._alpha = undefined !== alpha ? clampToNormalizedRange(alpha) : undefined;\n }\n\n /** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */\n public static fromColors(key?: string, diffuseColor?: ColorDef, specularColor?: ColorDef, emissiveColor?: ColorDef, reflectColor?: ColorDef, textureMap?: TextureMapping): RenderMaterialParams {\n const materialParams = new RenderMaterialParams();\n materialParams.key = key;\n materialParams.diffuseColor = diffuseColor;\n materialParams.specularColor = specularColor;\n materialParams.emissiveColor = emissiveColor;\n materialParams.reflectColor = reflectColor;\n materialParams.textureMapping = textureMap;\n return materialParams;\n }\n}\n\nObject.freeze(RenderMaterialParams.defaults);\n"]}
@@ -0,0 +1,25 @@
1
+ /** @packageDocumentation
2
+ * @module Rendering
3
+ */
4
+ import { RenderTexture } from "../RenderTexture";
5
+ /** Parameters used to construct a [[RenderTexture]] in old RenderTexture functions.
6
+ * Use RenderSystem.createTexture and CreateTextureArgs instead.
7
+ * @internal
8
+ */
9
+ export declare class RenderTextureParams {
10
+ /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.
11
+ * Textures created on the front-end generally have no key.
12
+ */
13
+ readonly key?: string;
14
+ /** Indicates the type of texture. */
15
+ readonly type: RenderTexture.Type;
16
+ /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.
17
+ * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.
18
+ */
19
+ readonly isOwned: boolean;
20
+ constructor(key?: string, type?: RenderTexture.Type, isOwned?: boolean);
21
+ get isTileSection(): boolean;
22
+ get isGlyph(): boolean;
23
+ get isSkyBox(): boolean;
24
+ }
25
+ //# sourceMappingURL=RenderTextureParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderTextureParams.d.ts","sourceRoot":"","sources":["../../../src/internal/RenderTextureParams.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B;;MAEE;IACF,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC7B,qCAAqC;IACrC,SAAgB,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;IACzC;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAEd,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,aAAa,CAAC,IAAgC,EAAE,OAAO,GAAE,OAAe;IAM/G,IAAW,aAAa,IAAI,OAAO,CAAyD;IAC5F,IAAW,OAAO,IAAI,OAAO,CAAmD;IAChF,IAAW,QAAQ,IAAI,OAAO,CAAoD;CACnF"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RenderTextureParams = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ /** @packageDocumentation
9
+ * @module Rendering
10
+ */
11
+ const RenderTexture_1 = require("../RenderTexture");
12
+ /** Parameters used to construct a [[RenderTexture]] in old RenderTexture functions.
13
+ * Use RenderSystem.createTexture and CreateTextureArgs instead.
14
+ * @internal
15
+ */
16
+ class RenderTextureParams {
17
+ /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.
18
+ * Textures created on the front-end generally have no key.
19
+ */
20
+ key;
21
+ /** Indicates the type of texture. */
22
+ type;
23
+ /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.
24
+ * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.
25
+ */
26
+ isOwned;
27
+ constructor(key, type = RenderTexture_1.RenderTexture.Type.Normal, isOwned = false) {
28
+ this.key = key;
29
+ this.type = type;
30
+ this.isOwned = isOwned;
31
+ }
32
+ get isTileSection() { return RenderTexture_1.RenderTexture.Type.TileSection === this.type; }
33
+ get isGlyph() { return RenderTexture_1.RenderTexture.Type.Glyph === this.type; }
34
+ get isSkyBox() { return RenderTexture_1.RenderTexture.Type.SkyBox === this.type; }
35
+ }
36
+ exports.RenderTextureParams = RenderTextureParams;
37
+ //# sourceMappingURL=RenderTextureParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderTextureParams.js","sourceRoot":"","sources":["../../../src/internal/RenderTextureParams.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,oDAAiD;AAEjD;;;GAGG;AACH,MAAa,mBAAmB;IAC9B;;MAEE;IACc,GAAG,CAAU;IAC7B,qCAAqC;IACrB,IAAI,CAAqB;IACzC;;OAEG;IACa,OAAO,CAAU;IAEjC,YAAmB,GAAY,EAAE,OAA2B,6BAAa,CAAC,IAAI,CAAC,MAAM,EAAE,UAAmB,KAAK;QAC7G,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAW,aAAa,KAAc,OAAO,6BAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,6BAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,IAAW,QAAQ,KAAc,OAAO,6BAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;CACnF;AArBD,kDAqBC","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 Rendering\n */\nimport { RenderTexture } from \"../RenderTexture\";\n\n/** Parameters used to construct a [[RenderTexture]] in old RenderTexture functions.\n * Use RenderSystem.createTexture and CreateTextureArgs instead.\n * @internal\n */\nexport class RenderTextureParams {\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\n * Textures created on the front-end generally have no key.\n */\n public readonly key?: string;\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\n */\n public readonly isOwned: boolean;\n\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\n this.key = key;\n this.type = type;\n this.isOwned = isOwned;\n }\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n}"]}
@@ -1,4 +1,7 @@
1
1
  export type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from "./Snapping";
2
2
  export { EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs } from "./RenderMesh";
3
3
  export { MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable } from "./PackedFeatureTable";
4
+ export type { BackendReadable, BackendWritable, BackendBuffer } from "./BackendTypes";
5
+ export { RenderMaterialParams } from "./RenderMaterialParams";
6
+ export { RenderTextureParams } from "./RenderTextureParams";
4
7
  //# sourceMappingURL=cross-package.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACzG,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACzG,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.PackedFeatureTable = exports.PackedFeatureModelTable = exports.MultiModelPackedFeatureTable = exports.SilhouetteEdgeArgs = exports.PolylineEdgeArgs = exports.MeshPolyline = exports.MeshEdges = exports.MeshEdge = exports.EdgeArgs = void 0;
7
+ exports.RenderTextureParams = exports.RenderMaterialParams = exports.PackedFeatureTable = exports.PackedFeatureModelTable = exports.MultiModelPackedFeatureTable = exports.SilhouetteEdgeArgs = exports.PolylineEdgeArgs = exports.MeshPolyline = exports.MeshEdges = exports.MeshEdge = exports.EdgeArgs = void 0;
8
8
  var RenderMesh_1 = require("./RenderMesh");
9
9
  Object.defineProperty(exports, "EdgeArgs", { enumerable: true, get: function () { return RenderMesh_1.EdgeArgs; } });
10
10
  Object.defineProperty(exports, "MeshEdge", { enumerable: true, get: function () { return RenderMesh_1.MeshEdge; } });
@@ -16,4 +16,8 @@ var PackedFeatureTable_1 = require("./PackedFeatureTable");
16
16
  Object.defineProperty(exports, "MultiModelPackedFeatureTable", { enumerable: true, get: function () { return PackedFeatureTable_1.MultiModelPackedFeatureTable; } });
17
17
  Object.defineProperty(exports, "PackedFeatureModelTable", { enumerable: true, get: function () { return PackedFeatureTable_1.PackedFeatureModelTable; } });
18
18
  Object.defineProperty(exports, "PackedFeatureTable", { enumerable: true, get: function () { return PackedFeatureTable_1.PackedFeatureTable; } });
19
+ var RenderMaterialParams_1 = require("./RenderMaterialParams");
20
+ Object.defineProperty(exports, "RenderMaterialParams", { enumerable: true, get: function () { return RenderMaterialParams_1.RenderMaterialParams; } });
21
+ var RenderTextureParams_1 = require("./RenderTextureParams");
22
+ Object.defineProperty(exports, "RenderTextureParams", { enumerable: true, get: function () { return RenderTextureParams_1.RenderTextureParams; } });
19
23
  //# sourceMappingURL=cross-package.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,2CAEsB;AADpB,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAyB,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAE1G,2DAE8B;AAD5B,kIAAA,4BAA4B,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,wHAAA,kBAAkB,OAAA","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\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\n"]}
1
+ {"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,2CAEsB;AADpB,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAyB,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAE1G,2DAE8B;AAD5B,kIAAA,4BAA4B,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAG3E,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA","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\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\nexport { RenderTextureParams } from \"./RenderTextureParams\";\n"]}
@@ -1,4 +1,4 @@
1
- import { BackendReadable } from "../../BackendTypes";
1
+ import { BackendReadable } from "../../internal/BackendTypes";
2
2
  import { RpcProtocol } from "./RpcProtocol";
3
3
  /** @internal */
4
4
  export interface MarshalingBinaryMarker {
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACZ,SAAS,CAAC,QAAQ,EAAE,W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UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 RpcInterface\n */\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAoD;AACpD,mDAAgD;AAIhD,0BAA0B;AAC1B,qDAAqD;AAErD,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9I,CAAC;AAED,IAAI,gBAAoC,CAAC;AACzC,IAAI,cAAc,GAAG,CA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AAE,MAAM,CAAC,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC;YAC7B,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAc;QACxC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;YACtD,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACtF,KAAK,CAAC,IAAI,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACzF,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/F,KAAK,CAAC,KAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 RpcInterface\n */\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../internal/BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module RpcInterface
3
3
  */
4
- import { BackendBuffer, BackendReadable } from "../../BackendTypes";
4
+ import { BackendBuffer, BackendReadable } from "../../internal/BackendTypes";
5
5
  import { RpcSerializedValue } from "../core/RpcMarshaling";
6
6
  import { HttpServerRequest } from "../web/WebAppRpcProtocol";
7
7
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMultipart.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI7D,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrF;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,wDAAwD;WAC1C,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAA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,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,QAAQ,GAAG;QACvB,YAAY,CAAC,MAA0B;YACrC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,IAAuB;YACxC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,YAAY,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;YACrE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC;;AAtCJ,oCAuCC","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 RpcInterface\n */\n\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendBuffer, BackendReadable } from \"../../BackendTypes\";\nimport { RpcSerializedValue } from \"../core/RpcMarshaling\";\nimport { HttpServerRequest } from \"../web/WebAppRpcProtocol\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nexport interface FormDataCommon {\n append(name: string, value: string | Blob | BackendBuffer, fileName?: string): void;\n}\n\n/** @internal */\nexport interface ReadableFormData extends BackendReadable {\n getHeaders(): { [key: string]: any };\n}\n\n/** Support for transporting RPC values using the HTTP multipart content type.\n * @internal\n */\nexport class RpcMultipart {\n /** Creates a multipart form object for an RPC value. */\n public static createForm(value: RpcSerializedValue): FormData {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n return form;\n }\n\n /** Creates a multipart stream for an RPC value. */\n public static createStream(value: RpcSerializedValue): ReadableFormData {\n return this.platform.createStream(value);\n }\n\n /** Obtains the RPC value from a multipart HTTP request. */\n public static async parseRequest(req: HttpServerRequest): Promise<RpcSerializedValue> {\n return this.platform.parseRequest(req);\n }\n\n /** @internal */\n public static writeValueToForm(form: FormDataCommon, value: RpcSerializedValue) {\n form.append(\"objects\", value.objects);\n\n for (let i = 0; i !== value.data.length; ++i) {\n this.platform.appendToForm(i, form, value);\n }\n }\n\n /** @internal */\n public static platform = {\n createStream(_value: RpcSerializedValue): ReadableFormData {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n async parseRequest(_req: HttpServerRequest): Promise<RpcSerializedValue> {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n appendToForm(i: number, form: FormDataCommon, value: RpcSerializedValue): void {\n form.append(`data-${i}`, new Blob([value.data[i]], { type: \"application/octet-stream\" }));\n },\n };\n}\n\n"]}
1
+ {"version":3,"file":"RpcMultipart.js","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,mDAAgD;AAiBhD;;GAEG;AACH,MAAa,YAAY;IACvB,wDAAwD;IACjD,MAAM,CAAC,UAAU,CAAC,KAAyB;QAChD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mDAAmD;IAC5C,MAAM,CAAC,YAAY,CAAC,KAAyB;QAClD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,GAAsB;QACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,gBAAgB,CAAC,IAAoB,EAAE,KAAyB;QAC5E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,QAAQ,GAAG;QACvB,YAAY,CAAC,MAA0B;YACrC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,IAAuB;YACxC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,YAAY,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;YACrE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC;;AAtCJ,oCAuCC","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 RpcInterface\n */\n\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendBuffer, BackendReadable } from \"../../internal/BackendTypes\";\nimport { RpcSerializedValue } from \"../core/RpcMarshaling\";\nimport { HttpServerRequest } from \"../web/WebAppRpcProtocol\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nexport interface FormDataCommon {\n append(name: string, value: string | Blob | BackendBuffer, fileName?: string): void;\n}\n\n/** @internal */\nexport interface ReadableFormData extends BackendReadable {\n getHeaders(): { [key: string]: any };\n}\n\n/** Support for transporting RPC values using the HTTP multipart content type.\n * @internal\n */\nexport class RpcMultipart {\n /** Creates a multipart form object for an RPC value. */\n public static createForm(value: RpcSerializedValue): FormData {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n return form;\n }\n\n /** Creates a multipart stream for an RPC value. */\n public static createStream(value: RpcSerializedValue): ReadableFormData {\n return this.platform.createStream(value);\n }\n\n /** Obtains the RPC value from a multipart HTTP request. */\n public static async parseRequest(req: HttpServerRequest): Promise<RpcSerializedValue> {\n return this.platform.parseRequest(req);\n }\n\n /** @internal */\n public static writeValueToForm(form: FormDataCommon, value: RpcSerializedValue) {\n form.append(\"objects\", value.objects);\n\n for (let i = 0; i !== value.data.length; ++i) {\n this.platform.appendToForm(i, form, value);\n }\n }\n\n /** @internal */\n public static platform = {\n createStream(_value: RpcSerializedValue): ReadableFormData {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n async parseRequest(_req: HttpServerRequest): Promise<RpcSerializedValue> {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n appendToForm(i: number, form: FormDataCommon, value: RpcSerializedValue): void {\n form.append(`data-${i}`, new Blob([value.data[i]], { type: \"application/octet-stream\" }));\n },\n };\n}\n\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module RpcInterface
3
3
  */
4
- import { BackendReadable, BackendWritable } from "../../BackendTypes";
4
+ import { BackendReadable, BackendWritable } from "../../internal/BackendTypes";
5
5
  import { RpcConfiguration } from "../core/RpcConfiguration";
6
6
  import { RpcContentType, RpcRequestStatus } from "../core/RpcConstants";
7
7
  import { RpcOperation } from "../core/RpcOperation";
@@ -1 +1 @@
1
- {"version":3,"file":"WebAppRpcProtocol.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcProtocol.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC;IAChB,OAAO,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAC;IAC7D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,WAAW,EAAE,MA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,SAAS,CAAC,IAAY;QAC3B,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB,KAAK,OAAO,IAAI,+BAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAO3E,mCAAmC;IACnC,YAAmB,aAA+B;QAChD,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,mCAAgB,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACrG,CAAC;CACF;AA/GD,8CA+GC","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 RpcInterface\n */\n\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { BackendReadable, BackendWritable } from \"../../BackendTypes\";\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\nimport { RpcContentType, RpcRequestStatus, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { RpcProtocol, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from \"./OpenAPI\";\nimport { WebAppRpcLogging } from \"./WebAppRpcLogging\";\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** An HTTP server request object.\n * @public\n * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerRequest extends BackendReadable {\n aborted: boolean;\n httpVersion: string;\n httpVersionMajor: number;\n httpVersionMinor: number;\n complete: boolean;\n connection: any;\n headers: { [header: string]: string | string[] | undefined };\n rawHeaders: string[];\n trailers: { [key: string]: string | undefined };\n trailersDistinct: NodeJS.Dict<string[]>;\n rawTrailers: string[];\n setTimeout(msecs: number, callback: () => void): void;\n setTimeout(msecs: number, callback: () => void): this;\n url?: string;\n statusCode?: number;\n statusMessage?: string;\n socket: any;\n destroy(error?: Error): this;\n body: string | Buffer;\n path: string;\n method: string;\n ip?: string;\n header: (field: string) => string | undefined;\n headersDistinct: NodeJS.Dict<string[]>;\n}\n\n/** An HTTP server response object.\n * @public\n * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerResponse extends BackendWritable {\n send(body?: any): HttpServerResponse;\n status(code: number): HttpServerResponse;\n set(field: string, value: string): void;\n}\n\n/** The HTTP application protocol.\n * @internal\n */\nexport abstract class WebAppRpcProtocol extends RpcProtocol {\n public override preserveStreams = true;\n\n /** Convenience handler for an RPC operation get request for an HTTP server. */\n public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) {\n return this.handleOperationPostRequest(req, res);\n }\n\n /** Convenience handler for an RPC operation post request for an HTTP server. */\n public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) {\n let request: SerializedRpcRequest;\n try {\n request = await WebAppRpcRequest.parseRequest(this, req);\n } catch (error) {\n const message = BentleyError.getErrorMessage(error);\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `Failed to parse request: ${message}`, BentleyError.getErrorMetadata(error));\n res.status(400);\n res.send(JSON.stringify({ message, isError: true }));\n return;\n }\n const fulfillment = await this.fulfill(request);\n await WebAppRpcRequest.sendResponse(this, request, fulfillment, req, res);\n }\n\n /** Convenience handler for an OpenAPI description request for an HTTP server. */\n public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) {\n const description = JSON.stringify(this.openAPIDescription);\n res.send(description);\n }\n\n /** Converts an HTTP content type value to an RPC content type value. */\n public static computeContentType(httpType: string | null | undefined): RpcContentType {\n if (!httpType)\n return RpcContentType.Unknown;\n\n if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) {\n return RpcContentType.Text;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) {\n return RpcContentType.Binary;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) {\n return RpcContentType.Multipart;\n } else {\n return RpcContentType.Unknown;\n }\n }\n\n /** The OpenAPI-compatible info object for this protocol. */\n public abstract info: OpenAPIInfo;\n\n /** An optional prefix for RPC operation URI paths. */\n public pathPrefix: string = \"\";\n\n /** The RPC request class for this protocol. */\n public readonly requestType = WebAppRpcRequest;\n\n /** Supplies the status corresponding to a protocol-specific code value. */\n public override getStatus(code: number): RpcRequestStatus {\n switch (code) {\n case 404: return RpcRequestStatus.NotFound;\n case 202: return RpcRequestStatus.Pending;\n case 200: return RpcRequestStatus.Resolved;\n case 500: return RpcRequestStatus.Rejected;\n case 204: return RpcRequestStatus.NoContent;\n case 502: return RpcRequestStatus.BadGateway;\n case 503: return RpcRequestStatus.ServiceUnavailable;\n case 504: return RpcRequestStatus.GatewayTimeout;\n case 408: return RpcRequestStatus.RequestTimeout;\n case 429: return RpcRequestStatus.TooManyRequests;\n default: return RpcRequestStatus.Unknown;\n }\n }\n\n /** Supplies the protocol-specific code corresponding to a status value. */\n public override getCode(status: RpcRequestStatus): number {\n switch (status) {\n case RpcRequestStatus.NotFound: return 404;\n case RpcRequestStatus.Pending: return 202;\n case RpcRequestStatus.Resolved: return 200;\n case RpcRequestStatus.Rejected: return 500;\n case RpcRequestStatus.NoContent: return 204;\n case RpcRequestStatus.BadGateway: return 502;\n case RpcRequestStatus.ServiceUnavailable: return 503;\n case RpcRequestStatus.GatewayTimeout: return 504;\n case RpcRequestStatus.RequestTimeout: return 408;\n case RpcRequestStatus.TooManyRequests: return 429;\n default: return 501;\n }\n }\n\n public override supportsStatusCategory = true;\n\n /** Whether an HTTP status code indicates a request timeout. */\n public isTimeout(code: number): boolean {\n return code === 504;\n }\n\n /** An OpenAPI-compatible description of this protocol.\n * @internal\n */\n public get openAPIDescription() { return new RpcOpenAPIDescription(this); }\n\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\n * @internal\n */\n public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];\n\n /** Constructs an HTTP protocol. */\n public constructor(configuration: RpcConfiguration) {\n super(configuration);\n this.events.addListener(async (event, object) => WebAppRpcLogging.logProtocolEvent(event, object));\n }\n}\n"]}
1
+ {"version":3,"file":"WebAppRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAC3D,qEAAkE;AAGlE,uDAA2F;AAE3F,qDAAwE;AACxE,uCAAiF;AACjF,yDAAsD;AACtD,yDAAsD;AA6CtD;;GAEG;AACH,MAAsB,iBAAkB,SAAQ,yBAAW;IACzC,eAAe,GAAG,IAAI,CAAC;IAEvC,+EAA+E;IACxE,KAAK,CAAC,yBAAyB,CAAC,GAAsB,EAAE,GAAuB;QACpF,OAAO,IAAI,CAAC,0BAA0B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,gFAAgF;IACzE,KAAK,CAAC,0BAA0B,CAAC,GAAsB,EAAE,GAAuB;QACrF,IAAI,OAA6B,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,mCAAgB,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,2BAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YACpD,qBAAM,CAAC,QAAQ,CAAC,2CAAoB,CAAC,mBAAmB,EAAE,4BAA4B,OAAO,EAAE,EAAE,2BAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;YACvI,GAAG,CAAC,MAAM,C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AC,CAAC,OAAO,GAAG,CAAC;YAC7C,KAAK,+BAAgB,CAAC,kBAAkB,CAAC,CAAC,OAAO,GAAG,CAAC;YACrD,KAAK,+BAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,CAAC;YACjD,KAAK,+BAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,CAAC;YACjD,KAAK,+BAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,GAAG,CAAC;YAClD,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC;QACtB,CAAC;IACH,CAAC;IAEe,sBAAsB,GAAG,IAAI,CAAC;IAE9C,+DAA+D;IACxD,SAAS,CAAC,IAAY;QAC3B,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB,KAAK,OAAO,IAAI,+BAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAO3E,mCAAmC;IACnC,YAAmB,aAA+B;QAChD,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,mCAAgB,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACrG,CAAC;CACF;AA/GD,8CA+GC","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 RpcInterface\n */\n\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { BackendReadable, BackendWritable } from \"../../internal/BackendTypes\";\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\nimport { RpcContentType, RpcRequestStatus, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { RpcProtocol, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from \"./OpenAPI\";\nimport { WebAppRpcLogging } from \"./WebAppRpcLogging\";\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** An HTTP server request object.\n * @public\n * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerRequest extends BackendReadable {\n aborted: boolean;\n httpVersion: string;\n httpVersionMajor: number;\n httpVersionMinor: number;\n complete: boolean;\n connection: any;\n headers: { [header: string]: string | string[] | undefined };\n rawHeaders: string[];\n trailers: { [key: string]: string | undefined };\n trailersDistinct: NodeJS.Dict<string[]>;\n rawTrailers: string[];\n setTimeout(msecs: number, callback: () => void): void;\n setTimeout(msecs: number, callback: () => void): this;\n url?: string;\n statusCode?: number;\n statusMessage?: string;\n socket: any;\n destroy(error?: Error): this;\n body: string | Buffer;\n path: string;\n method: string;\n ip?: string;\n header: (field: string) => string | undefined;\n headersDistinct: NodeJS.Dict<string[]>;\n}\n\n/** An HTTP server response object.\n * @public\n * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerResponse extends BackendWritable {\n send(body?: any): HttpServerResponse;\n status(code: number): HttpServerResponse;\n set(field: string, value: string): void;\n}\n\n/** The HTTP application protocol.\n * @internal\n */\nexport abstract class WebAppRpcProtocol extends RpcProtocol {\n public override preserveStreams = true;\n\n /** Convenience handler for an RPC operation get request for an HTTP server. */\n public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) {\n return this.handleOperationPostRequest(req, res);\n }\n\n /** Convenience handler for an RPC operation post request for an HTTP server. */\n public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) {\n let request: SerializedRpcRequest;\n try {\n request = await WebAppRpcRequest.parseRequest(this, req);\n } catch (error) {\n const message = BentleyError.getErrorMessage(error);\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `Failed to parse request: ${message}`, BentleyError.getErrorMetadata(error));\n res.status(400);\n res.send(JSON.stringify({ message, isError: true }));\n return;\n }\n const fulfillment = await this.fulfill(request);\n await WebAppRpcRequest.sendResponse(this, request, fulfillment, req, res);\n }\n\n /** Convenience handler for an OpenAPI description request for an HTTP server. */\n public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) {\n const description = JSON.stringify(this.openAPIDescription);\n res.send(description);\n }\n\n /** Converts an HTTP content type value to an RPC content type value. */\n public static computeContentType(httpType: string | null | undefined): RpcContentType {\n if (!httpType)\n return RpcContentType.Unknown;\n\n if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) {\n return RpcContentType.Text;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) {\n return RpcContentType.Binary;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) {\n return RpcContentType.Multipart;\n } else {\n return RpcContentType.Unknown;\n }\n }\n\n /** The OpenAPI-compatible info object for this protocol. */\n public abstract info: OpenAPIInfo;\n\n /** An optional prefix for RPC operation URI paths. */\n public pathPrefix: string = \"\";\n\n /** The RPC request class for this protocol. */\n public readonly requestType = WebAppRpcRequest;\n\n /** Supplies the status corresponding to a protocol-specific code value. */\n public override getStatus(code: number): RpcRequestStatus {\n switch (code) {\n case 404: return RpcRequestStatus.NotFound;\n case 202: return RpcRequestStatus.Pending;\n case 200: return RpcRequestStatus.Resolved;\n case 500: return RpcRequestStatus.Rejected;\n case 204: return RpcRequestStatus.NoContent;\n case 502: return RpcRequestStatus.BadGateway;\n case 503: return RpcRequestStatus.ServiceUnavailable;\n case 504: return RpcRequestStatus.GatewayTimeout;\n case 408: return RpcRequestStatus.RequestTimeout;\n case 429: return RpcRequestStatus.TooManyRequests;\n default: return RpcRequestStatus.Unknown;\n }\n }\n\n /** Supplies the protocol-specific code corresponding to a status value. */\n public override getCode(status: RpcRequestStatus): number {\n switch (status) {\n case RpcRequestStatus.NotFound: return 404;\n case RpcRequestStatus.Pending: return 202;\n case RpcRequestStatus.Resolved: return 200;\n case RpcRequestStatus.Rejected: return 500;\n case RpcRequestStatus.NoContent: return 204;\n case RpcRequestStatus.BadGateway: return 502;\n case RpcRequestStatus.ServiceUnavailable: return 503;\n case RpcRequestStatus.GatewayTimeout: return 504;\n case RpcRequestStatus.RequestTimeout: return 408;\n case RpcRequestStatus.TooManyRequests: return 429;\n default: return 501;\n }\n }\n\n public override supportsStatusCategory = true;\n\n /** Whether an HTTP status code indicates a request timeout. */\n public isTimeout(code: number): boolean {\n return code === 504;\n }\n\n /** An OpenAPI-compatible description of this protocol.\n * @internal\n */\n public get openAPIDescription() { return new RpcOpenAPIDescription(this); }\n\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\n * @internal\n */\n public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];\n\n /** Constructs an HTTP protocol. */\n public constructor(configuration: RpcConfiguration) {\n super(configuration);\n this.events.addListener(async (event, object) => WebAppRpcLogging.logProtocolEvent(event, object));\n }\n}\n"]}
package/lib/esm/Code.d.ts CHANGED
@@ -279,10 +279,5 @@ export declare class CodeSpec {
279
279
  */
280
280
  get scopeReq(): CodeScopeSpec.ScopeRequirement;
281
281
  set scopeReq(req: CodeScopeSpec.ScopeRequirement);
282
- /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.
283
- * @deprecated in 3.6 Use scopeReq instead.
284
- */
285
- get isManagedWithIModel(): boolean;
286
- set isManagedWithIModel(value: boolean);
287
282
  }
288
283
  //# sourceMappingURL=Code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAA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AE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,kBAAkB,GAAG,QAAQ;IAIrH,wDAAwD;IACxD,IAAW,OAAO,IAAI,OAAO,CAAkC;IAC/D,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,uCAAuC;IACvC,IAAW,SAAS,IAAI,aAAa,CAAC,IAAI,CAA2C;IACrF,IAAW,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,EAAiD;IAEnG;;OAEG;IACH,IAAW,QAAQ,IAAI,aAAa,CAAC,gBAAgB,CAEpD;IACD,IAAW,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC,gBAAgB,EAKtD;CACF"}
package/lib/esm/Code.js CHANGED
@@ -277,16 +277,5 @@ export class CodeSpec {
277
277
  else
278
278
  this.properties.scopeSpec.fGuidRequired = undefined;
279
279
  }
280
- /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.
281
- * @deprecated in 3.6 Use scopeReq instead.
282
- */
283
- get isManagedWithIModel() {
284
- return this.properties.spec?.isManagedWithDgnDb ?? true;
285
- }
286
- set isManagedWithIModel(value) {
287
- if (!this.properties.spec)
288
- this.properties.spec = {};
289
- this.properties.spec.isManagedWithDgnDb = value;
290
- }
291
280
  }
292
281
  //# sourceMappingURL=Code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAwB9E;;;GAGG;AACH,MAAM,OAAO,IAAI;IACf,8FAA8F;IACvF,IAAI,CAAa;IACxB,+FAA+F;IACxF,KAAK,CAAa;IACzB;;OAEG;IACH,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,IAAW,KAAK,CAAC,GAAW,IAAI,IAAI,CAAC,MAAM,G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AAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;IAEnG;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC5I,CAAC;IACD,IAAW,QAAQ,CAAC,GAAmC;QACrD,IAAI,aAAa,CAAC,gBAAgB,CAAC,cAAc,KAAK,GAAG;YACvD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;;YAE/C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,kBAAkB,IAAI,IAAI,CAAC;IAC1D,CAAC;IACD,IAAW,mBAAmB,CAAC,KAAc;QAC3C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,EAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClD,CAAC;CACF","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 Codes\n */\n\nimport { GuidString, Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport { IModel } from \"./IModel\";\n\n/**\n * The ElementId of the element that defines the scope for a Code value.\n * @note For insert or update, you may supply the FederationGuid of the scope element and it will be converted to the ElementId of that element.\n * @public\n * @extensions\n */\nexport type CodeScopeProps = Id64String | GuidString;\n\n/** The parameters that define a Code\n * @public\n * @extensions\n */\nexport interface CodeProps {\n /** Either the stringified 64-bit Id of the CodeSpec for this code, or the name of the CodeSpec. */\n spec: Id64String | string;\n /** Either the ElementId or the FederationGuid of the element that provides the scope for this code. */\n scope: CodeScopeProps;\n /** the value of this code. May be undefined. */\n value?: string;\n}\n\n/**\n * A three-part structure containing information about the [Code]($docs/bis/guide/fundamentals/codes) of an Element\n * @public\n */\nexport class Code implements CodeProps {\n /** The id of the [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec) of the Element */\n public spec: Id64String;\n /** The [CodeScope]($docs/bis/guide/fundamentals/codes.md#codescope-property) of the Element */\n public scope: Id64String;\n /** The [CodeValue]($docs/bis/guide/fundamentals/codes.md#codevalue-property) of the Element\n * @note Leading and trailing whitespace is invalid so is automatically trimmed.\n */\n public get value() { return this._value ?? \"\"; }\n public set value(val: string) { this._value = val?.trim(); }\n private _value?: string;\n\n constructor(codeProps: CodeProps) {\n this.spec = Id64.fromJSON(codeProps.spec);\n this.scope = JsonUtils.asString(codeProps.scope);\n this.value = JsonUtils.asString(codeProps.value);\n }\n\n /** Create an empty, non-unique code with no special meaning. */\n public static createEmpty(): Code {\n const id = Id64.fromLocalAndBriefcaseIds(1, 0);\n return new Code({ spec: id, scope: id });\n }\n\n public static fromJSON(json?: any): Code { return json ? new Code(json) : Code.createEmpty(); }\n public toJSON(): CodeProps { return { spec: this.spec, scope: this.scope, value: this.value }; }\n public equals(other: Code): boolean { return Code.equalCodes(this, other); }\n /** @internal */\n public static equalCodes(c1: CodeProps, c2: CodeProps): boolean {\n return c1.spec === c2.spec && c1.scope === c2.scope && c1.value === c2.value;\n }\n /** Determine whether this Code is valid. */\n public static isValid(c: CodeProps): boolean { return Id64.isValidId64(c.spec); }\n /** Determine if this code is valid but not otherwise meaningful (and therefore not necessarily unique) */\n public static isEmpty(c: CodeProps): boolean { return this.isValid(c) && (c.value === undefined || c.value === \"\"); }\n\n public toString(): string { return `[Code: ${this.spec}, ${this.scope}, ${this.value}]`; }\n}\n\n/** Names of the internal BIS CodeSpecs. These names match those specified by the native library.\n * For other domains, the best practice is to include the domain name or alias as part of the CodeSpec name to ensure global uniqueness.\n * @public\n* @extensions\n* @see [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec)\n */\nexport enum BisCodeSpec {\n /** The name of the standard [[CodeSpec]] used when creating *empty* codes.\n * @see [[Code.createEmpty]]\n */\n nullCodeSpec = \"bis:NullCodeSpec\",\n /** @internal */\n annotationFrameStyle = \"bis:AnnotationFrameStyle\",\n /** @internal */\n annotationLeaderStyle = \"bis:AnnotationLeaderStyle\",\n /** @internal */\n annotationTextStyle = \"bis:AnnotationTextStyle\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem2d]($backend) elements.\n * @see [AuxCoordSystem2d.createCode]($backend)\n */\n auxCoordSystem2d = \"bis:AuxCoordSystem2d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem3d]($backend) elements.\n * @see [AuxCoordSystem3d.createCode]($backend)\n */\n auxCoordSystem3d = \"bis:AuxCoordSystem3d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystemSpatial]($backend) elements.\n * @see [AuxCoordSystemSpatial.createCode]($backend)\n */\n auxCoordSystemSpatial = \"bis:AuxCoordSystemSpatial\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [CategorySelector]($backend) elements.\n * @see [CategorySelector.createCode]($backend)\n */\n categorySelector = \"bis:CategorySelector\",\n /** @internal */\n colorBook = \"bis:ColorBook\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [DisplayStyle]($backend) elements.\n * @see [DisplayStyle.createCode]($backend)\n */\n displayStyle = \"bis:DisplayStyle\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Drawing]($backend) elements.\n * @see [Drawing.createCode]($backend)\n */\n drawing = \"bis:Drawing\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [DrawingCategory]($backend) elements.\n * @see [DrawingCategory.createCode]($backend)\n */\n drawingCategory = \"bis:DrawingCategory\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSource]($backend) elements.\n * @note This CodeSpec is not automatically created, so use [ExternalSource.ensureCodeSpec]($backend) to make sure that it exists.\n * @see [ExternalSource.createCode]($backend)\n */\n externalSource = \"bis:ExternalSource\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSourceAttachment]($backend) elements.\n * @note This CodeSpec is not automatically created, so use [ExternalSourceAttachment.ensureCodeSpec]($backend) to make sure that it exists.\n * @see [ExternalSource.createCode]($backend)\n */\n externalSourceAttachment = \"bis:ExternalSourceAttachment\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [GeometryPart]($backend) elements.\n * @see [GeometryPart.createCode]($backend)\n */\n geometryPart = \"bis:GeometryPart\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [GraphicalType2d]($backend) elements.\n * @see [GraphicalType2d.createCode]($backend)\n */\n graphicalType2d = \"bis:GraphicalType2d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [LineStyle]($backend) elements.\n * @see [LineStyle.createCode]($backend)\n */\n lineStyle = \"bis:LineStyle\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [LinkElement]($backend) elements.\n * @see [LinkElement.createCode]($backend)\n */\n linkElement = \"bis:LinkElement\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ModelSelector]($backend) elements.\n * @see [ModelSelector.createCode]($backend)\n */\n modelSelector = \"bis:ModelSelector\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalMaterial]($backend) elements.\n * @see [PhysicalMaterial.createCode]($backend)\n */\n physicalMaterial = \"bis:PhysicalMaterial\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalType]($backend) elements.\n * @see [PhysicalType.createCode]($backend)\n */\n physicalType = \"bis:PhysicalType\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [InformationPartitionElement]($backend) elements.\n * @see [InformationPartitionElement.createCode]($backend)\n */\n informationPartitionElement = \"bis:InformationPartitionElement\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [RenderMaterialElement]($backend) elements.\n * @see [RenderMaterialElement.createCode]($backend)\n */\n renderMaterial = \"bis:RenderMaterial\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Sheet]($backend) elements.\n * @see [Sheet.createCode]($backend)\n */\n sheet = \"bis:Sheet\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SheetIndex]($backend) elements.\n * @see [SheetIndex.createCode]($backend)\n */\n sheetIndex = \"bis:SheetIndex\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SheetIndexEntry]($backend) elements.\n * @see [SheetIndexEntry.createCode]($backend)\n */\n sheetIndexEntry = \"bis:SheetIndexEntry\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialCategory]($backend) elements.\n * @see [SpatialCategory.createCode]($backend)\n */\n spatialCategory = \"bis:SpatialCategory\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialLocationType]($backend) elements.\n * @see [SpatialLocationType.createCode]($backend)\n */\n spatialLocationType = \"bis:SpatialLocationType\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SubCategory]($backend) elements.\n * @see [SubCategory.createCode]($backend)\n */\n subCategory = \"bis:SubCategory\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Subject]($backend) elements.\n * @see [Subject.createCode]($backend)\n */\n subject = \"bis:Subject\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe2d]($backend) elements.\n * @see [TemplateRecipe2d.createCode]($backend)\n */\n templateRecipe2d = \"bis:TemplateRecipe2d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe3d]($backend) elements.\n * @see [TemplateRecipe3d.createCode]($backend)\n */\n templateRecipe3d = \"bis:TemplateRecipe3d\",\n /** @internal */\n textAnnotationSeed = \"bis:TextAnnotationSeed\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Texture]($backend) elements.\n * @see [Texture.createCode]($backend)\n */\n texture = \"bis:Texture\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ViewDefinition]($backend) elements.\n * @see [ViewDefinition.createCode]($backend)\n */\n viewDefinition = \"bis:ViewDefinition\",\n}\n\n/** The scope of the Code.\n * @public\n */\nexport namespace CodeScopeSpec {\n /** The standard ways the CodeScope can be specified.\n * @public\n */\n export enum Type {\n /** The Code value must be unique within (at least) the iModel repository */\n Repository = 1,\n /** The Code value must be unique within the scope of the Model */\n Model = 2,\n /** The Code value must be unique among other children of the same parent element */\n ParentElement = 3,\n /** The Code value must be unique among other elements also scoped by the same element */\n RelatedElement = 4,\n }\n\n /**\n * Requirements for how the CodeScope Element is identified.\n * @public\n */\n export enum ScopeRequirement {\n /** The ElementId of CodeScope element identifies its scope. Used for Codes that are unique only within a single iModel. */\n ElementId = 1,\n /** The FederationGuid of the CodeScope element identifies its scope. Used for Codes that are globally unique. */\n FederationGuid = 2,\n }\n}\n\n/**\n * The JSON properties of a CodeSpec\n * @public\n */\nexport interface CodeSpecProperties {\n scopeSpec: {\n /** the type of CodeSpec */\n type: CodeScopeSpec.Type;\n /** If true, the federationGuid of the scope element identifies the scope, for Codes that are globally unique.\n * Otherwise, the ElementId of the scopeElement is used, for Codes that are scoped only within a single iModel.\n */\n fGuidRequired?: boolean;\n /** The relationship className (in the form \"schema:class\"), when `type` is `CodeScopeSpec.Type.RelatedElement` */\n relationship?: string;\n };\n spec?: {\n isManagedWithDgnDb?: boolean;\n };\n version?: string;\n}\n\n/** A [Code Specification]($docs/bis/guide/references/glossary#codespec) captures the rules for encoding and decoding significant business information into\n * and from a Code (string). This specification is used to generate and validate Codes.\n *\n * A CodeSpec defines the format of a Code for a certain type of Element in an IModel.\n * A CodeSpec can identify an external system that maintains and/or assigns Codes.\n * @public\n */\nexport class CodeSpec {\n /** The iModel holding this CodeSpec. */\n public iModel: IModel;\n /** The id of this CodeSpec. */\n public id: Id64String;\n /** The name of this CodeSpec. */\n public name: string;\n /** The JSON properties for this CodeSpec.\n * @note Use the getters and setters instead of accessing this directly.\n * @internal\n */\n public properties: CodeSpecProperties;\n\n private constructor(iModel: IModel, id: Id64String, name: string, properties?: CodeSpecProperties) {\n this.iModel = iModel;\n this.id = id;\n this.name = name;\n this.properties = properties ?? { scopeSpec: { type: CodeScopeSpec.Type.Repository } };\n }\n\n /** Create a new CodeSpec from the specified parameters\n * > Note: CodeSpec.id will not be valid until inserted\n * @see [CodeSpecs.insert]($backend)\n */\n public static create(iModel: IModel, name: string, scopeType: CodeScopeSpec.Type, scopeReq?: CodeScopeSpec.ScopeRequirement): CodeSpec {\n const props: CodeSpecProperties = { scopeSpec: { type: scopeType } };\n if (scopeReq)\n props.scopeSpec.fGuidRequired = scopeReq === CodeScopeSpec.ScopeRequirement.FederationGuid;\n\n return new CodeSpec(iModel, Id64.invalid, name, props);\n }\n\n /** Create a new CodeSpec directly from JSON. Used internally by the CodeSpecs.load function.\n * @internal\n */\n public static createFromJson(iModel: IModel, id: Id64String, name: string, properties?: CodeSpecProperties): CodeSpec {\n return new CodeSpec(iModel, id, name, properties);\n }\n\n /** Will be true if the id of this CodeSpec is valid. */\n public get isValid(): boolean { return Id64.isValid(this.id); }\n public get isExternal(): boolean {\n return true === this.properties.scopeSpec.fGuidRequired;\n }\n\n /** The scope type of this CodeSpec. */\n public get scopeType(): CodeScopeSpec.Type { return this.properties.scopeSpec.type; }\n public set scopeType(scopeType: CodeScopeSpec.Type) { this.properties.scopeSpec.type = scopeType; }\n\n /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or\n * CodeScopeSpec.ScopeRequirement.ElementId` otherwise (the default).\n */\n public get scopeReq(): CodeScopeSpec.ScopeRequirement {\n return this.properties.scopeSpec.fGuidRequired ? CodeScopeSpec.ScopeRequirement.FederationGuid : CodeScopeSpec.ScopeRequirement.ElementId;\n }\n public set scopeReq(req: CodeScopeSpec.ScopeRequirement) {\n if (CodeScopeSpec.ScopeRequirement.FederationGuid === req)\n this.properties.scopeSpec.fGuidRequired = true;\n else\n this.properties.scopeSpec.fGuidRequired = undefined;\n }\n\n /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.\n * @deprecated in 3.6 Use scopeReq instead.\n */\n public get isManagedWithIModel(): boolean {\n return this.properties.spec?.isManagedWithDgnDb ?? true;\n }\n public set isManagedWithIModel(value: boolean) {\n if (!this.properties.spec)\n this.properties.spec = {};\n\n this.properties.spec.isManagedWithDgnDb = value;\n }\n}\n"]}
1
+ {"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAwB9E;;;GAGG;AACH,MAAM,OAAO,IAAI;IACf,8FAA8F;IACvF,IAAI,CAAa;IACxB,+FAA+F;IACxF,KAAK,CAAa;IACzB;;OAEG;IACH,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,IAAW,KAAK,CAAC,GAAW,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACpD,MAAM,CAAU;IAExB,YAAY,SAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,gEAAgE;IACzD,MAAM,CAAC,WAAW;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/C,OAAO,IAAI,IAAI,CAAC,EAAE,IAAI,E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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 Codes\n */\n\nimport { GuidString, Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport { IModel } from \"./IModel\";\n\n/**\n * The ElementId of the element that defines the scope for a Code value.\n * @note For insert or update, you may supply the FederationGuid of the scope element and it will be converted to the ElementId of that element.\n * @public\n * @extensions\n */\nexport type CodeScopeProps = Id64String | GuidString;\n\n/** The parameters that define a Code\n * @public\n * @extensions\n */\nexport interface CodeProps {\n /** Either the stringified 64-bit Id of the CodeSpec for this code, or the name of the CodeSpec. */\n spec: Id64String | string;\n /** Either the ElementId or the FederationGuid of the element that provides the scope for this code. */\n scope: CodeScopeProps;\n /** the value of this code. May be undefined. */\n value?: string;\n}\n\n/**\n * A three-part structure containing information about the [Code]($docs/bis/guide/fundamentals/codes) of an Element\n * @public\n */\nexport class Code implements CodeProps {\n /** The id of the [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec) of the Element */\n public spec: Id64String;\n /** The [CodeScope]($docs/bis/guide/fundamentals/codes.md#codescope-property) of the Element */\n public scope: Id64String;\n /** The [CodeValue]($docs/bis/guide/fundamentals/codes.md#codevalue-property) of the Element\n * @note Leading and trailing whitespace is invalid so is automatically trimmed.\n */\n public get value() { return this._value ?? \"\"; }\n public set value(val: string) { this._value = val?.trim(); }\n private _value?: string;\n\n constructor(codeProps: CodeProps) {\n this.spec = Id64.fromJSON(codeProps.spec);\n this.scope = JsonUtils.asString(codeProps.scope);\n this.value = JsonUtils.asString(codeProps.value);\n }\n\n /** Create an empty, non-unique code with no special meaning. */\n public static createEmpty(): Code {\n const id = Id64.fromLocalAndBriefcaseIds(1, 0);\n return new Code({ spec: id, scope: id });\n }\n\n public static fromJSON(json?: any): Code { return json ? new Code(json) : Code.createEmpty(); }\n public toJSON(): CodeProps { return { spec: this.spec, scope: this.scope, value: this.value }; }\n public equals(other: Code): boolean { return Code.equalCodes(this, other); }\n /** @internal */\n public static equalCodes(c1: CodeProps, c2: CodeProps): boolean {\n return c1.spec === c2.spec && c1.scope === c2.scope && c1.value === c2.value;\n }\n /** Determine whether this Code is valid. */\n public static isValid(c: CodeProps): boolean { return Id64.isValidId64(c.spec); }\n /** Determine if this code is valid but not otherwise meaningful (and therefore not necessarily unique) */\n public static isEmpty(c: CodeProps): boolean { return this.isValid(c) && (c.value === undefined || c.value === \"\"); }\n\n public toString(): string { return `[Code: ${this.spec}, ${this.scope}, ${this.value}]`; }\n}\n\n/** Names of the internal BIS CodeSpecs. These names match those specified by the native library.\n * For other domains, the best practice is to include the domain name or alias as part of the CodeSpec name to ensure global uniqueness.\n * @public\n* @extensions\n* @see [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec)\n */\nexport enum BisCodeSpec {\n /** The name of the standard [[CodeSpec]] used when creating *empty* codes.\n * @see [[Code.createEmpty]]\n */\n nullCodeSpec = \"bis:NullCodeSpec\",\n /** @internal */\n annotationFrameStyle = \"bis:AnnotationFrameStyle\",\n /** @internal */\n annotationLeaderStyle = \"bis:AnnotationLeaderStyle\",\n /** @internal */\n annotationTextStyle = \"bis:AnnotationTextStyle\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem2d]($backend) elements.\n * @see [AuxCoordSystem2d.createCode]($backend)\n */\n auxCoordSystem2d = \"bis:AuxCoordSystem2d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem3d]($backend) elements.\n * @see [AuxCoordSystem3d.createCode]($backend)\n */\n auxCoordSystem3d = \"bis:AuxCoordSystem3d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystemSpatial]($backend) elements.\n * @see [AuxCoordSystemSpatial.createCode]($backend)\n */\n auxCoordSystemSpatial = \"bis:AuxCoordSystemSpatial\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [CategorySelector]($backend) elements.\n * @see [CategorySelector.createCode]($backend)\n */\n categorySelector = \"bis:CategorySelector\",\n /** @internal */\n colorBook = \"bis:ColorBook\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [DisplayStyle]($backend) elements.\n * @see [DisplayStyle.createCode]($backend)\n */\n displayStyle = \"bis:DisplayStyle\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Drawing]($backend) elements.\n * @see [Drawing.createCode]($backend)\n */\n drawing = \"bis:Drawing\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [DrawingCategory]($backend) elements.\n * @see [DrawingCategory.createCode]($backend)\n */\n drawingCategory = \"bis:DrawingCategory\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSource]($backend) elements.\n * @note This CodeSpec is not automatically created, so use [ExternalSource.ensureCodeSpec]($backend) to make sure that it exists.\n * @see [ExternalSource.createCode]($backend)\n */\n externalSource = \"bis:ExternalSource\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSourceAttachment]($backend) elements.\n * @note This CodeSpec is not automatically created, so use [ExternalSourceAttachment.ensureCodeSpec]($backend) to make sure that it exists.\n * @see [ExternalSource.createCode]($backend)\n */\n externalSourceAttachment = \"bis:ExternalSourceAttachment\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [GeometryPart]($backend) elements.\n * @see [GeometryPart.createCode]($backend)\n */\n geometryPart = \"bis:GeometryPart\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [GraphicalType2d]($backend) elements.\n * @see [GraphicalType2d.createCode]($backend)\n */\n graphicalType2d = \"bis:GraphicalType2d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [LineStyle]($backend) elements.\n * @see [LineStyle.createCode]($backend)\n */\n lineStyle = \"bis:LineStyle\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [LinkElement]($backend) elements.\n * @see [LinkElement.createCode]($backend)\n */\n linkElement = \"bis:LinkElement\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ModelSelector]($backend) elements.\n * @see [ModelSelector.createCode]($backend)\n */\n modelSelector = \"bis:ModelSelector\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalMaterial]($backend) elements.\n * @see [PhysicalMaterial.createCode]($backend)\n */\n physicalMaterial = \"bis:PhysicalMaterial\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalType]($backend) elements.\n * @see [PhysicalType.createCode]($backend)\n */\n physicalType = \"bis:PhysicalType\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [InformationPartitionElement]($backend) elements.\n * @see [InformationPartitionElement.createCode]($backend)\n */\n informationPartitionElement = \"bis:InformationPartitionElement\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [RenderMaterialElement]($backend) elements.\n * @see [RenderMaterialElement.createCode]($backend)\n */\n renderMaterial = \"bis:RenderMaterial\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Sheet]($backend) elements.\n * @see [Sheet.createCode]($backend)\n */\n sheet = \"bis:Sheet\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SheetIndex]($backend) elements.\n * @see [SheetIndex.createCode]($backend)\n */\n sheetIndex = \"bis:SheetIndex\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SheetIndexEntry]($backend) elements.\n * @see [SheetIndexEntry.createCode]($backend)\n */\n sheetIndexEntry = \"bis:SheetIndexEntry\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialCategory]($backend) elements.\n * @see [SpatialCategory.createCode]($backend)\n */\n spatialCategory = \"bis:SpatialCategory\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialLocationType]($backend) elements.\n * @see [SpatialLocationType.createCode]($backend)\n */\n spatialLocationType = \"bis:SpatialLocationType\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [SubCategory]($backend) elements.\n * @see [SubCategory.createCode]($backend)\n */\n subCategory = \"bis:SubCategory\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Subject]($backend) elements.\n * @see [Subject.createCode]($backend)\n */\n subject = \"bis:Subject\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe2d]($backend) elements.\n * @see [TemplateRecipe2d.createCode]($backend)\n */\n templateRecipe2d = \"bis:TemplateRecipe2d\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe3d]($backend) elements.\n * @see [TemplateRecipe3d.createCode]($backend)\n */\n templateRecipe3d = \"bis:TemplateRecipe3d\",\n /** @internal */\n textAnnotationSeed = \"bis:TextAnnotationSeed\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [Texture]($backend) elements.\n * @see [Texture.createCode]($backend)\n */\n texture = \"bis:Texture\",\n /** The name of the standard [[CodeSpec]] used when creating codes for [ViewDefinition]($backend) elements.\n * @see [ViewDefinition.createCode]($backend)\n */\n viewDefinition = \"bis:ViewDefinition\",\n}\n\n/** The scope of the Code.\n * @public\n */\nexport namespace CodeScopeSpec {\n /** The standard ways the CodeScope can be specified.\n * @public\n */\n export enum Type {\n /** The Code value must be unique within (at least) the iModel repository */\n Repository = 1,\n /** The Code value must be unique within the scope of the Model */\n Model = 2,\n /** The Code value must be unique among other children of the same parent element */\n ParentElement = 3,\n /** The Code value must be unique among other elements also scoped by the same element */\n RelatedElement = 4,\n }\n\n /**\n * Requirements for how the CodeScope Element is identified.\n * @public\n */\n export enum ScopeRequirement {\n /** The ElementId of CodeScope element identifies its scope. Used for Codes that are unique only within a single iModel. */\n ElementId = 1,\n /** The FederationGuid of the CodeScope element identifies its scope. Used for Codes that are globally unique. */\n FederationGuid = 2,\n }\n}\n\n/**\n * The JSON properties of a CodeSpec\n * @public\n */\nexport interface CodeSpecProperties {\n scopeSpec: {\n /** the type of CodeSpec */\n type: CodeScopeSpec.Type;\n /** If true, the federationGuid of the scope element identifies the scope, for Codes that are globally unique.\n * Otherwise, the ElementId of the scopeElement is used, for Codes that are scoped only within a single iModel.\n */\n fGuidRequired?: boolean;\n /** The relationship className (in the form \"schema:class\"), when `type` is `CodeScopeSpec.Type.RelatedElement` */\n relationship?: string;\n };\n spec?: {\n isManagedWithDgnDb?: boolean;\n };\n version?: string;\n}\n\n/** A [Code Specification]($docs/bis/guide/references/glossary#codespec) captures the rules for encoding and decoding significant business information into\n * and from a Code (string). This specification is used to generate and validate Codes.\n *\n * A CodeSpec defines the format of a Code for a certain type of Element in an IModel.\n * A CodeSpec can identify an external system that maintains and/or assigns Codes.\n * @public\n */\nexport class CodeSpec {\n /** The iModel holding this CodeSpec. */\n public iModel: IModel;\n /** The id of this CodeSpec. */\n public id: Id64String;\n /** The name of this CodeSpec. */\n public name: string;\n /** The JSON properties for this CodeSpec.\n * @note Use the getters and setters instead of accessing this directly.\n * @internal\n */\n public properties: CodeSpecProperties;\n\n private constructor(iModel: IModel, id: Id64String, name: string, properties?: CodeSpecProperties) {\n this.iModel = iModel;\n this.id = id;\n this.name = name;\n this.properties = properties ?? { scopeSpec: { type: CodeScopeSpec.Type.Repository } };\n }\n\n /** Create a new CodeSpec from the specified parameters\n * > Note: CodeSpec.id will not be valid until inserted\n * @see [CodeSpecs.insert]($backend)\n */\n public static create(iModel: IModel, name: string, scopeType: CodeScopeSpec.Type, scopeReq?: CodeScopeSpec.ScopeRequirement): CodeSpec {\n const props: CodeSpecProperties = { scopeSpec: { type: scopeType } };\n if (scopeReq)\n props.scopeSpec.fGuidRequired = scopeReq === CodeScopeSpec.ScopeRequirement.FederationGuid;\n\n return new CodeSpec(iModel, Id64.invalid, name, props);\n }\n\n /** Create a new CodeSpec directly from JSON. Used internally by the CodeSpecs.load function.\n * @internal\n */\n public static createFromJson(iModel: IModel, id: Id64String, name: string, properties?: CodeSpecProperties): CodeSpec {\n return new CodeSpec(iModel, id, name, properties);\n }\n\n /** Will be true if the id of this CodeSpec is valid. */\n public get isValid(): boolean { return Id64.isValid(this.id); }\n public get isExternal(): boolean {\n return true === this.properties.scopeSpec.fGuidRequired;\n }\n\n /** The scope type of this CodeSpec. */\n public get scopeType(): CodeScopeSpec.Type { return this.properties.scopeSpec.type; }\n public set scopeType(scopeType: CodeScopeSpec.Type) { this.properties.scopeSpec.type = scopeType; }\n\n /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or\n * CodeScopeSpec.ScopeRequirement.ElementId` otherwise (the default).\n */\n public get scopeReq(): CodeScopeSpec.ScopeRequirement {\n return this.properties.scopeSpec.fGuidRequired ? CodeScopeSpec.ScopeRequirement.FederationGuid : CodeScopeSpec.ScopeRequirement.ElementId;\n }\n public set scopeReq(req: CodeScopeSpec.ScopeRequirement) {\n if (CodeScopeSpec.ScopeRequirement.FederationGuid === req)\n this.properties.scopeSpec.fGuidRequired = true;\n else\n this.properties.scopeSpec.fGuidRequired = undefined;\n }\n}\n"]}
@@ -365,33 +365,6 @@ export declare class FeatureOverrides implements FeatureAppearanceSource {
365
365
  isClassVisible(geomClass: GeometryClass): boolean;
366
366
  /** Specify overrides for all elements belonging to a specified [GeometricModel]($backend), or all geometry belonging to a specified [GeometricElement]($backend) or [SubCategory]($backend). */
367
367
  override(args: OverrideFeatureAppearanceArgs): void;
368
- /** Specify overrides for all elements within the specified model.
369
- * @param id The Id of the model.
370
- * @param app The symbology overrides.
371
- * @param replaceExisting Specifies whether to replace a pre-existing override for the same model.
372
- * @note These overrides take priority over all other overrides.
373
- * @note If [[defaultOverrides]] are defined, they will not apply to any element within this model, even if the supplied appearance overrides nothing.
374
- * @deprecated in 3.x. Use [[FeatureOverrides.override]].
375
- */
376
- overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void;
377
- /** Specify overrides for all geometry belonging to the specified [SubCategory]($backend).
378
- * @param id The Id of the subcategory.
379
- * @param app The symbology overrides.
380
- * @param replaceExisting Specifies whether to replace a pre-existing override for the same subcategory.
381
- * @note These overrides have lower priority than element and model overrides.
382
- * @note If [[defaultOverrides]] are defined, they will not apply to any geometry within this subcategory, even if the supplied appearance overrides nothing.
383
- * @deprecated in 3.x. Use [[FeatureOverrides.override]].
384
- */
385
- overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void;
386
- /** Specify overrides for all geometry originating from the specified element.
387
- * @param id The Id of the element.
388
- * @param app The symbology overrides.
389
- * @param replaceExisting Specifies whether to replace a pre-existing override for the same element.
390
- * @note These overrides take precedence over subcategory overrides, but not over model overrides.
391
- * @note If [[defaultOverrides]] are defined, they will not apply to this element, even if the supplied appearance overrides nothing.
392
- * @deprecated in 3.x. Use [[FeatureOverrides.override]].
393
- */
394
- overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void;
395
368
  /** Specify overrides for all geometry originating from the specified animation node.
396
369
  * @param id The Id of the animation node.
397
370
  * @param app The symbology overrides.