@itwin/core-backend 4.0.0-dev.48 → 4.0.0-dev.50

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 (246) hide show
  1. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  2. package/lib/cjs/AliCloudStorageService.js +71 -71
  3. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  4. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  5. package/lib/cjs/BackendHubAccess.js +41 -41
  6. package/lib/cjs/BackendHubAccess.js.map +1 -1
  7. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  8. package/lib/cjs/BackendLoggerCategory.js +99 -99
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BisCoreSchema.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  14. package/lib/cjs/BriefcaseManager.js +408 -408
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +153 -153
  17. package/lib/cjs/Category.js +243 -243
  18. package/lib/cjs/Category.js.map +1 -1
  19. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  20. package/lib/cjs/ChangeSummaryManager.js +446 -446
  21. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  22. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  23. package/lib/cjs/ChangedElementsDb.js +165 -165
  24. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  25. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  26. package/lib/cjs/ChangedElementsManager.js +88 -88
  27. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  28. package/lib/cjs/ChannelControl.d.ts +69 -69
  29. package/lib/cjs/ChannelControl.js +88 -88
  30. package/lib/cjs/ChannelControl.js.map +1 -1
  31. package/lib/cjs/CheckpointManager.d.ts +121 -121
  32. package/lib/cjs/CheckpointManager.js +351 -351
  33. package/lib/cjs/CheckpointManager.js.map +1 -1
  34. package/lib/cjs/ClassRegistry.d.ts +79 -79
  35. package/lib/cjs/ClassRegistry.js +249 -249
  36. package/lib/cjs/ClassRegistry.js.map +1 -1
  37. package/lib/cjs/CloudSqlite.d.ts +355 -355
  38. package/lib/cjs/CloudSqlite.js +154 -154
  39. package/lib/cjs/CloudSqlite.js.map +1 -1
  40. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  41. package/lib/cjs/CloudStorageBackend.js +170 -170
  42. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  43. package/lib/cjs/CodeService.d.ts +396 -396
  44. package/lib/cjs/CodeService.js +63 -63
  45. package/lib/cjs/CodeService.js.map +1 -1
  46. package/lib/cjs/CodeSpecs.d.ts +55 -55
  47. package/lib/cjs/CodeSpecs.js +124 -124
  48. package/lib/cjs/CodeSpecs.js.map +1 -1
  49. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  50. package/lib/cjs/ConcurrentQuery.js +36 -36
  51. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  52. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  53. package/lib/cjs/CustomViewState3dCreator.js +81 -81
  54. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  55. package/lib/cjs/DevTools.d.ts +73 -73
  56. package/lib/cjs/DevTools.js +156 -156
  57. package/lib/cjs/DevTools.js.map +1 -1
  58. package/lib/cjs/DisplayStyle.d.ts +106 -106
  59. package/lib/cjs/DisplayStyle.js +253 -253
  60. package/lib/cjs/DisplayStyle.js.map +1 -1
  61. package/lib/cjs/ECDb.d.ts +191 -191
  62. package/lib/cjs/ECDb.js +348 -348
  63. package/lib/cjs/ECDb.js.map +1 -1
  64. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  65. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  66. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  67. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  68. package/lib/cjs/ECSqlStatement.js +791 -791
  69. package/lib/cjs/ECSqlStatement.js.map +1 -1
  70. package/lib/cjs/Element.d.ts +1113 -1113
  71. package/lib/cjs/Element.js +1424 -1424
  72. package/lib/cjs/Element.js.map +1 -1
  73. package/lib/cjs/ElementAspect.d.ts +176 -176
  74. package/lib/cjs/ElementAspect.js +203 -203
  75. package/lib/cjs/ElementAspect.js.map +1 -1
  76. package/lib/cjs/ElementGraphics.d.ts +9 -9
  77. package/lib/cjs/ElementGraphics.js +41 -41
  78. package/lib/cjs/ElementGraphics.js.map +1 -1
  79. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  80. package/lib/cjs/ElementTreeWalker.js +409 -409
  81. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  82. package/lib/cjs/Entity.d.ts +106 -106
  83. package/lib/cjs/Entity.js +134 -134
  84. package/lib/cjs/Entity.js.map +1 -1
  85. package/lib/cjs/EntityReferences.d.ts +49 -49
  86. package/lib/cjs/EntityReferences.js +95 -95
  87. package/lib/cjs/EntityReferences.js.map +1 -1
  88. package/lib/cjs/ExportGraphics.d.ts +317 -317
  89. package/lib/cjs/ExportGraphics.js +208 -208
  90. package/lib/cjs/ExportGraphics.js.map +1 -1
  91. package/lib/cjs/ExternalSource.d.ts +96 -96
  92. package/lib/cjs/ExternalSource.js +131 -131
  93. package/lib/cjs/ExternalSource.js.map +1 -1
  94. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  95. package/lib/cjs/GeoCoordConfig.js +85 -85
  96. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  97. package/lib/cjs/GeometrySummary.d.ts +4 -4
  98. package/lib/cjs/GeometrySummary.js +380 -380
  99. package/lib/cjs/GeometrySummary.js.map +1 -1
  100. package/lib/cjs/HubMock.d.ts +94 -94
  101. package/lib/cjs/HubMock.js +220 -220
  102. package/lib/cjs/HubMock.js.map +1 -1
  103. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  104. package/lib/cjs/IModelCloneContext.js +15 -15
  105. package/lib/cjs/IModelCloneContext.js.map +1 -1
  106. package/lib/cjs/IModelDb.d.ts +1213 -1213
  107. package/lib/cjs/IModelDb.js +2380 -2380
  108. package/lib/cjs/IModelDb.js.map +1 -1
  109. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  110. package/lib/cjs/IModelElementCloneContext.js +159 -159
  111. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  112. package/lib/cjs/IModelHost.d.ts +369 -369
  113. package/lib/cjs/IModelHost.js +488 -488
  114. package/lib/cjs/IModelHost.js.map +1 -1
  115. package/lib/cjs/IModelJsFs.d.ts +62 -62
  116. package/lib/cjs/IModelJsFs.js +139 -139
  117. package/lib/cjs/IModelJsFs.js.map +1 -1
  118. package/lib/cjs/IpcHost.d.ts +104 -104
  119. package/lib/cjs/IpcHost.js +276 -276
  120. package/lib/cjs/IpcHost.js.map +1 -1
  121. package/lib/cjs/LineStyle.d.ts +311 -311
  122. package/lib/cjs/LineStyle.js +295 -295
  123. package/lib/cjs/LineStyle.js.map +1 -1
  124. package/lib/cjs/LocalHub.d.ts +162 -162
  125. package/lib/cjs/LocalHub.js +580 -580
  126. package/lib/cjs/LocalHub.js.map +1 -1
  127. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  128. package/lib/cjs/LocalhostIpcHost.js +79 -79
  129. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  130. package/lib/cjs/Material.d.ts +131 -131
  131. package/lib/cjs/Material.js +180 -180
  132. package/lib/cjs/Material.js.map +1 -1
  133. package/lib/cjs/Model.d.ts +392 -392
  134. package/lib/cjs/Model.js +489 -489
  135. package/lib/cjs/Model.js.map +1 -1
  136. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  137. package/lib/cjs/NativeAppStorage.js +202 -202
  138. package/lib/cjs/NativeAppStorage.js.map +1 -1
  139. package/lib/cjs/NativeHost.d.ts +52 -52
  140. package/lib/cjs/NativeHost.js +160 -160
  141. package/lib/cjs/NativeHost.js.map +1 -1
  142. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  143. package/lib/cjs/NavigationRelationship.js +225 -225
  144. package/lib/cjs/NavigationRelationship.js.map +1 -1
  145. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  146. package/lib/cjs/PromiseMemoizer.js +101 -101
  147. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  148. package/lib/cjs/PropertyStore.d.ts +132 -132
  149. package/lib/cjs/PropertyStore.js +11 -11
  150. package/lib/cjs/PropertyStore.js.map +1 -1
  151. package/lib/cjs/Relationship.d.ts +416 -416
  152. package/lib/cjs/Relationship.js +494 -494
  153. package/lib/cjs/Relationship.js.map +1 -1
  154. package/lib/cjs/RpcBackend.d.ts +5 -5
  155. package/lib/cjs/RpcBackend.js +32 -32
  156. package/lib/cjs/RpcBackend.js.map +1 -1
  157. package/lib/cjs/SQLiteDb.d.ts +219 -219
  158. package/lib/cjs/SQLiteDb.js +212 -212
  159. package/lib/cjs/SQLiteDb.js.map +1 -1
  160. package/lib/cjs/Schema.d.ts +55 -55
  161. package/lib/cjs/Schema.js +83 -83
  162. package/lib/cjs/Schema.js.map +1 -1
  163. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  164. package/lib/cjs/ServerBasedLocks.js +168 -168
  165. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  166. package/lib/cjs/SqliteStatement.d.ts +360 -360
  167. package/lib/cjs/SqliteStatement.js +586 -586
  168. package/lib/cjs/SqliteStatement.js.map +1 -1
  169. package/lib/cjs/Texture.d.ts +58 -58
  170. package/lib/cjs/Texture.js +82 -82
  171. package/lib/cjs/Texture.js.map +1 -1
  172. package/lib/cjs/TileStorage.d.ts +18 -18
  173. package/lib/cjs/TileStorage.js +87 -87
  174. package/lib/cjs/TileStorage.js.map +1 -1
  175. package/lib/cjs/TxnManager.d.ts +202 -202
  176. package/lib/cjs/TxnManager.js +356 -356
  177. package/lib/cjs/TxnManager.js.map +1 -1
  178. package/lib/cjs/ViewDefinition.d.ts +435 -435
  179. package/lib/cjs/ViewDefinition.js +646 -646
  180. package/lib/cjs/ViewDefinition.js.map +1 -1
  181. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  182. package/lib/cjs/ViewStateHydrator.js +103 -103
  183. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  184. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  185. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  186. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  187. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  188. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  189. package/lib/cjs/core-backend.d.ts +185 -185
  190. package/lib/cjs/core-backend.js +205 -205
  191. package/lib/cjs/core-backend.js.map +1 -1
  192. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  193. package/lib/cjs/domains/FunctionalElements.js +145 -145
  194. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  195. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  196. package/lib/cjs/domains/FunctionalSchema.js +39 -39
  197. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  198. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  199. package/lib/cjs/domains/GenericElements.js +263 -263
  200. package/lib/cjs/domains/GenericElements.js.map +1 -1
  201. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  202. package/lib/cjs/domains/GenericSchema.js +28 -28
  203. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  204. package/lib/cjs/rpc/multipart.d.ts +11 -11
  205. package/lib/cjs/rpc/multipart.js +71 -71
  206. package/lib/cjs/rpc/multipart.js.map +1 -1
  207. package/lib/cjs/rpc/tracing.d.ts +28 -28
  208. package/lib/cjs/rpc/tracing.js +73 -73
  209. package/lib/cjs/rpc/tracing.js.map +1 -1
  210. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  211. package/lib/cjs/rpc/web/logging.js +43 -43
  212. package/lib/cjs/rpc/web/logging.js.map +1 -1
  213. package/lib/cjs/rpc/web/request.d.ts +6 -6
  214. package/lib/cjs/rpc/web/request.js +73 -73
  215. package/lib/cjs/rpc/web/request.js.map +1 -1
  216. package/lib/cjs/rpc/web/response.d.ts +6 -6
  217. package/lib/cjs/rpc/web/response.js +105 -105
  218. package/lib/cjs/rpc/web/response.js.map +1 -1
  219. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  220. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  221. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  222. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  223. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +293 -293
  224. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  225. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  226. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -202
  227. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  228. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  229. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +166 -166
  230. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  231. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  232. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +42 -42
  233. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  234. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  235. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  236. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  237. package/lib/cjs/workspace/Settings.d.ts +186 -186
  238. package/lib/cjs/workspace/Settings.js +154 -154
  239. package/lib/cjs/workspace/Settings.js.map +1 -1
  240. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  241. package/lib/cjs/workspace/SettingsSchemas.js +190 -190
  242. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  243. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  244. package/lib/cjs/workspace/Workspace.js +537 -537
  245. package/lib/cjs/workspace/Workspace.js.map +1 -1
  246. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+D;AAC/D,oDAAgG;AAChG,uCAAoD;AAGpD;;;;;;;;;GASG;AACH,IAAiB,mBAAmB,CA6anC;AA7aD,WAAiB,mBAAmB;IAElC,4CAA4C;IAC5C,IAAY,aAaX;IAbD,WAAY,aAAa;QACvB,kEAAkE;QAClE,+DAAe,CAAA;QACf,+DAA+D;QAC/D,yDAAY,CAAA;QACZ,oEAAoE;QACpE,mEAAiB,CAAA;QACjB,kEAAkE;QAClE,+DAAe,CAAA;QACf,wEAAwE;QACxE,yDAAY,CAAA;QACZ,kEAAkE;QAClE,+DAAe,CAAA;IACjB,CAAC,EAbW,aAAa,GAAb,iCAAa,KAAb,iCAAa,QAaxB;IAED,oCAAoC;IACpC,IAAY,UAaX;IAbD,WAAY,UAAU;QACpB,sCAAsC;QACtC,yCAAU,CAAA;QACV,qCAAqC;QACrC,2CAAW,CAAA;QACX,mHAAmH;QACnH,yCAAU,CAAA;QACV,qNAAqN;QACrN,6CAAY,CAAA;QACZ,4CAA4C;QAC5C,yDAAkB,CAAA;QAClB,2CAA2C;QAC3C,wDAAiB,CAAA;IACnB,CAAC,EAbW,UAAU,GAAV,8BAAU,KAAV,8BAAU,QAarB;IAED,iFAAiF;IACjF,IAAY,WASX;IATD,WAAY,WAAW;QACrB,0CAA0C;QAC1C,6CAAQ,CAAA;QACR,wIAAwI;QACxI,6CAAQ,CA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,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR;oBACE,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;aACpE;YACD,MAAM,IAAI,GAAG,wBAAwB,QAAQ,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACzD,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5I,CAAC;KACF;IArJY,yBAAK,QAqJjB,CAAA;AACH,CAAC,EA7agB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QA6anC","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 Symbology\n */\n\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { FilePropertyProps, IModelError, LinePixels, LineStyleProps } from \"@itwin/core-common\";\nimport { GeometryPart, LineStyle } from \"./Element\";\nimport { IModelDb } from \"./IModelDb\";\n\n/** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.\n * There are three varieties of line styles:\n * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.\n * - A style using pre-defined pixel bit patterns [[LinePixels]] for dashed display (Code1-Code7).\n * - A style that uses a texture.\n *\n * A definition is defined by one or more components. A component is saved as a \"file property\" and can be referenced by other components. The line style definition references a component\n * by file property id and type and is saved as a dictionary element.\n * @public\n */\nexport namespace LineStyleDefinition {\n\n /** Line style component type identifiers */\n export enum ComponentType {\n /** Component type for [[LineStyleDefinition.PointSymbolProps]] */\n PointSymbol = 1,\n /** Component type for [[LineStyleDefinition.CompoundProps]] */\n Compound = 2,\n /** Component type for [[LineStyleDefinition.StrokePatternProps]] */\n StrokePattern = 3,\n /** Component type for [[LineStyleDefinition.StrokePointProps]] */\n StrokePoint = 4,\n /** Component type for [[LinePixels]], never saved as a file property */\n Internal = 6,\n /** Component type for [[LineStyleDefinition.RasterImageProps]] */\n RasterImage = 7,\n }\n\n /** Mask of values for StrokeMode */\n export enum StrokeMode {\n /** Stroke represents a blank space */\n Gap = 0x00,\n /** Stroke represents a solid dash */\n Dash = 0x01,\n /** Treat stroke as rigid and continue past a corner to complete the stroke as opposed to breaking at the corner */\n Ray = 0x02,\n /** Stroke length can be stretched when [[LineStyleDefinition.StrokePatternOptions.Iteration]] and [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] options are set, applicable to both Gap and Dash strokes */\n Scale = 0x04,\n /** Invert stroke in first stroke pattern */\n FirstInvert = 0x08,\n /** Invert stroke in last stroke pattern */\n LastInvert = 0x10,\n }\n\n /** Define constant width or tapered strokes with distance specified in meters */\n export enum StrokeWidth {\n /** Stroke draws as one pixel wide line */\n None = 0,\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to left side of stroke */\n Left = 1,\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to right side of stroke */\n Right = 2,\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to both sides of stroke */\n Full = 3,\n }\n\n /** Controls appearance of stroke end caps. If StrokeCap is >= Hexagon, the end cap is stroked as an arc and the value of\n * StrokeCap indicates the number of vectors in the arc.\n */\n export enum StrokeCap {\n /** Stroke displays as a closed polygon */\n Closed = 0,\n /** Stroke displays lines at specified width instead of a polygon */\n Open = 1,\n /** Stroke length extended by half the stroke width */\n Extended = 2,\n /** Stroke end cap is a hexagon */\n Hexagon = 3,\n /** Stroke end cap is an octagon */\n Octagon = 4,\n /** Stroke end cap is a decagon */\n Decagon = 5,\n /** Stroke end cap is an arc */\n Arc = 30,\n }\n\n /** A stroke representing either a dash or gap in a stroke pattern */\n export interface StrokeProps {\n /** Length of stroke in meters */\n length: number;\n /** Width at start of stroke. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\n orgWidth?: number;\n /** Width at end of stroke, same as start width if not present. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\n endWidth?: number;\n /** Type and behavior of stroke */\n strokeMode?: StrokeMode;\n /** How to apply orgWidth and endWidth to stroke */\n widthMode?: StrokeWidth;\n /** Appearance of stroke end cap */\n capMode?: StrokeCap;\n }\n\n export type Strokes = StrokeProps[];\n\n /** Options to control how stroke pattern is applied to underlying curve */\n export enum StrokePatternOptions {\n /** Use default stroke behavior */\n None = 0x00,\n /** [[LineStyleDefinition.StrokePatternProps.phase]] represents fractional distance into first stroke of pattern */\n AutoPhase = 0x01,\n /** Use [[LineStyleDefinition.StrokePatternProps.maxIter]] to limit the number of iterations of the stroke pattern */\n Iteration = 0x08,\n /** Single segment mode restarts the stroke pattern at corners instead of continuing around corners */\n Segment = 0x10,\n /** Center the line style and stretch the ends */\n CenterStretch = 0x20,\n }\n\n /** Stroke pattern component definition [[LineStyleDefinition.ComponentType.StrokePattern]].\n * A stroke pattern component consists of a series of dashes and gaps having specified lengths and widths in meters. Simple dash-dot type line styles that do not\n * include point symbols can be created by referencing a stroke pattern component by its file property id.\n */\n export interface StrokePatternProps {\n /** Name for this stroke pattern */\n descr: string;\n /** Skip into the pattern before starting to draw. Value treated as fraction of the first stroke when [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] set. Value used as distance when [[LineStyleDefinition.StrokePatternOptions.CenterStretch]] is not set. */\n phase?: number;\n /** Options mask for this stroke pattern */\n options?: StrokePatternOptions;\n /** The entire stroke pattern will be repeated no more than maxIter on curve or segment when [[LineStyleDefinition.StrokePatternOptions.Iteration]] is set and stroke pattern includes stretchable strokes. */\n maxIter?: number;\n /** Array of strokes, maximum number that will be used is 32 */\n strokes: Strokes;\n }\n\n /** Flags to identify point symbol behavior */\n export enum PointSymbolFlags {\n /** Default symbol behavior */\n None = 0x0,\n /** Symbol includes 3d geometry */\n Is3d = 0x01,\n /** Symbol does not allow scaling */\n NoScale = 0x02,\n }\n\n /** Point symbol component definition [[LineStyleDefinition.ComponentType.PointSymbol]].\n * A point symbol component identifies a GeometryPart for reference by a [[LineStyleDefinition.SymbolProps]].\n */\n export interface PointSymbolProps {\n /** GeometryPart Id to use as a pattern symbol */\n geomPartId: Id64String;\n /** GeometryPart.bbox.low.x */\n baseX?: number;\n /** GeometryPart.bbox.low.y */\n baseY?: number;\n /** GeometryPart.bbox.low.z */\n baseZ?: number;\n /** GeometryPart.bbox.high.x */\n sizeX?: number;\n /** GeometryPart.bbox.high.y */\n sizeY?: number;\n /** GeometryPart.bbox.high.z */\n sizeZ?: number;\n /** Symbol behavior flags */\n symFlags?: PointSymbolFlags;\n /** Symbol scale, defaults to 1 */\n scale?: number;\n }\n\n /** Symbol options for location, orientation, and behavior */\n export enum SymbolOptions {\n /** No point symbol */\n None = 0x00,\n /** Symbol at origin of stroke */\n Origin = 0x01,\n /** Symbol at end of stroke */\n End = 0x02,\n /** symbol at center of stroke */\n Center = 0x03,\n /** Symbol at curve start point */\n CurveOrigin = 0x0004,\n /** Symbol at curve end point */\n CurveEnd = 0x0008,\n /** Symbol at each vertex */\n CurveVertex = 0x0010,\n /** Adjust symbol rotation left->right */\n AdjustRotation = 0x0020,\n /** Angle of symbol not relative to stroke direction */\n AbsoluteRotation = 0x0040,\n /** No scale on variable strokes */\n NoScale = 0x0100,\n /** No clip on partial strokes */\n NoClip = 0x0200,\n /** No partial strokes */\n NoPartial = 0x0400,\n /** Project partial origin */\n ProjectOrigin = 0x0800,\n /** Use color from symbol instead of inheriting curve color */\n UseColor = 0x4000,\n /** Use weight from symbol instead of inheriting curve weight */\n UseWeight = 0x8000,\n }\n\n /** Identifies a symbol and its location and orientation relative to a stroke pattern */\n export interface SymbolProps {\n /** The file property id of the symbol component, assumed to be [[LineStyleDefinition.ComponentType.PointSymbol]] if symType is undefined. */\n symId: number;\n /** The component type, leave undefined if symId is a [[LineStyleDefinition.ComponentType.PointSymbol]] */\n symType?: ComponentType;\n /** The 0 based stroke index for base stroke pattern [[LineStyleDefinition.ComponentType.StrokePattern]] component */\n strokeNum?: number;\n /** Symbol x offset distance in meters */\n xOffset?: number;\n /** Symbol y offset distance in meters */\n yOffset?: number;\n /** Symbol rotation in radians */\n angle?: number;\n /** Must set location for symbol as default value is [[LineStyleDefinition.SymbolOptions.None]] */\n mod1?: SymbolOptions;\n }\n\n export type Symbols = SymbolProps[];\n\n /** Stroke point component definition [[LineStyleDefinition.ComponentType.StrokePoint]].\n * A stroke point component identifies the locations of point symbol components relative to a base stroke pattern component.\n */\n export interface StrokePointProps {\n /** Name for this stroke point component */\n descr: string;\n /** The file property id of the stroke component, assumed to be [[LineStyleDefinition.ComponentType.StrokePattern]] if lcType is undefined */\n lcId: number;\n /** The component type, leave undefined if lcId is a [[LineStyleDefinition.ComponentType.StrokePattern]] */\n lcType?: ComponentType;\n /** Array of symbols */\n symbols: Symbols;\n }\n\n /** Raster component definition [[LineStyleDefinition.ComponentType.RasterImage]].\n * A raster component identifies a texture for a line style.\n */\n export interface RasterImageProps {\n /** Name for this raster image component */\n descr: string;\n /** Raster width */\n x: number;\n /** Raster height */\n y: number;\n /** True width flag */\n trueWidth?: number;\n /** Raster flags */\n flags?: number;\n /** The file property id of raster image */\n imageId?: number;\n }\n\n /** Identifies a component by file property id and type */\n export interface ComponentProps {\n /** The file property id of [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.StrokePoint]] component */\n id: number;\n /** The type of component for specified file property id */\n type: ComponentType;\n /** Offset distance for this component, default is 0 */\n offset?: number;\n }\n\n export type Components = ComponentProps[];\n\n /** Compound component definition [[LineStyleDefinition.ComponentType.Compound]].\n * A compound component is used to link stroke pattern and stroke point components to create a style that displays dashes, gaps, and symbols.\n */\n export interface CompoundProps {\n comps: Components;\n }\n\n /** Flags to describe a style or control style behavior */\n export enum StyleFlags {\n /** Use defaults */\n None = 0x00,\n /** Only snap to center line and not individual strokes and symbols of line style */\n NoSnap = 0x04,\n /** Style represents a continuous line with width (determined by looking at components if not set) */\n Continuous = 0x08,\n /** Style represents physical geometry and should be scaled as such */\n Physical = 0x80,\n }\n\n /** The line style definition element data */\n export interface StyleProps {\n /** The file property id for either a [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.Compound]] component */\n compId: number;\n /** The type of component for specified file property id */\n compType: ComponentType;\n /** Style behavior flags. Defaults to [[LineStyleDefinition.StyleFlags.NoSnap]] if left undefined */\n flags?: StyleFlags;\n /** Style scale, defaults to 1 */\n unitDef?: number;\n }\n\n /** Helper methods for creating and querying line styles */\n export class Utils {\n\n /** Create a file property for a new stroke pattern component. */\n public static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps {\n const fileProps: FilePropertyProps = { name: \"LineCodeV1\", namespace: \"dgn_LStyle\" };\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\n return { compId: fileProps.id, compType: ComponentType.StrokePattern };\n }\n\n /** Create a file property for a new point symbol component.\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\n */\n public static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined {\n // if part extents weren't supplied, set them up now.\n if (!props.baseX && !props.baseY && !props.baseZ && !props.sizeX && !props.sizeY && !props.sizeZ) {\n const geomPart = iModel.elements.getElement<GeometryPart>(props.geomPartId);\n if (!geomPart)\n return undefined;\n\n props.baseX = geomPart.bbox.low.x;\n props.baseY = geomPart.bbox.low.y;\n props.baseZ = geomPart.bbox.low.z;\n\n props.sizeX = geomPart.bbox.high.x;\n props.sizeY = geomPart.bbox.high.y;\n props.sizeZ = geomPart.bbox.high.z;\n }\n\n const fileProps: FilePropertyProps = { name: \"PointSymV1\", namespace: \"dgn_LStyle\" };\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\n return { compId: fileProps.id, compType: ComponentType.PointSymbol };\n }\n\n /** Create a file property for a new stroke point component. */\n public static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps {\n const fileProps: FilePropertyProps = { name: \"LinePointV1\", namespace: \"dgn_LStyle\" };\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\n return { compId: fileProps.id, compType: ComponentType.StrokePoint };\n }\n\n /** Create a file property for a new compound component. */\n public static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps {\n const fileProps: FilePropertyProps = { name: \"CompoundV1\", namespace: \"dgn_LStyle\" };\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\n return { compId: fileProps.id, compType: ComponentType.Compound };\n }\n\n /** Create a file property for a new raster image component. */\n public static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined {\n const rasterFileProps: FilePropertyProps = { name: \"RasterImageV1\", namespace: \"dgn_LStyle\" };\n rasterFileProps.id = iModel.queryNextAvailableFileProperty(rasterFileProps);\n iModel.saveFileProperty(rasterFileProps, undefined, image);\n props.imageId = rasterFileProps.id;\n const fileProps: FilePropertyProps = { name: \"RasterComponentV1\", namespace: \"dgn_LStyle\" };\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\n return { compId: fileProps.id, compType: ComponentType.RasterImage };\n }\n\n /** Query for an existing line style with the supplied name. */\n public static queryStyle(imodel: IModelDb, scopeModelId: Id64String, name: string): Id64String | undefined {\n return imodel.elements.queryElementIdByCode(LineStyle.createCode(imodel, scopeModelId, name));\n }\n\n /** Insert a new line style with the supplied name.\n * @throws [[IModelError]] if unable to insert the line style definition element.\n */\n public static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String {\n if (undefined === props.flags)\n props.flags = StyleFlags.NoSnap; // If flags weren't supplied, default to not snapping to stroke geometry.\n\n const lsProps: LineStyleProps = {\n classFullName: \"BisCore:LineStyle\",\n model: scopeModelId,\n code: LineStyle.createCode(imodel, scopeModelId, name),\n data: JSON.stringify(props),\n };\n\n return imodel.elements.insertElement(lsProps);\n }\n\n /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.\n * There are 2 ways to define a continuous line style:\n * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.\n * - Defined using [[LineStyleDefinition.ComponentType.Internal]] with component id 0 [[LinePixels.Solid]] which has special behavior of being affected by width overrides.\n * - Width is specified in the style.\n * - Defined using a single stroke component that is a long dash.\n *\n * @throws [[IModelError]] if unable to insert the line style definition element.\n */\n public static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number): Id64String {\n if (width === undefined) {\n const name0 = \"Continuous\";\n const lsId0 = this.queryStyle(imodel, scopeModelId, name0);\n return (undefined === lsId0 ? this.createStyle(imodel, scopeModelId, name0, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap }) : lsId0);\n }\n\n const name = `Continuous-${width}`;\n const lsId = this.queryStyle(imodel, scopeModelId, name);\n if (undefined !== lsId)\n return lsId;\n\n const strokePatternData = this.createStrokePatternComponent(imodel, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });\n if (undefined === strokePatternData)\n throw new IModelError(IModelStatus.BadArg, \"Unable to insert stroke component\");\n\n return this.createStyle(imodel, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\n }\n\n /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.\n * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.\n * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.\n * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.\n */\n public static getOrCreateLinePixelsStyle(imodel: IModelDb, scopeModelId: Id64String, linePixels: LinePixels): Id64String {\n let lineCode;\n switch (linePixels) {\n case LinePixels.Code1:\n lineCode = 1;\n break;\n case LinePixels.Code2:\n lineCode = 2;\n break;\n case LinePixels.Code3:\n lineCode = 3;\n break;\n case LinePixels.Code4:\n lineCode = 4;\n break;\n case LinePixels.Code5:\n lineCode = 5;\n break;\n case LinePixels.Code6:\n lineCode = 6;\n break;\n case LinePixels.Code7:\n lineCode = 7;\n break;\n default:\n throw new IModelError(IModelStatus.BadArg, \"Invalid LinePixels\");\n }\n const name = `LinePixelsCodeNumber-${lineCode}`;\n const lsId = this.queryStyle(imodel, scopeModelId, name);\n return (undefined === lsId ? this.createStyle(imodel, scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+D;AAC/D,oDAAgG;AAChG,uCAAoD;AAGpD;;;;;;;;;GASG;AACH,IAAiB,mBAAmB,CA6anC;AA7aD,WAAiB,mBAAmB;IAElC,4CAA4C;IAC5C,IAAY,aAaX;IAbD,WAAY,aAAa;QACvB,kEAAkE;QAClE,+DAAe,CAAA;QACf,+DAA+D;QAC/D,yDAAY,CAAA;QACZ,oEAAoE;QACpE,mEAAiB,CAAA;QACjB,kEAAkE;QAClE,+DAAe,CAAA;QACf,wEAAwE;QACxE,yDAAY,CAAA;QACZ,kEAAkE;QAClE,+DAAe,CAAA;IACjB,CAAC,EAbW,aAAa,GAAb,iCAAa,KAAb,iCAAa,QAaxB;IAED,oCAAoC;IACpC,IAAY,UAaX;IAbD,WAAY,UAAU;QACpB,sCAAsC;QACtC,yCAAU,CAAA;QACV,qCAAqC;QACrC,2CAAW,CAAA;QACX,mHAAmH;QACnH,yCAAU,CAAA;QACV,qNAAqN;QACrN,6CAAY,CAAA;QACZ,4CAA4C;QAC5C,yDAAkB,CAAA;QAClB,2CAA2C;QAC3C,wDAAiB,CAAA;IACnB,CAAC,EAbW,UAAU,GAAV,8BAAU,KAAV,8BAAU,QAarB;IAED,iFAAiF;IACjF,IAAY,WASX;IATD,WAAY,WAAW;QACrB,0CAA0C;QAC1C,6CAAQ,CAAA;QACR,wIAAwI;QACxI,6CAAQ,CAAA;QACR,yIAAyI;QACzI,+CAAS,CAAA;QACT,yIAAyI;QACzI,6CAAQ,CAAA;IACV,CAAC,EATW,WAAW,GAAX,+BAAW,KAAX,+BAAW,QAStB;IAED;;OAEG;IACH,IAAY,SA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ACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR,KAAK,wBAAU,CAAC,KAAK;oBACnB,QAAQ,GAAG,CAAC,CAAC;oBACb,MAAM;gBACR;oBACE,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;aACpE;YACD,MAAM,IAAI,GAAG,wBAAwB,QAAQ,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACzD,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5I,CAAC;KACF;IArJY,yBAAK,QAqJjB,CAAA;AACH,CAAC,EA7agB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QA6anC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Symbology\r\n */\r\n\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { FilePropertyProps, IModelError, LinePixels, LineStyleProps } from \"@itwin/core-common\";\r\nimport { GeometryPart, LineStyle } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\n/** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.\r\n * There are three varieties of line styles:\r\n * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.\r\n * - A style using pre-defined pixel bit patterns [[LinePixels]] for dashed display (Code1-Code7).\r\n * - A style that uses a texture.\r\n *\r\n * A definition is defined by one or more components. A component is saved as a \"file property\" and can be referenced by other components. The line style definition references a component\r\n * by file property id and type and is saved as a dictionary element.\r\n * @public\r\n */\r\nexport namespace LineStyleDefinition {\r\n\r\n /** Line style component type identifiers */\r\n export enum ComponentType {\r\n /** Component type for [[LineStyleDefinition.PointSymbolProps]] */\r\n PointSymbol = 1,\r\n /** Component type for [[LineStyleDefinition.CompoundProps]] */\r\n Compound = 2,\r\n /** Component type for [[LineStyleDefinition.StrokePatternProps]] */\r\n StrokePattern = 3,\r\n /** Component type for [[LineStyleDefinition.StrokePointProps]] */\r\n StrokePoint = 4,\r\n /** Component type for [[LinePixels]], never saved as a file property */\r\n Internal = 6,\r\n /** Component type for [[LineStyleDefinition.RasterImageProps]] */\r\n RasterImage = 7,\r\n }\r\n\r\n /** Mask of values for StrokeMode */\r\n export enum StrokeMode {\r\n /** Stroke represents a blank space */\r\n Gap = 0x00,\r\n /** Stroke represents a solid dash */\r\n Dash = 0x01,\r\n /** Treat stroke as rigid and continue past a corner to complete the stroke as opposed to breaking at the corner */\r\n Ray = 0x02,\r\n /** Stroke length can be stretched when [[LineStyleDefinition.StrokePatternOptions.Iteration]] and [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] options are set, applicable to both Gap and Dash strokes */\r\n Scale = 0x04,\r\n /** Invert stroke in first stroke pattern */\r\n FirstInvert = 0x08,\r\n /** Invert stroke in last stroke pattern */\r\n LastInvert = 0x10,\r\n }\r\n\r\n /** Define constant width or tapered strokes with distance specified in meters */\r\n export enum StrokeWidth {\r\n /** Stroke draws as one pixel wide line */\r\n None = 0,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to left side of stroke */\r\n Left = 1,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to right side of stroke */\r\n Right = 2,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to both sides of stroke */\r\n Full = 3,\r\n }\r\n\r\n /** Controls appearance of stroke end caps. If StrokeCap is >= Hexagon, the end cap is stroked as an arc and the value of\r\n * StrokeCap indicates the number of vectors in the arc.\r\n */\r\n export enum StrokeCap {\r\n /** Stroke displays as a closed polygon */\r\n Closed = 0,\r\n /** Stroke displays lines at specified width instead of a polygon */\r\n Open = 1,\r\n /** Stroke length extended by half the stroke width */\r\n Extended = 2,\r\n /** Stroke end cap is a hexagon */\r\n Hexagon = 3,\r\n /** Stroke end cap is an octagon */\r\n Octagon = 4,\r\n /** Stroke end cap is a decagon */\r\n Decagon = 5,\r\n /** Stroke end cap is an arc */\r\n Arc = 30,\r\n }\r\n\r\n /** A stroke representing either a dash or gap in a stroke pattern */\r\n export interface StrokeProps {\r\n /** Length of stroke in meters */\r\n length: number;\r\n /** Width at start of stroke. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n orgWidth?: number;\r\n /** Width at end of stroke, same as start width if not present. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n endWidth?: number;\r\n /** Type and behavior of stroke */\r\n strokeMode?: StrokeMode;\r\n /** How to apply orgWidth and endWidth to stroke */\r\n widthMode?: StrokeWidth;\r\n /** Appearance of stroke end cap */\r\n capMode?: StrokeCap;\r\n }\r\n\r\n export type Strokes = StrokeProps[];\r\n\r\n /** Options to control how stroke pattern is applied to underlying curve */\r\n export enum StrokePatternOptions {\r\n /** Use default stroke behavior */\r\n None = 0x00,\r\n /** [[LineStyleDefinition.StrokePatternProps.phase]] represents fractional distance into first stroke of pattern */\r\n AutoPhase = 0x01,\r\n /** Use [[LineStyleDefinition.StrokePatternProps.maxIter]] to limit the number of iterations of the stroke pattern */\r\n Iteration = 0x08,\r\n /** Single segment mode restarts the stroke pattern at corners instead of continuing around corners */\r\n Segment = 0x10,\r\n /** Center the line style and stretch the ends */\r\n CenterStretch = 0x20,\r\n }\r\n\r\n /** Stroke pattern component definition [[LineStyleDefinition.ComponentType.StrokePattern]].\r\n * A stroke pattern component consists of a series of dashes and gaps having specified lengths and widths in meters. Simple dash-dot type line styles that do not\r\n * include point symbols can be created by referencing a stroke pattern component by its file property id.\r\n */\r\n export interface StrokePatternProps {\r\n /** Name for this stroke pattern */\r\n descr: string;\r\n /** Skip into the pattern before starting to draw. Value treated as fraction of the first stroke when [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] set. Value used as distance when [[LineStyleDefinition.StrokePatternOptions.CenterStretch]] is not set. */\r\n phase?: number;\r\n /** Options mask for this stroke pattern */\r\n options?: StrokePatternOptions;\r\n /** The entire stroke pattern will be repeated no more than maxIter on curve or segment when [[LineStyleDefinition.StrokePatternOptions.Iteration]] is set and stroke pattern includes stretchable strokes. */\r\n maxIter?: number;\r\n /** Array of strokes, maximum number that will be used is 32 */\r\n strokes: Strokes;\r\n }\r\n\r\n /** Flags to identify point symbol behavior */\r\n export enum PointSymbolFlags {\r\n /** Default symbol behavior */\r\n None = 0x0,\r\n /** Symbol includes 3d geometry */\r\n Is3d = 0x01,\r\n /** Symbol does not allow scaling */\r\n NoScale = 0x02,\r\n }\r\n\r\n /** Point symbol component definition [[LineStyleDefinition.ComponentType.PointSymbol]].\r\n * A point symbol component identifies a GeometryPart for reference by a [[LineStyleDefinition.SymbolProps]].\r\n */\r\n export interface PointSymbolProps {\r\n /** GeometryPart Id to use as a pattern symbol */\r\n geomPartId: Id64String;\r\n /** GeometryPart.bbox.low.x */\r\n baseX?: number;\r\n /** GeometryPart.bbox.low.y */\r\n baseY?: number;\r\n /** GeometryPart.bbox.low.z */\r\n baseZ?: number;\r\n /** GeometryPart.bbox.high.x */\r\n sizeX?: number;\r\n /** GeometryPart.bbox.high.y */\r\n sizeY?: number;\r\n /** GeometryPart.bbox.high.z */\r\n sizeZ?: number;\r\n /** Symbol behavior flags */\r\n symFlags?: PointSymbolFlags;\r\n /** Symbol scale, defaults to 1 */\r\n scale?: number;\r\n }\r\n\r\n /** Symbol options for location, orientation, and behavior */\r\n export enum SymbolOptions {\r\n /** No point symbol */\r\n None = 0x00,\r\n /** Symbol at origin of stroke */\r\n Origin = 0x01,\r\n /** Symbol at end of stroke */\r\n End = 0x02,\r\n /** symbol at center of stroke */\r\n Center = 0x03,\r\n /** Symbol at curve start point */\r\n CurveOrigin = 0x0004,\r\n /** Symbol at curve end point */\r\n CurveEnd = 0x0008,\r\n /** Symbol at each vertex */\r\n CurveVertex = 0x0010,\r\n /** Adjust symbol rotation left->right */\r\n AdjustRotation = 0x0020,\r\n /** Angle of symbol not relative to stroke direction */\r\n AbsoluteRotation = 0x0040,\r\n /** No scale on variable strokes */\r\n NoScale = 0x0100,\r\n /** No clip on partial strokes */\r\n NoClip = 0x0200,\r\n /** No partial strokes */\r\n NoPartial = 0x0400,\r\n /** Project partial origin */\r\n ProjectOrigin = 0x0800,\r\n /** Use color from symbol instead of inheriting curve color */\r\n UseColor = 0x4000,\r\n /** Use weight from symbol instead of inheriting curve weight */\r\n UseWeight = 0x8000,\r\n }\r\n\r\n /** Identifies a symbol and its location and orientation relative to a stroke pattern */\r\n export interface SymbolProps {\r\n /** The file property id of the symbol component, assumed to be [[LineStyleDefinition.ComponentType.PointSymbol]] if symType is undefined. */\r\n symId: number;\r\n /** The component type, leave undefined if symId is a [[LineStyleDefinition.ComponentType.PointSymbol]] */\r\n symType?: ComponentType;\r\n /** The 0 based stroke index for base stroke pattern [[LineStyleDefinition.ComponentType.StrokePattern]] component */\r\n strokeNum?: number;\r\n /** Symbol x offset distance in meters */\r\n xOffset?: number;\r\n /** Symbol y offset distance in meters */\r\n yOffset?: number;\r\n /** Symbol rotation in radians */\r\n angle?: number;\r\n /** Must set location for symbol as default value is [[LineStyleDefinition.SymbolOptions.None]] */\r\n mod1?: SymbolOptions;\r\n }\r\n\r\n export type Symbols = SymbolProps[];\r\n\r\n /** Stroke point component definition [[LineStyleDefinition.ComponentType.StrokePoint]].\r\n * A stroke point component identifies the locations of point symbol components relative to a base stroke pattern component.\r\n */\r\n export interface StrokePointProps {\r\n /** Name for this stroke point component */\r\n descr: string;\r\n /** The file property id of the stroke component, assumed to be [[LineStyleDefinition.ComponentType.StrokePattern]] if lcType is undefined */\r\n lcId: number;\r\n /** The component type, leave undefined if lcId is a [[LineStyleDefinition.ComponentType.StrokePattern]] */\r\n lcType?: ComponentType;\r\n /** Array of symbols */\r\n symbols: Symbols;\r\n }\r\n\r\n /** Raster component definition [[LineStyleDefinition.ComponentType.RasterImage]].\r\n * A raster component identifies a texture for a line style.\r\n */\r\n export interface RasterImageProps {\r\n /** Name for this raster image component */\r\n descr: string;\r\n /** Raster width */\r\n x: number;\r\n /** Raster height */\r\n y: number;\r\n /** True width flag */\r\n trueWidth?: number;\r\n /** Raster flags */\r\n flags?: number;\r\n /** The file property id of raster image */\r\n imageId?: number;\r\n }\r\n\r\n /** Identifies a component by file property id and type */\r\n export interface ComponentProps {\r\n /** The file property id of [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.StrokePoint]] component */\r\n id: number;\r\n /** The type of component for specified file property id */\r\n type: ComponentType;\r\n /** Offset distance for this component, default is 0 */\r\n offset?: number;\r\n }\r\n\r\n export type Components = ComponentProps[];\r\n\r\n /** Compound component definition [[LineStyleDefinition.ComponentType.Compound]].\r\n * A compound component is used to link stroke pattern and stroke point components to create a style that displays dashes, gaps, and symbols.\r\n */\r\n export interface CompoundProps {\r\n comps: Components;\r\n }\r\n\r\n /** Flags to describe a style or control style behavior */\r\n export enum StyleFlags {\r\n /** Use defaults */\r\n None = 0x00,\r\n /** Only snap to center line and not individual strokes and symbols of line style */\r\n NoSnap = 0x04,\r\n /** Style represents a continuous line with width (determined by looking at components if not set) */\r\n Continuous = 0x08,\r\n /** Style represents physical geometry and should be scaled as such */\r\n Physical = 0x80,\r\n }\r\n\r\n /** The line style definition element data */\r\n export interface StyleProps {\r\n /** The file property id for either a [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.Compound]] component */\r\n compId: number;\r\n /** The type of component for specified file property id */\r\n compType: ComponentType;\r\n /** Style behavior flags. Defaults to [[LineStyleDefinition.StyleFlags.NoSnap]] if left undefined */\r\n flags?: StyleFlags;\r\n /** Style scale, defaults to 1 */\r\n unitDef?: number;\r\n }\r\n\r\n /** Helper methods for creating and querying line styles */\r\n export class Utils {\r\n\r\n /** Create a file property for a new stroke pattern component. */\r\n public static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"LineCodeV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePattern };\r\n }\r\n\r\n /** Create a file property for a new point symbol component.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n */\r\n public static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined {\r\n // if part extents weren't supplied, set them up now.\r\n if (!props.baseX && !props.baseY && !props.baseZ && !props.sizeX && !props.sizeY && !props.sizeZ) {\r\n const geomPart = iModel.elements.getElement<GeometryPart>(props.geomPartId);\r\n if (!geomPart)\r\n return undefined;\r\n\r\n props.baseX = geomPart.bbox.low.x;\r\n props.baseY = geomPart.bbox.low.y;\r\n props.baseZ = geomPart.bbox.low.z;\r\n\r\n props.sizeX = geomPart.bbox.high.x;\r\n props.sizeY = geomPart.bbox.high.y;\r\n props.sizeZ = geomPart.bbox.high.z;\r\n }\r\n\r\n const fileProps: FilePropertyProps = { name: \"PointSymV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.PointSymbol };\r\n }\r\n\r\n /** Create a file property for a new stroke point component. */\r\n public static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"LinePointV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePoint };\r\n }\r\n\r\n /** Create a file property for a new compound component. */\r\n public static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"CompoundV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.Compound };\r\n }\r\n\r\n /** Create a file property for a new raster image component. */\r\n public static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined {\r\n const rasterFileProps: FilePropertyProps = { name: \"RasterImageV1\", namespace: \"dgn_LStyle\" };\r\n rasterFileProps.id = iModel.queryNextAvailableFileProperty(rasterFileProps);\r\n iModel.saveFileProperty(rasterFileProps, undefined, image);\r\n props.imageId = rasterFileProps.id;\r\n const fileProps: FilePropertyProps = { name: \"RasterComponentV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.RasterImage };\r\n }\r\n\r\n /** Query for an existing line style with the supplied name. */\r\n public static queryStyle(imodel: IModelDb, scopeModelId: Id64String, name: string): Id64String | undefined {\r\n return imodel.elements.queryElementIdByCode(LineStyle.createCode(imodel, scopeModelId, name));\r\n }\r\n\r\n /** Insert a new line style with the supplied name.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n */\r\n public static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String {\r\n if (undefined === props.flags)\r\n props.flags = StyleFlags.NoSnap; // If flags weren't supplied, default to not snapping to stroke geometry.\r\n\r\n const lsProps: LineStyleProps = {\r\n classFullName: \"BisCore:LineStyle\",\r\n model: scopeModelId,\r\n code: LineStyle.createCode(imodel, scopeModelId, name),\r\n data: JSON.stringify(props),\r\n };\r\n\r\n return imodel.elements.insertElement(lsProps);\r\n }\r\n\r\n /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.\r\n * There are 2 ways to define a continuous line style:\r\n * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.\r\n * - Defined using [[LineStyleDefinition.ComponentType.Internal]] with component id 0 [[LinePixels.Solid]] which has special behavior of being affected by width overrides.\r\n * - Width is specified in the style.\r\n * - Defined using a single stroke component that is a long dash.\r\n *\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n */\r\n public static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number): Id64String {\r\n if (width === undefined) {\r\n const name0 = \"Continuous\";\r\n const lsId0 = this.queryStyle(imodel, scopeModelId, name0);\r\n return (undefined === lsId0 ? this.createStyle(imodel, scopeModelId, name0, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap }) : lsId0);\r\n }\r\n\r\n const name = `Continuous-${width}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n if (undefined !== lsId)\r\n return lsId;\r\n\r\n const strokePatternData = this.createStrokePatternComponent(imodel, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });\r\n if (undefined === strokePatternData)\r\n throw new IModelError(IModelStatus.BadArg, \"Unable to insert stroke component\");\r\n\r\n return this.createStyle(imodel, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n }\r\n\r\n /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.\r\n * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.\r\n * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.\r\n * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.\r\n */\r\n public static getOrCreateLinePixelsStyle(imodel: IModelDb, scopeModelId: Id64String, linePixels: LinePixels): Id64String {\r\n let lineCode;\r\n switch (linePixels) {\r\n case LinePixels.Code1:\r\n lineCode = 1;\r\n break;\r\n case LinePixels.Code2:\r\n lineCode = 2;\r\n break;\r\n case LinePixels.Code3:\r\n lineCode = 3;\r\n break;\r\n case LinePixels.Code4:\r\n lineCode = 4;\r\n break;\r\n case LinePixels.Code5:\r\n lineCode = 5;\r\n break;\r\n case LinePixels.Code6:\r\n lineCode = 6;\r\n break;\r\n case LinePixels.Code7:\r\n lineCode = 7;\r\n break;\r\n default:\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid LinePixels\");\r\n }\r\n const name = `LinePixelsCodeNumber-${lineCode}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n return (undefined === lsId ? this.createStyle(imodel, scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);\r\n }\r\n }\r\n}\r\n"]}
@@ -1,163 +1,163 @@
1
- import { GuidString, Id64String } from "@itwin/core-bentley";
2
- import { BriefcaseId, ChangesetFileProps, ChangesetId, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, LocalDirName, LocalFileName } from "@itwin/core-common";
3
- import { LockMap, LockProps, LockState } from "./BackendHubAccess";
4
- /** @internal */
5
- interface MockBriefcaseIdProps {
6
- id: BriefcaseId;
7
- user: string;
8
- alias: string;
9
- assigned: boolean;
10
- }
11
- /** @internal */
12
- interface LocalHubProps {
13
- readonly iTwinId: GuidString;
14
- readonly iModelId: GuidString;
15
- readonly iModelName: string;
16
- readonly description?: string;
17
- readonly version0?: string;
18
- readonly noLocks?: true;
19
- }
20
- interface LocksEntry {
21
- id: Id64String;
22
- level: LockState;
23
- lastCsIndex?: ChangesetIndex;
24
- briefcaseId?: BriefcaseId;
25
- }
26
- interface LockStatusNone {
27
- state: LockState.None;
28
- lastCsIndex?: ChangesetIndex;
29
- }
30
- /** @internal exported for tests. */
31
- export interface LockStatusExclusive {
32
- state: LockState.Exclusive;
33
- briefcaseId: BriefcaseId;
34
- lastCsIndex?: ChangesetIndex;
35
- }
36
- /** @internal exported for tests. */
37
- export interface LockStatusShared {
38
- state: LockState.Shared;
39
- sharedBy: Set<BriefcaseId>;
40
- lastCsIndex?: ChangesetIndex;
41
- }
42
- interface BriefcaseIdAndChangeset {
43
- changeset: ChangesetIdWithIndex;
44
- briefcaseId: BriefcaseId;
45
- }
46
- declare type LockStatus = LockStatusNone | LockStatusExclusive | LockStatusShared;
47
- /**
48
- * A "local" mock for IModelHub to provide access to a single iModel. Used by HubMock.
49
- * @internal
50
- */
51
- export declare class LocalHub {
52
- readonly rootDir: LocalDirName;
53
- readonly iTwinId: GuidString;
54
- readonly iModelId: GuidString;
55
- readonly iModelName: string;
56
- readonly description?: string;
57
- private _hubDb?;
58
- private _nextBriefcaseId;
59
- private _latestChangesetIndex;
60
- get latestChangesetIndex(): number;
61
- constructor(rootDir: LocalDirName, arg: LocalHubProps);
62
- private get db();
63
- get changesetDir(): string;
64
- get checkpointDir(): string;
65
- get mockDbName(): string;
66
- /** Acquire the next available briefcaseId and assign it to the supplied user */
67
- acquireNewBriefcaseId(user: string, alias?: string): BriefcaseId;
68
- /** Release a briefcaseId */
69
- releaseBriefcaseId(id: BriefcaseId): void;
70
- /** Get an array of all of the currently assigned Briefcases */
71
- getBriefcases(onlyAssigned?: boolean): MockBriefcaseIdProps[];
72
- /** Get an array of all of the currently assigned BriefcaseIds for a user */
73
- getBriefcaseIds(user: string): BriefcaseId[];
74
- getBriefcase(id: BriefcaseId): MockBriefcaseIdProps;
75
- private getChangesetFileName;
76
- /** Add a changeset to the timeline
77
- * @return the changesetIndex of the added changeset
78
- */
79
- addChangeset(changeset: ChangesetFileProps): ChangesetIndex;
80
- getIndexFromChangeset(changeset: ChangesetIndexOrId): ChangesetIndex;
81
- /** Get the index of a changeset by its Id */
82
- getChangesetIndex(id: ChangesetId): ChangesetIndex;
83
- /** Get the properties of a changeset by its Id */
84
- getChangesetById(id: ChangesetId): ChangesetProps;
85
- getPreviousIndex(index: ChangesetIndex): number;
86
- getParentId(index: ChangesetIndex): ChangesetId;
87
- /** Get the properties of a changeset by its index */
88
- getChangesetByIndex(index: ChangesetIndex): ChangesetProps;
89
- getLatestChangeset(): ChangesetProps;
90
- getChangesetId(index: ChangesetIndex): ChangesetId;
91
- /** Get an array of changesets starting with first to last, by index */
92
- queryChangesets(range?: ChangesetRange): ChangesetProps[];
93
- /** Name a version */
94
- addNamedVersion(arg: {
95
- versionName: string;
96
- csIndex: ChangesetIndex;
97
- }): void;
98
- /** Delete a named version */
99
- deleteNamedVersion(versionName: string): void;
100
- /** find the changeset for a named version */
101
- findNamedVersion(versionName: string): ChangesetProps;
102
- checkpointNameFromIndex(csIndex: ChangesetIndex): string;
103
- /** "upload" a checkpoint */
104
- uploadCheckpoint(arg: {
105
- changesetIndex: ChangesetIndex;
106
- localFile: LocalFileName;
107
- }): string;
108
- /** Get an array of the indexes for a range of checkpoints */
109
- getCheckpoints(range?: ChangesetRange): ChangesetIndex[];
110
- /** Find the checkpoint that is no newer than a changesetIndex */
111
- queryPreviousCheckpoint(changesetIndex: ChangesetIndex): ChangesetIndex;
112
- /** "download" a checkpoint */
113
- downloadCheckpoint(arg: {
114
- changeset: ChangesetIndexOrId;
115
- targetFile: LocalFileName;
116
- }): {
117
- index: number;
118
- id: string;
119
- };
120
- private copyChangeset;
121
- /** "download" a changeset */
122
- downloadChangeset(arg: {
123
- index: ChangesetIndex;
124
- targetDir: LocalDirName;
125
- }): ChangesetFileProps;
126
- /** "download" all the changesets in a given range */
127
- downloadChangesets(arg: {
128
- range?: ChangesetRange;
129
- targetDir: LocalDirName;
130
- }): ChangesetFileProps[];
131
- private querySharedLockHolders;
132
- queryAllLocks(briefcaseId: BriefcaseId): LockProps[];
133
- queryLockStatus(elementId: Id64String): LockStatus;
134
- private reserveLock;
135
- private clearLock;
136
- private updateLockChangeset;
137
- private requestLock;
138
- private removeSharedLock;
139
- private releaseLock;
140
- /** Acquire a set of locks. If any lock cannot be acquired, no locks are acquired */
141
- acquireLocks(locks: LockMap, briefcase: BriefcaseIdAndChangeset): void;
142
- acquireLock(props: LockProps, briefcase: BriefcaseIdAndChangeset): void;
143
- releaseLocks(locks: LockProps[], arg: {
144
- briefcaseId: BriefcaseId;
145
- changesetIndex: ChangesetIndex;
146
- }): void;
147
- releaseAllLocks(arg: {
148
- briefcaseId: BriefcaseId;
149
- changesetIndex: ChangesetIndex;
150
- }): void;
151
- private countTable;
152
- countSharedLocks(): number;
153
- countLocks(): number;
154
- queryAllSharedLocks(): {
155
- id: Id64String;
156
- briefcaseId: BriefcaseId;
157
- }[];
158
- queryLocks(): LocksEntry[];
159
- removeDir(dirName: string): void;
160
- cleanup(): void;
161
- }
162
- export {};
1
+ import { GuidString, Id64String } from "@itwin/core-bentley";
2
+ import { BriefcaseId, ChangesetFileProps, ChangesetId, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, LocalDirName, LocalFileName } from "@itwin/core-common";
3
+ import { LockMap, LockProps, LockState } from "./BackendHubAccess";
4
+ /** @internal */
5
+ interface MockBriefcaseIdProps {
6
+ id: BriefcaseId;
7
+ user: string;
8
+ alias: string;
9
+ assigned: boolean;
10
+ }
11
+ /** @internal */
12
+ interface LocalHubProps {
13
+ readonly iTwinId: GuidString;
14
+ readonly iModelId: GuidString;
15
+ readonly iModelName: string;
16
+ readonly description?: string;
17
+ readonly version0?: string;
18
+ readonly noLocks?: true;
19
+ }
20
+ interface LocksEntry {
21
+ id: Id64String;
22
+ level: LockState;
23
+ lastCsIndex?: ChangesetIndex;
24
+ briefcaseId?: BriefcaseId;
25
+ }
26
+ interface LockStatusNone {
27
+ state: LockState.None;
28
+ lastCsIndex?: ChangesetIndex;
29
+ }
30
+ /** @internal exported for tests. */
31
+ export interface LockStatusExclusive {
32
+ state: LockState.Exclusive;
33
+ briefcaseId: BriefcaseId;
34
+ lastCsIndex?: ChangesetIndex;
35
+ }
36
+ /** @internal exported for tests. */
37
+ export interface LockStatusShared {
38
+ state: LockState.Shared;
39
+ sharedBy: Set<BriefcaseId>;
40
+ lastCsIndex?: ChangesetIndex;
41
+ }
42
+ interface BriefcaseIdAndChangeset {
43
+ changeset: ChangesetIdWithIndex;
44
+ briefcaseId: BriefcaseId;
45
+ }
46
+ declare type LockStatus = LockStatusNone | LockStatusExclusive | LockStatusShared;
47
+ /**
48
+ * A "local" mock for IModelHub to provide access to a single iModel. Used by HubMock.
49
+ * @internal
50
+ */
51
+ export declare class LocalHub {
52
+ readonly rootDir: LocalDirName;
53
+ readonly iTwinId: GuidString;
54
+ readonly iModelId: GuidString;
55
+ readonly iModelName: string;
56
+ readonly description?: string;
57
+ private _hubDb?;
58
+ private _nextBriefcaseId;
59
+ private _latestChangesetIndex;
60
+ get latestChangesetIndex(): number;
61
+ constructor(rootDir: LocalDirName, arg: LocalHubProps);
62
+ private get db();
63
+ get changesetDir(): string;
64
+ get checkpointDir(): string;
65
+ get mockDbName(): string;
66
+ /** Acquire the next available briefcaseId and assign it to the supplied user */
67
+ acquireNewBriefcaseId(user: string, alias?: string): BriefcaseId;
68
+ /** Release a briefcaseId */
69
+ releaseBriefcaseId(id: BriefcaseId): void;
70
+ /** Get an array of all of the currently assigned Briefcases */
71
+ getBriefcases(onlyAssigned?: boolean): MockBriefcaseIdProps[];
72
+ /** Get an array of all of the currently assigned BriefcaseIds for a user */
73
+ getBriefcaseIds(user: string): BriefcaseId[];
74
+ getBriefcase(id: BriefcaseId): MockBriefcaseIdProps;
75
+ private getChangesetFileName;
76
+ /** Add a changeset to the timeline
77
+ * @return the changesetIndex of the added changeset
78
+ */
79
+ addChangeset(changeset: ChangesetFileProps): ChangesetIndex;
80
+ getIndexFromChangeset(changeset: ChangesetIndexOrId): ChangesetIndex;
81
+ /** Get the index of a changeset by its Id */
82
+ getChangesetIndex(id: ChangesetId): ChangesetIndex;
83
+ /** Get the properties of a changeset by its Id */
84
+ getChangesetById(id: ChangesetId): ChangesetProps;
85
+ getPreviousIndex(index: ChangesetIndex): number;
86
+ getParentId(index: ChangesetIndex): ChangesetId;
87
+ /** Get the properties of a changeset by its index */
88
+ getChangesetByIndex(index: ChangesetIndex): ChangesetProps;
89
+ getLatestChangeset(): ChangesetProps;
90
+ getChangesetId(index: ChangesetIndex): ChangesetId;
91
+ /** Get an array of changesets starting with first to last, by index */
92
+ queryChangesets(range?: ChangesetRange): ChangesetProps[];
93
+ /** Name a version */
94
+ addNamedVersion(arg: {
95
+ versionName: string;
96
+ csIndex: ChangesetIndex;
97
+ }): void;
98
+ /** Delete a named version */
99
+ deleteNamedVersion(versionName: string): void;
100
+ /** find the changeset for a named version */
101
+ findNamedVersion(versionName: string): ChangesetProps;
102
+ checkpointNameFromIndex(csIndex: ChangesetIndex): string;
103
+ /** "upload" a checkpoint */
104
+ uploadCheckpoint(arg: {
105
+ changesetIndex: ChangesetIndex;
106
+ localFile: LocalFileName;
107
+ }): string;
108
+ /** Get an array of the indexes for a range of checkpoints */
109
+ getCheckpoints(range?: ChangesetRange): ChangesetIndex[];
110
+ /** Find the checkpoint that is no newer than a changesetIndex */
111
+ queryPreviousCheckpoint(changesetIndex: ChangesetIndex): ChangesetIndex;
112
+ /** "download" a checkpoint */
113
+ downloadCheckpoint(arg: {
114
+ changeset: ChangesetIndexOrId;
115
+ targetFile: LocalFileName;
116
+ }): {
117
+ index: number;
118
+ id: string;
119
+ };
120
+ private copyChangeset;
121
+ /** "download" a changeset */
122
+ downloadChangeset(arg: {
123
+ index: ChangesetIndex;
124
+ targetDir: LocalDirName;
125
+ }): ChangesetFileProps;
126
+ /** "download" all the changesets in a given range */
127
+ downloadChangesets(arg: {
128
+ range?: ChangesetRange;
129
+ targetDir: LocalDirName;
130
+ }): ChangesetFileProps[];
131
+ private querySharedLockHolders;
132
+ queryAllLocks(briefcaseId: BriefcaseId): LockProps[];
133
+ queryLockStatus(elementId: Id64String): LockStatus;
134
+ private reserveLock;
135
+ private clearLock;
136
+ private updateLockChangeset;
137
+ private requestLock;
138
+ private removeSharedLock;
139
+ private releaseLock;
140
+ /** Acquire a set of locks. If any lock cannot be acquired, no locks are acquired */
141
+ acquireLocks(locks: LockMap, briefcase: BriefcaseIdAndChangeset): void;
142
+ acquireLock(props: LockProps, briefcase: BriefcaseIdAndChangeset): void;
143
+ releaseLocks(locks: LockProps[], arg: {
144
+ briefcaseId: BriefcaseId;
145
+ changesetIndex: ChangesetIndex;
146
+ }): void;
147
+ releaseAllLocks(arg: {
148
+ briefcaseId: BriefcaseId;
149
+ changesetIndex: ChangesetIndex;
150
+ }): void;
151
+ private countTable;
152
+ countSharedLocks(): number;
153
+ countLocks(): number;
154
+ queryAllSharedLocks(): {
155
+ id: Id64String;
156
+ briefcaseId: BriefcaseId;
157
+ }[];
158
+ queryLocks(): LocksEntry[];
159
+ removeDir(dirName: string): void;
160
+ cleanup(): void;
161
+ }
162
+ export {};
163
163
  //# sourceMappingURL=LocalHub.d.ts.map