@itwin/core-backend 4.0.0-dev.24 → 4.0.0-dev.28

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 (245) hide show
  1. package/CHANGELOG.md +71 -66
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  3. package/lib/cjs/AliCloudStorageService.js +71 -71
  4. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  5. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  6. package/lib/cjs/BackendHubAccess.js +41 -41
  7. package/lib/cjs/BackendHubAccess.js.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  9. package/lib/cjs/BackendLoggerCategory.js +99 -99
  10. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  11. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  12. package/lib/cjs/BisCoreSchema.js +60 -60
  13. package/lib/cjs/BisCoreSchema.js.map +1 -1
  14. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  15. package/lib/cjs/BriefcaseManager.js +408 -414
  16. package/lib/cjs/BriefcaseManager.js.map +1 -1
  17. package/lib/cjs/Category.d.ts +153 -153
  18. package/lib/cjs/Category.js +243 -243
  19. package/lib/cjs/Category.js.map +1 -1
  20. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  21. package/lib/cjs/ChangeSummaryManager.js +446 -447
  22. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  23. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  24. package/lib/cjs/ChangedElementsDb.js +165 -165
  25. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  26. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  27. package/lib/cjs/ChangedElementsManager.js +88 -88
  28. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  29. package/lib/cjs/CheckpointManager.d.ts +121 -121
  30. package/lib/cjs/CheckpointManager.js +348 -349
  31. package/lib/cjs/CheckpointManager.js.map +1 -1
  32. package/lib/cjs/ClassRegistry.d.ts +79 -79
  33. package/lib/cjs/ClassRegistry.js +249 -250
  34. package/lib/cjs/ClassRegistry.js.map +1 -1
  35. package/lib/cjs/CloudSqlite.d.ts +350 -350
  36. package/lib/cjs/CloudSqlite.js +153 -153
  37. package/lib/cjs/CloudSqlite.js.map +1 -1
  38. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  39. package/lib/cjs/CloudStorageBackend.js +170 -173
  40. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  41. package/lib/cjs/CodeService.d.ts +396 -396
  42. package/lib/cjs/CodeService.js +63 -63
  43. package/lib/cjs/CodeService.js.map +1 -1
  44. package/lib/cjs/CodeSpecs.d.ts +55 -55
  45. package/lib/cjs/CodeSpecs.js +124 -124
  46. package/lib/cjs/CodeSpecs.js.map +1 -1
  47. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  48. package/lib/cjs/ConcurrentQuery.js +36 -36
  49. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  50. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  51. package/lib/cjs/CustomViewState3dCreator.js +81 -81
  52. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  53. package/lib/cjs/DevTools.d.ts +73 -73
  54. package/lib/cjs/DevTools.js +156 -156
  55. package/lib/cjs/DevTools.js.map +1 -1
  56. package/lib/cjs/DisplayStyle.d.ts +106 -106
  57. package/lib/cjs/DisplayStyle.js +253 -256
  58. package/lib/cjs/DisplayStyle.js.map +1 -1
  59. package/lib/cjs/ECDb.d.ts +191 -191
  60. package/lib/cjs/ECDb.js +348 -350
  61. package/lib/cjs/ECDb.js.map +1 -1
  62. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  63. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  64. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  65. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  66. package/lib/cjs/ECSqlStatement.js +791 -791
  67. package/lib/cjs/ECSqlStatement.js.map +1 -1
  68. package/lib/cjs/Element.d.ts +1109 -1109
  69. package/lib/cjs/Element.js +1419 -1427
  70. package/lib/cjs/Element.js.map +1 -1
  71. package/lib/cjs/ElementAspect.d.ts +179 -179
  72. package/lib/cjs/ElementAspect.js +211 -211
  73. package/lib/cjs/ElementAspect.js.map +1 -1
  74. package/lib/cjs/ElementGraphics.d.ts +9 -9
  75. package/lib/cjs/ElementGraphics.js +41 -41
  76. package/lib/cjs/ElementGraphics.js.map +1 -1
  77. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  78. package/lib/cjs/ElementTreeWalker.js +409 -409
  79. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  80. package/lib/cjs/Entity.d.ts +106 -106
  81. package/lib/cjs/Entity.js +134 -134
  82. package/lib/cjs/Entity.js.map +1 -1
  83. package/lib/cjs/EntityReferences.d.ts +49 -49
  84. package/lib/cjs/EntityReferences.js +95 -95
  85. package/lib/cjs/EntityReferences.js.map +1 -1
  86. package/lib/cjs/ExportGraphics.d.ts +317 -317
  87. package/lib/cjs/ExportGraphics.js +208 -208
  88. package/lib/cjs/ExportGraphics.js.map +1 -1
  89. package/lib/cjs/ExternalSource.d.ts +96 -96
  90. package/lib/cjs/ExternalSource.js +131 -131
  91. package/lib/cjs/ExternalSource.js.map +1 -1
  92. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  93. package/lib/cjs/GeoCoordConfig.js +85 -85
  94. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  95. package/lib/cjs/GeometrySummary.d.ts +4 -4
  96. package/lib/cjs/GeometrySummary.js +380 -380
  97. package/lib/cjs/GeometrySummary.js.map +1 -1
  98. package/lib/cjs/HubMock.d.ts +94 -94
  99. package/lib/cjs/HubMock.js +220 -222
  100. package/lib/cjs/HubMock.js.map +1 -1
  101. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  102. package/lib/cjs/IModelCloneContext.js +15 -15
  103. package/lib/cjs/IModelCloneContext.js.map +1 -1
  104. package/lib/cjs/IModelDb.d.ts +1210 -1196
  105. package/lib/cjs/IModelDb.d.ts.map +1 -1
  106. package/lib/cjs/IModelDb.js +2377 -2392
  107. package/lib/cjs/IModelDb.js.map +1 -1
  108. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  109. package/lib/cjs/IModelElementCloneContext.js +159 -159
  110. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  111. package/lib/cjs/IModelHost.d.ts +369 -369
  112. package/lib/cjs/IModelHost.js +488 -496
  113. package/lib/cjs/IModelHost.js.map +1 -1
  114. package/lib/cjs/IModelJsFs.d.ts +62 -62
  115. package/lib/cjs/IModelJsFs.js +139 -140
  116. package/lib/cjs/IModelJsFs.js.map +1 -1
  117. package/lib/cjs/IpcHost.d.ts +104 -104
  118. package/lib/cjs/IpcHost.js +276 -278
  119. package/lib/cjs/IpcHost.js.map +1 -1
  120. package/lib/cjs/LineStyle.d.ts +311 -311
  121. package/lib/cjs/LineStyle.js +295 -295
  122. package/lib/cjs/LineStyle.js.map +1 -1
  123. package/lib/cjs/LocalHub.d.ts +162 -162
  124. package/lib/cjs/LocalHub.js +580 -585
  125. package/lib/cjs/LocalHub.js.map +1 -1
  126. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  127. package/lib/cjs/LocalhostIpcHost.js +79 -81
  128. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  129. package/lib/cjs/Material.d.ts +131 -131
  130. package/lib/cjs/Material.js +180 -181
  131. package/lib/cjs/Material.js.map +1 -1
  132. package/lib/cjs/Model.d.ts +392 -392
  133. package/lib/cjs/Model.js +485 -485
  134. package/lib/cjs/Model.js.map +1 -1
  135. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  136. package/lib/cjs/NativeAppStorage.js +202 -202
  137. package/lib/cjs/NativeAppStorage.js.map +1 -1
  138. package/lib/cjs/NativeHost.d.ts +52 -52
  139. package/lib/cjs/NativeHost.js +160 -163
  140. package/lib/cjs/NativeHost.js.map +1 -1
  141. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  142. package/lib/cjs/NavigationRelationship.js +225 -225
  143. package/lib/cjs/NavigationRelationship.js.map +1 -1
  144. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  145. package/lib/cjs/PromiseMemoizer.js +101 -101
  146. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  147. package/lib/cjs/PropertyStore.d.ts +132 -132
  148. package/lib/cjs/PropertyStore.js +11 -11
  149. package/lib/cjs/PropertyStore.js.map +1 -1
  150. package/lib/cjs/Relationship.d.ts +416 -416
  151. package/lib/cjs/Relationship.js +494 -494
  152. package/lib/cjs/Relationship.js.map +1 -1
  153. package/lib/cjs/RpcBackend.d.ts +5 -5
  154. package/lib/cjs/RpcBackend.js +32 -32
  155. package/lib/cjs/RpcBackend.js.map +1 -1
  156. package/lib/cjs/SQLiteDb.d.ts +219 -219
  157. package/lib/cjs/SQLiteDb.js +212 -214
  158. package/lib/cjs/SQLiteDb.js.map +1 -1
  159. package/lib/cjs/Schema.d.ts +55 -55
  160. package/lib/cjs/Schema.js +83 -83
  161. package/lib/cjs/Schema.js.map +1 -1
  162. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  163. package/lib/cjs/ServerBasedLocks.js +168 -168
  164. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  165. package/lib/cjs/SqliteStatement.d.ts +360 -360
  166. package/lib/cjs/SqliteStatement.js +586 -586
  167. package/lib/cjs/SqliteStatement.js.map +1 -1
  168. package/lib/cjs/Texture.d.ts +58 -58
  169. package/lib/cjs/Texture.js +82 -82
  170. package/lib/cjs/Texture.js.map +1 -1
  171. package/lib/cjs/TileStorage.d.ts +18 -18
  172. package/lib/cjs/TileStorage.js +87 -90
  173. package/lib/cjs/TileStorage.js.map +1 -1
  174. package/lib/cjs/TxnManager.d.ts +202 -202
  175. package/lib/cjs/TxnManager.js +356 -356
  176. package/lib/cjs/TxnManager.js.map +1 -1
  177. package/lib/cjs/ViewDefinition.d.ts +439 -439
  178. package/lib/cjs/ViewDefinition.js +646 -646
  179. package/lib/cjs/ViewDefinition.js.map +1 -1
  180. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  181. package/lib/cjs/ViewStateHydrator.js +103 -103
  182. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  183. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  184. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  185. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  186. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  187. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  188. package/lib/cjs/core-backend.d.ts +184 -184
  189. package/lib/cjs/core-backend.js +204 -204
  190. package/lib/cjs/core-backend.js.map +1 -1
  191. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  192. package/lib/cjs/domains/FunctionalElements.js +145 -145
  193. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  194. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  195. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  196. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  197. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  198. package/lib/cjs/domains/GenericElements.js +263 -263
  199. package/lib/cjs/domains/GenericElements.js.map +1 -1
  200. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  201. package/lib/cjs/domains/GenericSchema.js +28 -28
  202. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  203. package/lib/cjs/rpc/multipart.d.ts +11 -11
  204. package/lib/cjs/rpc/multipart.js +71 -71
  205. package/lib/cjs/rpc/multipart.js.map +1 -1
  206. package/lib/cjs/rpc/tracing.d.ts +28 -28
  207. package/lib/cjs/rpc/tracing.js +73 -74
  208. package/lib/cjs/rpc/tracing.js.map +1 -1
  209. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  210. package/lib/cjs/rpc/web/logging.js +43 -43
  211. package/lib/cjs/rpc/web/logging.js.map +1 -1
  212. package/lib/cjs/rpc/web/request.d.ts +6 -6
  213. package/lib/cjs/rpc/web/request.js +73 -74
  214. package/lib/cjs/rpc/web/request.js.map +1 -1
  215. package/lib/cjs/rpc/web/response.d.ts +6 -6
  216. package/lib/cjs/rpc/web/response.js +105 -106
  217. package/lib/cjs/rpc/web/response.js.map +1 -1
  218. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  219. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  220. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  221. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  222. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +293 -294
  223. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  224. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  225. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -205
  226. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  227. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  228. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +166 -168
  229. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  230. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  231. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +42 -43
  232. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  233. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  234. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  235. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  236. package/lib/cjs/workspace/Settings.d.ts +186 -186
  237. package/lib/cjs/workspace/Settings.js +154 -155
  238. package/lib/cjs/workspace/Settings.js.map +1 -1
  239. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  240. package/lib/cjs/workspace/SettingsSchemas.js +190 -191
  241. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  242. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  243. package/lib/cjs/workspace/Workspace.js +537 -543
  244. package/lib/cjs/workspace/Workspace.js.map +1 -1
  245. package/package.json +12 -12
