@itwin/core-backend 3.0.0-dev.100

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 +1525 -0
  2. package/LICENSE.md +9 -0
  3. package/README.md +11 -0
  4. package/lib/cjs/AliCloudStorageService.d.ts +12 -0
  5. package/lib/cjs/AliCloudStorageService.d.ts.map +1 -0
  6. package/lib/cjs/AliCloudStorageService.js +70 -0
  7. package/lib/cjs/AliCloudStorageService.js.map +1 -0
  8. package/lib/cjs/BackendHubAccess.d.ts +208 -0
  9. package/lib/cjs/BackendHubAccess.d.ts.map +1 -0
  10. package/lib/cjs/BackendHubAccess.js +42 -0
  11. package/lib/cjs/BackendHubAccess.js.map +1 -0
  12. package/lib/cjs/BackendLoggerCategory.d.ts +83 -0
  13. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -0
  14. package/lib/cjs/BackendLoggerCategory.js +91 -0
  15. package/lib/cjs/BackendLoggerCategory.js.map +1 -0
  16. package/lib/cjs/BisCoreSchema.d.ts +22 -0
  17. package/lib/cjs/BisCoreSchema.d.ts.map +1 -0
  18. package/lib/cjs/BisCoreSchema.js +61 -0
  19. package/lib/cjs/BisCoreSchema.js.map +1 -0
  20. package/lib/cjs/BriefcaseManager.d.ts +167 -0
  21. package/lib/cjs/BriefcaseManager.d.ts.map +1 -0
  22. package/lib/cjs/BriefcaseManager.js +406 -0
  23. package/lib/cjs/BriefcaseManager.js.map +1 -0
  24. package/lib/cjs/Category.d.ts +154 -0
  25. package/lib/cjs/Category.d.ts.map +1 -0
  26. package/lib/cjs/Category.js +244 -0
  27. package/lib/cjs/Category.js.map +1 -0
  28. package/lib/cjs/ChangeSummaryManager.d.ts +188 -0
  29. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -0
  30. package/lib/cjs/ChangeSummaryManager.js +444 -0
  31. package/lib/cjs/ChangeSummaryManager.js.map +1 -0
  32. package/lib/cjs/ChangedElementsDb.d.ts +97 -0
  33. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -0
  34. package/lib/cjs/ChangedElementsDb.js +166 -0
  35. package/lib/cjs/ChangedElementsDb.js.map +1 -0
  36. package/lib/cjs/ChangedElementsManager.d.ts +40 -0
  37. package/lib/cjs/ChangedElementsManager.d.ts.map +1 -0
  38. package/lib/cjs/ChangedElementsManager.js +89 -0
  39. package/lib/cjs/ChangedElementsManager.js.map +1 -0
  40. package/lib/cjs/CheckpointManager.d.ts +101 -0
  41. package/lib/cjs/CheckpointManager.d.ts.map +1 -0
  42. package/lib/cjs/CheckpointManager.js +257 -0
  43. package/lib/cjs/CheckpointManager.js.map +1 -0
  44. package/lib/cjs/ClassRegistry.d.ts +72 -0
  45. package/lib/cjs/ClassRegistry.d.ts.map +1 -0
  46. package/lib/cjs/ClassRegistry.js +154 -0
  47. package/lib/cjs/ClassRegistry.js.map +1 -0
  48. package/lib/cjs/CloudStorageBackend.d.ts +46 -0
  49. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -0
  50. package/lib/cjs/CloudStorageBackend.js +157 -0
  51. package/lib/cjs/CloudStorageBackend.js.map +1 -0
  52. package/lib/cjs/CodeSpecs.d.ts +51 -0
  53. package/lib/cjs/CodeSpecs.d.ts.map +1 -0
  54. package/lib/cjs/CodeSpecs.js +113 -0
  55. package/lib/cjs/CodeSpecs.js.map +1 -0
  56. package/lib/cjs/ConcurrentQuery.d.ts +12 -0
  57. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -0
  58. package/lib/cjs/ConcurrentQuery.js +24 -0
  59. package/lib/cjs/ConcurrentQuery.js.map +1 -0
  60. package/lib/cjs/DevTools.d.ts +72 -0
  61. package/lib/cjs/DevTools.d.ts.map +1 -0
  62. package/lib/cjs/DevTools.js +155 -0
  63. package/lib/cjs/DevTools.js.map +1 -0
  64. package/lib/cjs/DisplayStyle.d.ts +107 -0
  65. package/lib/cjs/DisplayStyle.d.ts.map +1 -0
  66. package/lib/cjs/DisplayStyle.js +292 -0
  67. package/lib/cjs/DisplayStyle.js.map +1 -0
  68. package/lib/cjs/ECDb.d.ts +196 -0
  69. package/lib/cjs/ECDb.d.ts.map +1 -0
  70. package/lib/cjs/ECDb.js +354 -0
  71. package/lib/cjs/ECDb.js.map +1 -0
  72. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -0
  73. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -0
  74. package/lib/cjs/ECSchemaXmlContext.js +36 -0
  75. package/lib/cjs/ECSchemaXmlContext.js.map +1 -0
  76. package/lib/cjs/ECSqlStatement.d.ts +467 -0
  77. package/lib/cjs/ECSqlStatement.d.ts.map +1 -0
  78. package/lib/cjs/ECSqlStatement.js +783 -0
  79. package/lib/cjs/ECSqlStatement.js.map +1 -0
  80. package/lib/cjs/Element.d.ts +1082 -0
  81. package/lib/cjs/Element.d.ts.map +1 -0
  82. package/lib/cjs/Element.js +1392 -0
  83. package/lib/cjs/Element.js.map +1 -0
  84. package/lib/cjs/ElementAspect.d.ts +157 -0
  85. package/lib/cjs/ElementAspect.d.ts.map +1 -0
  86. package/lib/cjs/ElementAspect.js +179 -0
  87. package/lib/cjs/ElementAspect.js.map +1 -0
  88. package/lib/cjs/ElementGraphics.d.ts +10 -0
  89. package/lib/cjs/ElementGraphics.d.ts.map +1 -0
  90. package/lib/cjs/ElementGraphics.js +42 -0
  91. package/lib/cjs/ElementGraphics.js.map +1 -0
  92. package/lib/cjs/Entity.d.ts +57 -0
  93. package/lib/cjs/Entity.d.ts.map +1 -0
  94. package/lib/cjs/Entity.js +63 -0
  95. package/lib/cjs/Entity.js.map +1 -0
  96. package/lib/cjs/ExportGraphics.d.ts +302 -0
  97. package/lib/cjs/ExportGraphics.d.ts.map +1 -0
  98. package/lib/cjs/ExportGraphics.js +206 -0
  99. package/lib/cjs/ExportGraphics.js.map +1 -0
  100. package/lib/cjs/ExternalSource.d.ts +95 -0
  101. package/lib/cjs/ExternalSource.d.ts.map +1 -0
  102. package/lib/cjs/ExternalSource.js +126 -0
  103. package/lib/cjs/ExternalSource.js.map +1 -0
  104. package/lib/cjs/GeometrySummary.d.ts +5 -0
  105. package/lib/cjs/GeometrySummary.d.ts.map +1 -0
  106. package/lib/cjs/GeometrySummary.js +378 -0
  107. package/lib/cjs/GeometrySummary.js.map +1 -0
  108. package/lib/cjs/IModelCloneContext.d.ts +74 -0
  109. package/lib/cjs/IModelCloneContext.d.ts.map +1 -0
  110. package/lib/cjs/IModelCloneContext.js +130 -0
  111. package/lib/cjs/IModelCloneContext.js.map +1 -0
  112. package/lib/cjs/IModelDb.d.ts +1107 -0
  113. package/lib/cjs/IModelDb.d.ts.map +1 -0
  114. package/lib/cjs/IModelDb.js +2161 -0
  115. package/lib/cjs/IModelDb.js.map +1 -0
  116. package/lib/cjs/IModelHost.d.ts +284 -0
  117. package/lib/cjs/IModelHost.d.ts.map +1 -0
  118. package/lib/cjs/IModelHost.js +411 -0
  119. package/lib/cjs/IModelHost.js.map +1 -0
  120. package/lib/cjs/IModelJsFs.d.ts +63 -0
  121. package/lib/cjs/IModelJsFs.d.ts.map +1 -0
  122. package/lib/cjs/IModelJsFs.js +141 -0
  123. package/lib/cjs/IModelJsFs.js.map +1 -0
  124. package/lib/cjs/IModelSchemaLoader.d.ts +26 -0
  125. package/lib/cjs/IModelSchemaLoader.d.ts.map +1 -0
  126. package/lib/cjs/IModelSchemaLoader.js +95 -0
  127. package/lib/cjs/IModelSchemaLoader.js.map +1 -0
  128. package/lib/cjs/IpcHost.d.ts +99 -0
  129. package/lib/cjs/IpcHost.d.ts.map +1 -0
  130. package/lib/cjs/IpcHost.js +234 -0
  131. package/lib/cjs/IpcHost.js.map +1 -0
  132. package/lib/cjs/LineStyle.d.ts +312 -0
  133. package/lib/cjs/LineStyle.d.ts.map +1 -0
  134. package/lib/cjs/LineStyle.js +296 -0
  135. package/lib/cjs/LineStyle.js.map +1 -0
  136. package/lib/cjs/LocalhostIpcHost.d.ts +19 -0
  137. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -0
  138. package/lib/cjs/LocalhostIpcHost.js +52 -0
  139. package/lib/cjs/LocalhostIpcHost.js.map +1 -0
  140. package/lib/cjs/Material.d.ts +102 -0
  141. package/lib/cjs/Material.d.ts.map +1 -0
  142. package/lib/cjs/Material.js +146 -0
  143. package/lib/cjs/Material.js.map +1 -0
  144. package/lib/cjs/Model.d.ts +387 -0
  145. package/lib/cjs/Model.d.ts.map +1 -0
  146. package/lib/cjs/Model.js +469 -0
  147. package/lib/cjs/Model.js.map +1 -0
  148. package/lib/cjs/NativeAppStorage.d.ts +52 -0
  149. package/lib/cjs/NativeAppStorage.d.ts.map +1 -0
  150. package/lib/cjs/NativeAppStorage.js +203 -0
  151. package/lib/cjs/NativeAppStorage.js.map +1 -0
  152. package/lib/cjs/NativeHost.d.ts +71 -0
  153. package/lib/cjs/NativeHost.d.ts.map +1 -0
  154. package/lib/cjs/NativeHost.js +221 -0
  155. package/lib/cjs/NativeHost.js.map +1 -0
  156. package/lib/cjs/NavigationRelationship.d.ts +157 -0
  157. package/lib/cjs/NavigationRelationship.d.ts.map +1 -0
  158. package/lib/cjs/NavigationRelationship.js +226 -0
  159. package/lib/cjs/NavigationRelationship.js.map +1 -0
  160. package/lib/cjs/PromiseMemoizer.d.ts +52 -0
  161. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -0
  162. package/lib/cjs/PromiseMemoizer.js +93 -0
  163. package/lib/cjs/PromiseMemoizer.js.map +1 -0
  164. package/lib/cjs/Relationship.d.ts +400 -0
  165. package/lib/cjs/Relationship.d.ts.map +1 -0
  166. package/lib/cjs/Relationship.js +460 -0
  167. package/lib/cjs/Relationship.js.map +1 -0
  168. package/lib/cjs/RpcBackend.d.ts +23 -0
  169. package/lib/cjs/RpcBackend.d.ts.map +1 -0
  170. package/lib/cjs/RpcBackend.js +94 -0
  171. package/lib/cjs/RpcBackend.js.map +1 -0
  172. package/lib/cjs/SQLiteDb.d.ts +66 -0
  173. package/lib/cjs/SQLiteDb.d.ts.map +1 -0
  174. package/lib/cjs/SQLiteDb.js +140 -0
  175. package/lib/cjs/SQLiteDb.js.map +1 -0
  176. package/lib/cjs/Schema.d.ts +56 -0
  177. package/lib/cjs/Schema.d.ts.map +1 -0
  178. package/lib/cjs/Schema.js +84 -0
  179. package/lib/cjs/Schema.js.map +1 -0
  180. package/lib/cjs/ServerBasedLocks.d.ts +64 -0
  181. package/lib/cjs/ServerBasedLocks.d.ts.map +1 -0
  182. package/lib/cjs/ServerBasedLocks.js +177 -0
  183. package/lib/cjs/ServerBasedLocks.js.map +1 -0
  184. package/lib/cjs/SqliteStatement.d.ts +264 -0
  185. package/lib/cjs/SqliteStatement.d.ts.map +1 -0
  186. package/lib/cjs/SqliteStatement.js +417 -0
  187. package/lib/cjs/SqliteStatement.js.map +1 -0
  188. package/lib/cjs/Texture.d.ts +59 -0
  189. package/lib/cjs/Texture.d.ts.map +1 -0
  190. package/lib/cjs/Texture.js +83 -0
  191. package/lib/cjs/Texture.js.map +1 -0
  192. package/lib/cjs/TxnManager.d.ts +203 -0
  193. package/lib/cjs/TxnManager.d.ts.map +1 -0
  194. package/lib/cjs/TxnManager.js +354 -0
  195. package/lib/cjs/TxnManager.js.map +1 -0
  196. package/lib/cjs/ViewDefinition.d.ts +432 -0
  197. package/lib/cjs/ViewDefinition.d.ts.map +1 -0
  198. package/lib/cjs/ViewDefinition.js +623 -0
  199. package/lib/cjs/ViewDefinition.js.map +1 -0
  200. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -0
  201. package/lib/cjs/core-backend.d.ts +162 -0
  202. package/lib/cjs/core-backend.d.ts.map +1 -0
  203. package/lib/cjs/core-backend.js +181 -0
  204. package/lib/cjs/core-backend.js.map +1 -0
  205. package/lib/cjs/domains/FunctionalElements.d.ts +102 -0
  206. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -0
  207. package/lib/cjs/domains/FunctionalElements.js +146 -0
  208. package/lib/cjs/domains/FunctionalElements.js.map +1 -0
  209. package/lib/cjs/domains/FunctionalSchema.d.ts +14 -0
  210. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -0
  211. package/lib/cjs/domains/FunctionalSchema.js +41 -0
  212. package/lib/cjs/domains/FunctionalSchema.js.map +1 -0
  213. package/lib/cjs/domains/GenericElements.d.ts +178 -0
  214. package/lib/cjs/domains/GenericElements.d.ts.map +1 -0
  215. package/lib/cjs/domains/GenericElements.js +264 -0
  216. package/lib/cjs/domains/GenericElements.js.map +1 -0
  217. package/lib/cjs/domains/GenericSchema.d.ts +11 -0
  218. package/lib/cjs/domains/GenericSchema.d.ts.map +1 -0
  219. package/lib/cjs/domains/GenericSchema.js +29 -0
  220. package/lib/cjs/domains/GenericSchema.js.map +1 -0
  221. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +16 -0
  222. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts.map +1 -0
  223. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +33 -0
  224. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -0
  225. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +40 -0
  226. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -0
  227. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +207 -0
  228. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -0
  229. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +21 -0
  230. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -0
  231. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +193 -0
  232. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -0
  233. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +37 -0
  234. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -0
  235. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +162 -0
  236. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -0
  237. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +17 -0
  238. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts.map +1 -0
  239. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +44 -0
  240. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -0
  241. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +16 -0
  242. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts.map +1 -0
  243. package/lib/cjs/rpc-impl/WipRpcImpl.js +35 -0
  244. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -0
  245. package/package.json +101 -0