@@ -1,187 +1,187 @@
1
- /** @packageDocumentation
2
- * @module Workspace
3
- */
4
- import { BeEvent, JSONSchemaType } from "@itwin/core-bentley";
5
- import { LocalDirName, LocalFileName } from "@itwin/core-common";
6
- /** The type of a Setting, according to its schema
7
- * @beta
8
- */
9
- export declare type SettingType = JSONSchemaType;
10
- /**
11
- * The name of a Setting. SettingNames must be valid JavaScript property names, defined in a [[SettingSchema]].
12
- * @see [SettingName]($docs/learning/backend/Workspace#settingnames)
13
- * @beta
14
- */
15
- export declare type SettingName = string;
16
- /** The name of a [[SettingDictionary]]. `SettingDictionary`s are stored in [[Settings]] and may be removed by DictionaryName.
17
- * DictionaryNames must be valid JavaScript property names.
18
- * @beta
19
- */
20
- export declare type DictionaryName = string;
21
- /**
22
- * A function called by [[Settings.resolveSetting]] for every SettingDictionary with a Setting that matches a name. The
23
- * SettingDictionaries are sorted by priority and this function is called in priority order with the highest priority first.
24
- * When this function returns a non-undefined value, the iteration is stopped and that value is returned. In this way,
25
- * applications can "combine" the prioritized Setting values as appropriate. The default implementation of this function
26
- * used by [[Settings.getSetting]] merely returns a clone of the value the first time it is called, so the highest priority
27
- * value is returned.
28
- * @beta
29
- */
30
- export declare type SettingResolver<T> = (val: T, dict: DictionaryName, priority: SettingsPriority) => T | undefined;
31
- /** An entry in the array returned by [[Settings.inspectSetting]]
32
- * @beta
33
- *
34
- */
35
- export interface SettingInspector<T> {
36
- value: T;
37
- dictionary: DictionaryName;
38
- priority: number;
39
- }
40
- /** An object with string-named members (as opposed to an array object).
41
- * @beta
42
- */
43
- export interface SettingObject {
44
- [name: string]: SettingType;
45
- }
46
- /**
47
- * An object with Settings as its members. A SettingDictionary also has a name and generally comes from a parsed JSON file, but
48
- * may also be created in memory by applications
49
- * @beta
50
- */
51
- export declare type SettingDictionary = SettingObject;
52
- /**
53
- * Values for SettingsPriority determine the sort order for Settings. Higher values take precedence over lower values.
54
- * @beta
55
- */
56
- export declare enum SettingsPriority {
57
- /** values supplied default-settings files */
58
- defaults = 100,
59
- /** values supplied by applications at runtime */
60
- application = 200,
61
- /** values that apply to all iTwins for an organization. */
62
- organization = 300,
63
- /** values that apply to all iModels in an iTwin. */
64
- iTwin = 400,
65
- /** values that apply to a single iModel. */
66
- iModel = 500
67
- }
68
- /** The current set of Settings for a Workspace.
69
- * @beta
70
- */
71
- export interface Settings {
72
- /** @internal */
73
- close(): void;
74
- /** Event raised whenever a SettingsDictionary is added or removed. */
75
- readonly onSettingsChanged: BeEvent<() => void>;
76
- /** Add a SettingDictionary from a local settings file. The file should be in [JSON5](https://json5.org/) format. It is read
77
- * and parsed and the fileName is used as the DictionaryName.
78
- * @param fileName the name of a local settings file of the SettingDictionary. This becomes the DictionaryName.
79
- * @param priority the SettingsPriority for the SettingDictionary
80
- * @note If the SettingDictionary was previously added, the new content overrides the old content.
81
- */
82
- addFile(fileName: LocalFileName, priority: SettingsPriority): void;
83
- /** Add all files in the supplied directory with the extension ".json" or ".json5"
84
- * @param dirName the name of a local settings directory
85
- */
86
- addDirectory(dirName: LocalDirName, priority: SettingsPriority): void;
87
- /** Add a SettingDictionary from a JSON5 stringified string. The string is parsed and the resultant object is added as a SettingDictionary.
88
- * @param dictionaryName the name of the SettingDictionary
89
- * @param priority the SettingsPriority for the SettingDictionary
90
- * @param settingsJson the JSON5 stringified string to be parsed.
91
- * @note If the SettingDictionary was previously added, the new content overrides the old content.
92
- */
93
- addJson(dictionaryName: DictionaryName, priority: SettingsPriority, settingsJson: string): void;
94
- /** Add a SettingDictionary object.
95
- * @param dictionaryName the name of the SettingDictionary
96
- * @param priority the SettingsPriority for the SettingDictionary
97
- * @param settings the SettingDictionary object to be added.
98
- * @note If the SettingDictionary was previously added, the new content overrides the old content.
99
- */
100
- addDictionary(dictionaryName: DictionaryName, priority: SettingsPriority, settings: SettingDictionary): void;
101
- /** Remove a SettingDictionary by name. */
102
- dropDictionary(dictionaryName: DictionaryName): void;
103
- /**
104
- * Resolve a setting, by name, using a SettingResolver.
105
- * @param settingName The name of the setting to resolve
106
- * @param resolver function to be called for each SettingDictionary with a matching Setting. Iteration stops when it returns a non-undefined value.
107
- * @param defaultValue value returned if settingName is not present in any SettingDictionary or resolver never returned a value.
108
- * @returns the resolved setting value.
109
- */
110
- resolveSetting<T extends SettingType>(settingName: SettingName, resolver: SettingResolver<T>, defaultValue: T): T;
111
- resolveSetting<T extends SettingType>(settingName: SettingName, resolver: SettingResolver<T>, defaultValue?: T): T | undefined;
112
- /** Get the highest priority setting for a SettingName.
113
- * @param settingName The name of the setting
114
- * @param defaultValue value returned if settingName is not present in any SettingDictionary.
115
- * @note This method is generic on SettingType, but no type checking is actually performed at run time. So, if you
116
- * use this method to get a setting with an expected type, but its value is a different type, the return type of this method will be wrong.
117
- * You must always type check the result. Use the non-generic "get" methods (e.g. [[getString]]) if you only want the value
118
- * if its type is correct.
119
- */
120
- getSetting<T extends SettingType>(settingName: SettingName, defaultValue?: T): T | undefined;
121
- /** Get a string setting by SettingName.
122
- * @param settingName The name of the setting
123
- * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not a string.
124
- */
125
- getString(settingName: SettingName, defaultValue: string): string;
126
- getString(settingName: SettingName, defaultValue?: string): string | undefined;
127
- /** Get a boolean setting by SettingName.
128
- * @param settingName The name of the setting
129
- * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not a boolean.
130
- */
131
- getBoolean(settingName: SettingName, defaultValue: boolean): boolean;
132
- getBoolean(settingName: SettingName, defaultValue?: boolean): boolean | undefined;
133
- /** Get a number setting by SettingName.
134
- * @param settingName The name of the setting
135
- * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not a number.
136
- */
137
- getNumber(settingName: SettingName, defaultValue: number): number;
138
- getNumber(settingName: SettingName): number | undefined;
139
- /** Get an object setting by SettingName.
140
- * @param settingName The name of the setting
141
- * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not an object.
142
- */
143
- getObject<T extends object>(settingName: SettingName, defaultValue: T): T;
144
- getObject<T extends object>(settingName: SettingName): T | undefined;
145
- /** Get an array setting by SettingName.
146
- * @param settingName The name of the setting
147
- * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not an array.
148
- */
149
- getArray<T extends SettingType>(settingName: SettingName, defaultValue: Array<T>): Array<T>;
150
- getArray<T extends SettingType>(settingName: SettingName): Array<T> | undefined;
151
- /** Get an array of [[SettingInspector] objects, sorted in priority order, for all Settings that match a SettingName.
152
- * @note this method is mainly for debugging and diagnostics.
153
- */
154
- inspectSetting<T extends SettingType>(name: SettingName): SettingInspector<T>[];
155
- }
156
- /**
157
- * Internal implementation of Settings interface.
158
- * @internal
159
- */
160
- export declare class BaseSettings implements Settings {
161
- private _dictionaries;
162
- protected verifyPriority(_priority: SettingsPriority): void;
163
- close(): void;
164
- readonly onSettingsChanged: BeEvent<() => void>;
165
- addFile(fileName: LocalFileName, priority: SettingsPriority): void;
166
- addDirectory(dirName: LocalDirName, priority: SettingsPriority): void;
167
- addJson(dictionaryName: string, priority: SettingsPriority, settingsJson: string): void;
168
- addDictionary(dictionaryName: string, priority: SettingsPriority, settings: SettingDictionary): void;
169
- dropDictionary(dictionaryName: DictionaryName, raiseEvent?: boolean): boolean;
170
- resolveSetting<T extends SettingType>(name: SettingName, resolver: SettingResolver<T>, defaultValue?: T): T | undefined;
171
- getSetting<T extends SettingType>(name: SettingName, defaultValue?: T): T | undefined;
172
- /** for debugging. Returns an array of all values for a setting, sorted by priority.
173
- * @note values are not cloned. Do not modify objects or arrays.
174
- */
175
- inspectSetting<T extends SettingType>(name: SettingName): SettingInspector<T>[];
176
- getString(name: SettingName, defaultValue: string): string;
177
- getString(name: SettingName): string | undefined;
178
- getBoolean(name: SettingName, defaultValue: boolean): boolean;
179
- getBoolean(name: SettingName): boolean | undefined;
180
- getNumber(name: SettingName, defaultValue: number): number;
181
- getNumber(name: SettingName): number | undefined;
182
- getObject<T extends object>(name: SettingName, defaultValue: T): T;
183
- getObject<T extends object>(name: SettingName): T | undefined;
184
- getArray<T extends SettingType>(name: SettingName, defaultValue: Array<T>): Array<T>;
185
- getArray<T extends SettingType>(name: SettingName): Array<T> | undefined;
186
- }
1
+ /** @packageDocumentation
2
+ * @module Workspace
3
+ */
4
+ import { BeEvent, JSONSchemaType } from "@itwin/core-bentley";
5
+ import { LocalDirName, LocalFileName } from "@itwin/core-common";
6
+ /** The type of a Setting, according to its schema
7
+ * @beta
8
+ */
9
+ export declare type SettingType = JSONSchemaType;
10
+ /**
11
+ * The name of a Setting. SettingNames must be valid JavaScript property names, defined in a [[SettingSchema]].
12
+ * @see [SettingName]($docs/learning/backend/Workspace#settingnames)
13
+ * @beta
14
+ */
15
+ export declare type SettingName = string;
16
+ /** The name of a [[SettingDictionary]]. `SettingDictionary`s are stored in [[Settings]] and may be removed by DictionaryName.
17
+ * DictionaryNames must be valid JavaScript property names.
18
+ * @beta
19
+ */
20
+ export declare type DictionaryName = string;
21
+ /**
22
+ * A function called by [[Settings.resolveSetting]] for every SettingDictionary with a Setting that matches a name. The
23
+ * SettingDictionaries are sorted by priority and this function is called in priority order with the highest priority first.
24
+ * When this function returns a non-undefined value, the iteration is stopped and that value is returned. In this way,
25
+ * applications can "combine" the prioritized Setting values as appropriate. The default implementation of this function
26
+ * used by [[Settings.getSetting]] merely returns a clone of the value the first time it is called, so the highest priority
27
+ * value is returned.
28
+ * @beta
29
+ */
30
+ export declare type SettingResolver<T> = (val: T, dict: DictionaryName, priority: SettingsPriority) => T | undefined;
31
+ /** An entry in the array returned by [[Settings.inspectSetting]]
32
+ * @beta
33
+ *
34
+ */
35
+ export interface SettingInspector<T> {
36
+ value: T;
37
+ dictionary: DictionaryName;
38
+ priority: number;
39
+ }
40
+ /** An object with string-named members (as opposed to an array object).
41
+ * @beta
42
+ */
43
+ export interface SettingObject {
44
+ [name: string]: SettingType;
45
+ }
46
+ /**
47
+ * An object with Settings as its members. A SettingDictionary also has a name and generally comes from a parsed JSON file, but
48
+ * may also be created in memory by applications
49
+ * @beta
50
+ */
51
+ export declare type SettingDictionary = SettingObject;
52
+ /**
53
+ * Values for SettingsPriority determine the sort order for Settings. Higher values take precedence over lower values.
54
+ * @beta
55
+ */
56
+ export declare enum SettingsPriority {
57
+ /** values supplied default-settings files */
58
+ defaults = 100,
59
+ /** values supplied by applications at runtime */
60
+ application = 200,
61
+ /** values that apply to all iTwins for an organization. */
62
+ organization = 300,
63
+ /** values that apply to all iModels in an iTwin. */
64
+ iTwin = 400,
65
+ /** values that apply to a single iModel. */
66
+ iModel = 500
67
+ }
68
+ /** The current set of Settings for a Workspace.
69
+ * @beta
70
+ */
71
+ export interface Settings {
72
+ /** @internal */
73
+ close(): void;
74
+ /** Event raised whenever a SettingsDictionary is added or removed. */
75
+ readonly onSettingsChanged: BeEvent<() => void>;
76
+ /** Add a SettingDictionary from a local settings file. The file should be in [JSON5](https://json5.org/) format. It is read
77
+ * and parsed and the fileName is used as the DictionaryName.
78
+ * @param fileName the name of a local settings file of the SettingDictionary. This becomes the DictionaryName.
79
+ * @param priority the SettingsPriority for the SettingDictionary
80
+ * @note If the SettingDictionary was previously added, the new content overrides the old content.
81
+ */
82
+ addFile(fileName: LocalFileName, priority: SettingsPriority): void;
83
+ /** Add all files in the supplied directory with the extension ".json" or ".json5"
84
+ * @param dirName the name of a local settings directory
85
+ */
86
+ addDirectory(dirName: LocalDirName, priority: SettingsPriority): void;
87
+ /** Add a SettingDictionary from a JSON5 stringified string. The string is parsed and the resultant object is added as a SettingDictionary.
88
+ * @param dictionaryName the name of the SettingDictionary
89
+ * @param priority the SettingsPriority for the SettingDictionary
90
+ * @param settingsJson the JSON5 stringified string to be parsed.
91
+ * @note If the SettingDictionary was previously added, the new content overrides the old content.
92
+ */
93
+ addJson(dictionaryName: DictionaryName, priority: SettingsPriority, settingsJson: string): void;
94
+ /** Add a SettingDictionary object.
95
+ * @param dictionaryName the name of the SettingDictionary
96
+ * @param priority the SettingsPriority for the SettingDictionary
97
+ * @param settings the SettingDictionary object to be added.
98
+ * @note If the SettingDictionary was previously added, the new content overrides the old content.
99
+ */
100
+ addDictionary(dictionaryName: DictionaryName, priority: SettingsPriority, settings: SettingDictionary): void;
101
+ /** Remove a SettingDictionary by name. */
102
+ dropDictionary(dictionaryName: DictionaryName): void;
103
+ /**
104
+ * Resolve a setting, by name, using a SettingResolver.
105
+ * @param settingName The name of the setting to resolve
106
+ * @param resolver function to be called for each SettingDictionary with a matching Setting. Iteration stops when it returns a non-undefined value.
107
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary or resolver never returned a value.
108
+ * @returns the resolved setting value.
109
+ */
110
+ resolveSetting<T extends SettingType>(settingName: SettingName, resolver: SettingResolver<T>, defaultValue: T): T;
111
+ resolveSetting<T extends SettingType>(settingName: SettingName, resolver: SettingResolver<T>, defaultValue?: T): T | undefined;
112
+ /** Get the highest priority setting for a SettingName.
113
+ * @param settingName The name of the setting
114
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary.
115
+ * @note This method is generic on SettingType, but no type checking is actually performed at run time. So, if you
116
+ * use this method to get a setting with an expected type, but its value is a different type, the return type of this method will be wrong.
117
+ * You must always type check the result. Use the non-generic "get" methods (e.g. [[getString]]) if you only want the value
118
+ * if its type is correct.
119
+ */
120
+ getSetting<T extends SettingType>(settingName: SettingName, defaultValue?: T): T | undefined;
121
+ /** Get a string setting by SettingName.
122
+ * @param settingName The name of the setting
123
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not a string.
124
+ */
125
+ getString(settingName: SettingName, defaultValue: string): string;
126
+ getString(settingName: SettingName, defaultValue?: string): string | undefined;
127
+ /** Get a boolean setting by SettingName.
128
+ * @param settingName The name of the setting
129
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not a boolean.
130
+ */
131
+ getBoolean(settingName: SettingName, defaultValue: boolean): boolean;
132
+ getBoolean(settingName: SettingName, defaultValue?: boolean): boolean | undefined;
133
+ /** Get a number setting by SettingName.
134
+ * @param settingName The name of the setting
135
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not a number.
136
+ */
137
+ getNumber(settingName: SettingName, defaultValue: number): number;
138
+ getNumber(settingName: SettingName): number | undefined;
139
+ /** Get an object setting by SettingName.
140
+ * @param settingName The name of the setting
141
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not an object.
142
+ */
143
+ getObject<T extends object>(settingName: SettingName, defaultValue: T): T;
144
+ getObject<T extends object>(settingName: SettingName): T | undefined;
145
+ /** Get an array setting by SettingName.
146
+ * @param settingName The name of the setting
147
+ * @param defaultValue value returned if settingName is not present in any SettingDictionary, or if the highest priority setting is not an array.
148
+ */
149
+ getArray<T extends SettingType>(settingName: SettingName, defaultValue: Array<T>): Array<T>;
150
+ getArray<T extends SettingType>(settingName: SettingName): Array<T> | undefined;
151
+ /** Get an array of [[SettingInspector] objects, sorted in priority order, for all Settings that match a SettingName.
152
+ * @note this method is mainly for debugging and diagnostics.
153
+ */
154
+ inspectSetting<T extends SettingType>(name: SettingName): SettingInspector<T>[];
155
+ }
156
+ /**
157
+ * Internal implementation of Settings interface.
158
+ * @internal
159
+ */
160
+ export declare class BaseSettings implements Settings {
161
+ private _dictionaries;
162
+ protected verifyPriority(_priority: SettingsPriority): void;
163
+ close(): void;
164
+ readonly onSettingsChanged: BeEvent<() => void>;
165
+ addFile(fileName: LocalFileName, priority: SettingsPriority): void;
166
+ addDirectory(dirName: LocalDirName, priority: SettingsPriority): void;
167
+ addJson(dictionaryName: string, priority: SettingsPriority, settingsJson: string): void;
168
+ addDictionary(dictionaryName: string, priority: SettingsPriority, settings: SettingDictionary): void;
169
+ dropDictionary(dictionaryName: DictionaryName, raiseEvent?: boolean): boolean;
170
+ resolveSetting<T extends SettingType>(name: SettingName, resolver: SettingResolver<T>, defaultValue?: T): T | undefined;
171
+ getSetting<T extends SettingType>(name: SettingName, defaultValue?: T): T | undefined;
172
+ /** for debugging. Returns an array of all values for a setting, sorted by priority.
173
+ * @note values are not cloned. Do not modify objects or arrays.
174
+ */
175
+ inspectSetting<T extends SettingType>(name: SettingName): SettingInspector<T>[];
176
+ getString(name: SettingName, defaultValue: string): string;
177
+ getString(name: SettingName): string | undefined;
178
+ getBoolean(name: SettingName, defaultValue: boolean): boolean;
179
+ getBoolean(name: SettingName): boolean | undefined;
180
+ getNumber(name: SettingName, defaultValue: number): number;
181
+ getNumber(name: SettingName): number | undefined;
182
+ getObject<T extends object>(name: SettingName, defaultValue: T): T;
183
+ getObject<T extends object>(name: SettingName): T | undefined;
184
+ getArray<T extends SettingType>(name: SettingName, defaultValue: Array<T>): Array<T>;
185
+ getArray<T extends SettingType>(name: SettingName): Array<T> | undefined;
186
+ }
187
187
  //# sourceMappingURL=Settings.d.ts.map