@@ -0,0 +1,284 @@
1
+ /** @packageDocumentation
2
+ * @module IModelHost
3
+ */
4
+ import { IModelJsNative } from "@bentley/imodeljs-native";
5
+ import { TelemetryManager } from "@bentley/telemetry-client";
6
+ import { AccessToken, BeEvent, GuidString, Mutable } from "@itwin/core-bentley";
7
+ import { AuthorizationClient, SessionProps } from "@itwin/core-common";
8
+ import { BackendHubAccess } from "./BackendHubAccess";
9
+ import { CloudStorageService, CloudStorageServiceCredentials, CloudStorageTileUploader } from "./CloudStorageBackend";
10
+ /** @alpha */
11
+ export interface CrashReportingConfigNameValuePair {
12
+ name: string;
13
+ value: string;
14
+ }
15
+ /** Configuration of the crash-reporting system.
16
+ * @alpha
17
+ */
18
+ export interface CrashReportingConfig {
19
+ /** The directory to which *.dmp and/or iModelJsNativeCrash*.properties.txt files are written. This directory will be created if it does not already exist. */
20
+ crashDir: string;
21
+ /** max # .dmp files that may exist in crashDir. The default is 50. */
22
+ maxDumpsInDir?: number;
23
+ /** Enable crash-dumps? If so, .dmp and .properties.txt files will be generated and written to crashDir in the event of an unhandled native-code exception. If not, only .properties.txt files will be written. The default is false. */
24
+ enableCrashDumps?: boolean;
25
+ /** If enableCrashDumps is true, do you want a full-memory dump? Defaults to false. */
26
+ wantFullMemoryDumps?: boolean;
27
+ /** Enable node-report? If so, node-report files will be generated in the event of an unhandled exception or fatal error and written to crashDir. The default is false. */
28
+ enableNodeReport?: boolean;
29
+ /** Additional name, value pairs to write to iModelJsNativeCrash*.properties.txt file in the event of a crash. */
30
+ params?: CrashReportingConfigNameValuePair[];
31
+ /** Run this .js file to process .dmp and node-report files in the event of a crash.
32
+ * This script will be executed with a single command-line parameter: the name of the dump or node-report file.
33
+ * In the case of a dump file, there will be a second file with the same basename and the extension ".properties.txt".
34
+ * Since it runs in a separate process, this script will have no access to the Javascript
35
+ * context of the exiting backend. No default.
36
+ */
37
+ dumpProcessorScriptFileName?: string;
38
+ /** Upload crash dump and node-reports to Bentley's crash-reporting service? Defaults to false */
39
+ uploadToBentley?: boolean;
40
+ }
41
+ /** Configuration of core-backend.
42
+ * @public
43
+ */
44
+ export declare class IModelHostConfiguration {
45
+ /**
46
+ * Root of the directory holding all the files that iModel.js caches
47
+ * - If not specified at startup a platform specific default is used -
48
+ * - Windows: $(HOMEDIR)/AppData/Local/iModelJs/
49
+ * - Mac/iOS: $(HOMEDIR)/Library/Caches/iModelJs/
50
+ * - Linux: $(HOMEDIR)/.cache/iModelJs/
51
+ * where $(HOMEDIR) is documented [here](https://nodejs.org/api/os.html#os_os_homedir)
52
+ * - if specified, ensure it is set to a folder with read/write access.
53
+ * - Sub-folders within this folder organize various caches -
54
+ * - bc/ -> Briefcases
55
+ * - appSettings/ -> Offline application settings (only relevant in native applications)
56
+ * - etc.
57
+ * @see [[IModelHost.cacheDir]] for the value it's set to after startup
58
+ */
59
+ cacheDir?: string;
60
+ /** The directory where the app's assets are found. */
61
+ appAssetsDir?: string;
62
+ /** The kind of iModel hub server to use.
63
+ * @beta
64
+ */
65
+ hubAccess?: BackendHubAccess;
66
+ /** The credentials to use for the tile cache service. If omitted, a local cache will be used.
67
+ * @beta
68
+ */
69
+ tileCacheCredentials?: CloudStorageServiceCredentials;
70
+ /** Whether to restrict tile cache URLs by client IP address (if available).
71
+ * @beta
72
+ */
73
+ restrictTileUrlsByClientIp?: boolean;
74
+ /** Whether to compress cached tiles.
75
+ * Defaults to `true`.
76
+ */
77
+ compressCachedTiles?: boolean;
78
+ /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileTreeProps]($common) should wait before returning a "pending" status.
79
+ * @internal
80
+ */
81
+ tileTreeRequestTimeout: number;
82
+ /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileContent]($common) should wait before returning a "pending" status.
83
+ * @internal
84
+ */
85
+ tileContentRequestTimeout: number;
86
+ /** The default time, in milliseconds, used for [[tileTreeRequestTimeout]] and [[tileContentRequestTimeout]]. To change this, override one or both of those properties.
87
+ * @internal
88
+ */
89
+ static defaultTileRequestTimeout: number;
90
+ /** The default time, in seconds, used for [[logTileLoadTimeThreshold]]. To change this, override that property.
91
+ * @internal
92
+ */
93
+ static defaultLogTileLoadTimeThreshold: number;
94
+ /** The backend will log when a tile took longer to load than this threshold in seconds.
95
+ * @internal
96
+ */
97
+ logTileLoadTimeThreshold: number;
98
+ /** The default size, in bytes, used for [[logTileSizeThreshold]]. To change this, override that property.
99
+ * @internal
100
+ */
101
+ static defaultLogTileSizeThreshold: number;
102
+ /** The backend will log when a tile is loaded with a size in bytes above this threshold.
103
+ * @internal
104
+ */
105
+ logTileSizeThreshold: number;
106
+ /** Crash-reporting configuration
107
+ * @alpha
108
+ */
109
+ crashReportingConfig?: CrashReportingConfig;
110
+ }
111
+ /** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.
112
+ * See [the learning article]($docs/learning/backend/IModelHost.md)
113
+ * @public
114
+ */
115
+ export declare class IModelHost {
116
+ private constructor();
117
+ static authorizationClient?: AuthorizationClient;
118
+ /** @alpha */
119
+ static readonly telemetry: TelemetryManager;
120
+ static backendVersion: string;
121
+ private static _cacheDir;
122
+ private static _platform?;
123
+ /** @internal */
124
+ static get platform(): typeof IModelJsNative;
125
+ static configuration?: IModelHostConfiguration;
126
+ /** Event raised just after the backend IModelHost was started */
127
+ static readonly onAfterStartup: BeEvent<() => void>;
128
+ /** Event raised just before the backend IModelHost is to be shut down */
129
+ static readonly onBeforeShutdown: BeEvent<() => void>;
130
+ /** @internal */
131
+ static readonly session: Mutable<SessionProps>;
132
+ /** A uniqueId for this session */
133
+ static get sessionId(): GuidString;
134
+ static set sessionId(id: GuidString);
135
+ /** The Id of this application - needs to be set only if it is an agent application. The applicationId will otherwise originate at the frontend. */
136
+ static get applicationId(): string;
137
+ static set applicationId(id: string);
138
+ /** The version of this application - needs to be set if is an agent application. The applicationVersion will otherwise originate at the frontend. */
139
+ static get applicationVersion(): string;
140
+ static set applicationVersion(version: string);
141
+ /** Root of the directory holding all the files that iModel.js caches */
142
+ static get cacheDir(): string;
143
+ /** The optional [[FileNameResolver]] that resolves keys and partial file names for snapshot iModels. */
144
+ static snapshotFileNameResolver?: FileNameResolver;
145
+ /** Get the current access token for this IModelHost, or a blank string if none is available.
146
+ * @note for web backends, this will *always* return a blank string because the backend itself has no token (but never needs one either.)
147
+ * For all IpcHosts, where this backend is servicing a single frontend, this will be the user's token. For ElectronHost, the backend
148
+ * obtains the token and forwards it to the frontend.
149
+ * @note accessTokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value
150
+ * returned by this method may change over time throughout the course of a session.
151
+ */
152
+ static getAccessToken(): Promise<AccessToken>;
153
+ /** @internal */
154
+ static flushLog(): void;
155
+ /** @internal */
156
+ static loadNative(): void;
157
+ private static registerPlatform;
158
+ private static validateNativePlatformVersion;
159
+ /**
160
+ * @beta
161
+ * @note A reference implementation is set by default for [AzureBlobStorage]. To supply a different implementation for any service provider (such as AWS),
162
+ * set this property with a custom [CloudStorageService] and also set [IModelHostConfiguration.tileCacheCredentials] using "external" for the service name.
163
+ * Note that the account and access key members of [CloudStorageServiceCredentials] may have blank values unless the custom service implementation uses them.
164
+ */
165
+ static tileCacheService: CloudStorageService;
166
+ /** @internal */
167
+ static tileUploader: CloudStorageTileUploader;
168
+ private static _hubAccess;
169
+ /** @internal */
170
+ static setHubAccess(hubAccess: BackendHubAccess): void;
171
+ /** Provides access to the IModelHub for this IModelHost
172
+ * @beta
173
+ */
174
+ static get hubAccess(): BackendHubAccess;
175
+ private static _isValid;
176
+ /** Returns true if IModelHost is started. */
177
+ static get isValid(): boolean;
178
+ /** This method must be called before any iModel.js services are used.
179
+ * @param configuration Host configuration data.
180
+ * Raises [[onAfterStartup]].
181
+ * @see [[shutdown]].
182
+ */
183
+ static startup(configuration?: IModelHostConfiguration): Promise<void>;
184
+ private static _briefcaseCacheDir;
185
+ private static logStartup;
186
+ private static setupCacheDirs;
187
+ /** This method must be called when an iModel.js services is shut down. Raises [[onBeforeShutdown]] */
188
+ static shutdown(): Promise<void>;
189
+ /**
190
+ * Add or update a property that should be included in a crash report.
191
+ * @param name The name of the property
192
+ * @param value The value of the property
193
+ * @alpha
194
+ */
195
+ static setCrashReportProperty(name: string, value: string): void;
196
+ /**
197
+ * Remove a previously defined property so that will not be included in a crash report.
198
+ * @param name The name of the property
199
+ * @alpha
200
+ */
201
+ static removeCrashReportProperty(name: string): void;
202
+ /**
203
+ * Get all properties that will be included in a crash report.
204
+ * @alpha
205
+ */
206
+ static getCrashReportProperties(): CrashReportingConfigNameValuePair[];
207
+ /** The directory where application assets may be found */
208
+ static get appAssetsDir(): string | undefined;
209
+ /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileTreeProps]($common) should wait before returning a "pending" status.
210
+ * @internal
211
+ */
212
+ static get tileTreeRequestTimeout(): number;
213
+ /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileContent]($common) should wait before returning a "pending" status.
214
+ * @internal
215
+ */
216
+ static get tileContentRequestTimeout(): number;
217
+ /** The backend will log when a tile took longer to load than this threshold in seconds. */
218
+ static get logTileLoadTimeThreshold(): number;
219
+ /** The backend will log when a tile is loaded with a size in bytes above this threshold. */
220
+ static get logTileSizeThreshold(): number;
221
+ /** Whether external tile caching is active.
222
+ * @internal
223
+ */
224
+ static get usingExternalTileCache(): boolean;
225
+ /** Whether to restrict tile cache URLs by client IP address.
226
+ * @internal
227
+ */
228
+ static get restrictTileUrlsByClientIp(): boolean;
229
+ /** Whether to compress cached tiles.
230
+ * @internal
231
+ */
232
+ static get compressCachedTiles(): boolean;
233
+ private static setupTileCache;
234
+ }
235
+ /** Information about the platform on which the app is running. Also see [[KnownLocations]] and [[IModelJsFs]].
236
+ * @public
237
+ */
238
+ export declare class Platform {
239
+ /** Get the name of the platform. */
240
+ static get platformName(): "win32" | "linux" | "darwin" | "ios" | "android" | "uwp";
241
+ /** @internal */
242
+ static load(): typeof IModelJsNative;
243
+ }
244
+ /** Well known directories that may be used by the application. Also see [[Platform]]
245
+ * @public
246
+ */
247
+ export declare class KnownLocations {
248
+ /** The directory where the imodeljs-native assets are stored. */
249
+ static get nativeAssetsDir(): string;
250
+ /** The directory where the core-backend assets are stored. */
251
+ static get packageAssetsDir(): string;
252
+ /** The temporary directory. */
253
+ static get tmpdir(): string;
254
+ }
255
+ /** Extend this class to provide custom file name resolution behavior.
256
+ * @note Only `tryResolveKey` and/or `tryResolveFileName` need to be overridden as the implementations of `resolveKey` and `resolveFileName` work for most purposes.
257
+ * @see [[IModelHost.snapshotFileNameResolver]]
258
+ * @public
259
+ */
260
+ export declare abstract class FileNameResolver {
261
+ /** Resolve a file name from the specified key.
262
+ * @param _fileKey The key that identifies the file name in a `Map` or other similar data structure.
263
+ * @returns The resolved file name or `undefined` if not found.
264
+ */
265
+ tryResolveKey(_fileKey: string): string | undefined;
266
+ /** Resolve a file name from the specified key.
267
+ * @param fileKey The key that identifies the file name in a `Map` or other similar data structure.
268
+ * @returns The resolved file name.
269
+ * @throws [[IModelError]] if not found.
270
+ */
271
+ resolveKey(fileKey: string): string;
272
+ /** Resolve the input file name, which may be a partial name, into a full path file name.
273
+ * @param inFileName The partial file name.
274
+ * @returns The resolved full path file name or `undefined` if not found.
275
+ */
276
+ tryResolveFileName(inFileName: string): string | undefined;
277
+ /** Resolve the input file name, which may be a partial name, into a full path file name.
278
+ * @param inFileName The partial file name.
279
+ * @returns The resolved full path file name.
280
+ * @throws [[IModelError]] if not found.
281
+ */
282
+ resolveFileName(inFileName: string): string;
283
+ }
284
+ //# sourceMappingURL=IModelHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IModelHost.d.ts","sourceRoot":"","sources":["../../src/IModelHost.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAU,OAAO,EAAQ,UAAU,EAAkC,OAAO,EAAmB,MAAM,qBAAqB,CAAC;AAC/I,OAAO,EAAE,mBAAmB,EAA8B,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAAoB,mBAAmB,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAexI,aAAa;AACb,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8JAA8J;IAC9J,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wOAAwO;IACxO,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0KAA0K;IAC1K,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iHAAiH;IACjH,MAAM,CAAC,EAAE,iCAAiC,EAAE,CAAC;IAC7C;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,iGAAiG;IACjG,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,qBAAa,u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