@itwin/core-backend 4.8.0-dev.3 → 4.8.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/lib/cjs/BackendLoggerCategory.d.ts +3 -1
- package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js +2 -0
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BlobContainerService.d.ts +3 -3
- package/lib/cjs/BlobContainerService.d.ts.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +21 -13
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +24 -6
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.d.ts +4 -4
- package/lib/cjs/CodeService.d.ts.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts +10 -0
- package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +20 -23
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +14 -9
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +53 -17
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +8 -1
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +24 -15
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/PropertyStore.d.ts +17 -7
- package/lib/cjs/PropertyStore.d.ts.map +1 -1
- package/lib/cjs/PropertyStore.js +11 -5
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +2 -3
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +2 -3
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +1 -1
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/TextAnnotationGeometry.d.ts +5 -1
- package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/cjs/TextAnnotationGeometry.js +11 -8
- package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/TextAnnotationLayout.d.ts +21 -13
- package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -1
- package/lib/cjs/TextAnnotationLayout.js +119 -90
- package/lib/cjs/TextAnnotationLayout.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts +16 -2
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +14 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +33 -0
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +17 -21
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +80 -38
- package/lib/cjs/assets/Settings/backend.setting.json5 +8 -119
- package/lib/cjs/core-backend.d.ts +2 -1
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -2
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/internal/ImplementationProhibited.d.ts +44 -0
- package/lib/cjs/internal/ImplementationProhibited.d.ts.map +1 -0
- package/lib/cjs/internal/ImplementationProhibited.js +51 -0
- package/lib/cjs/internal/ImplementationProhibited.js.map +1 -0
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts +43 -0
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -0
- package/lib/cjs/internal/workspace/SettingsImpl.js +161 -0
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -0
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.d.ts +6 -0
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.d.ts.map +1 -0
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +276 -0
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -0
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +41 -0
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -0
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +696 -0
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -0
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts +10 -0
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -0
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +41 -0
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -2
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +167 -138
- package/lib/cjs/workspace/Settings.d.ts.map +1 -1
- package/lib/cjs/workspace/Settings.js +68 -138
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +112 -48
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js +1 -172
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +411 -277
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js +76 -457
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.d.ts +245 -0
- package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -0
- package/lib/cjs/workspace/WorkspaceEditor.js +34 -0
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -0
- package/package.json +12 -12
- package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +0 -45
|
@@ -3,185 +3,214 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BeEvent, JSONSchemaType } from "@itwin/core-bentley";
|
|
5
5
|
import { LocalDirName, LocalFileName } from "@itwin/core-common";
|
|
6
|
-
|
|
6
|
+
import { WorkspaceDb } from "./Workspace";
|
|
7
|
+
import { implementationProhibited } from "../internal/ImplementationProhibited";
|
|
8
|
+
/** The value of a single named parameter within a [[Workspace.settings]] that configures some aspect of the applications run-time behavior.
|
|
9
|
+
* Settings are stored in a [[SettingsDictionary]]. A setting is described by its [[SettingSchema]].
|
|
7
10
|
* @beta
|
|
8
11
|
*/
|
|
9
|
-
export type
|
|
12
|
+
export type Setting = JSONSchemaType;
|
|
13
|
+
/** @beta */
|
|
14
|
+
export declare namespace Setting {
|
|
15
|
+
/** Create a deep copy of a [[Setting]]. */
|
|
16
|
+
function clone<T extends Setting>(setting: T): T;
|
|
17
|
+
/** Returns true if `a` and `b` are considered equivalent [[Setting]] values.
|
|
18
|
+
* Settings of primitive types like `number` and `string` are compared using `===`.
|
|
19
|
+
* Settings of type "object" are compared by comparing each property using `areEqual`; the objects are considered
|
|
20
|
+
* equal if they have the exact same set of property names with equivalent values.
|
|
21
|
+
* Settings of type "array" are compared by comparing each element of the arrays use `areEqual`; the arrays are considered
|
|
22
|
+
* equal if they have the same number of elements with equivalent values in the same exact order.
|
|
23
|
+
*/
|
|
24
|
+
function areEqual(a: Setting | undefined, b: Setting | undefined): boolean;
|
|
25
|
+
}
|
|
10
26
|
/**
|
|
11
|
-
* The name of a
|
|
12
|
-
*
|
|
27
|
+
* The name of a [[Setting]].
|
|
28
|
+
* Setting names must be [valid JavaScript property names](https://developer.mozilla.org/en-US/docs/Glossary/property/JavaScript) containing no spaces or periods.
|
|
29
|
+
* The name of a setting begins with the schema prefix of the [[SettingGroupSchema]] in which its [[SettingSchema]] is defined.
|
|
30
|
+
* A setting name therefore forms a path like file names in a file system.
|
|
31
|
+
* For example, the following are setting names defined in the `energyAnalysis`, `iot-scan-visualization`, and `vibration-map` schemas.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* "energyAnalysis/formats/totalWork"
|
|
35
|
+
* "energyAnalysis/formats/totalHours"
|
|
36
|
+
* "energyAnalysis/units/power"
|
|
37
|
+
* "energyAnalysis/units/temperature"
|
|
38
|
+
* "energyAnalysis/startupMode"
|
|
39
|
+
* "iot-scan-visualization/ports/cameras"
|
|
40
|
+
* "vibration-map/filters/scope"
|
|
41
|
+
* "vibration-map/filters/prefabricated"
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
13
44
|
* @beta
|
|
14
45
|
*/
|
|
15
46
|
export type SettingName = string;
|
|
16
|
-
/**
|
|
17
|
-
* DictionaryNames must be valid JavaScript property names.
|
|
47
|
+
/** An object that defines the values for any number of [[Setting]]s. Each of its properties' names must conform to the semantics of a [[SettingName]].
|
|
18
48
|
* @beta
|
|
19
49
|
*/
|
|
20
|
-
export
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
50
|
+
export interface SettingsContainer {
|
|
51
|
+
/** Accesses settings by their names. */
|
|
52
|
+
[name: SettingName]: Setting | undefined;
|
|
53
|
+
}
|
|
54
|
+
/** Defines the precedence of a [[SettingsDictionary]].
|
|
55
|
+
* [[Settings]] may contain multiple dictionaries containing different values for the same [[SettingName]].
|
|
56
|
+
* When resolving the value of a [[Setting]], the value from the highest-priority dictionary is used.
|
|
57
|
+
* Priorities are grouped into coarse categories like [[SettingsPriority.application]] and [[SettingsPriority.iModel]].
|
|
58
|
+
* Settings with priorities less than or equal to [[SettingsPriority.application]] are stored in [[IModelHost.appWorkspace]], while
|
|
59
|
+
* those with priorities higher than [[SettingsPriority.application]] are stored inside [[IModelDb.workspace]].
|
|
28
60
|
* @beta
|
|
29
61
|
*/
|
|
30
|
-
export type
|
|
31
|
-
/**
|
|
62
|
+
export type SettingsPriority = number;
|
|
63
|
+
/** @beta */
|
|
64
|
+
export declare namespace SettingsPriority {
|
|
65
|
+
/** Settings that originate from default setting files loaded automatically at the start of a session. */
|
|
66
|
+
const defaults = 100;
|
|
67
|
+
/** Settings supplied by an application at runtime. */
|
|
68
|
+
const application = 200;
|
|
69
|
+
/** Settings that apply to all iTwins for an organization. */
|
|
70
|
+
const organization = 300;
|
|
71
|
+
/** Settings that apply to all iModels in an iTwin. */
|
|
72
|
+
const iTwin = 400;
|
|
73
|
+
/** Settings that apply to all branches of an iModel. */
|
|
74
|
+
const branch = 500;
|
|
75
|
+
/** Settings that apply to a specific iModel. */
|
|
76
|
+
const iModel = 600;
|
|
77
|
+
}
|
|
78
|
+
/** A named container that supplies values for [[Setting]]s.
|
|
79
|
+
* @see [[Settings.addDictionary]] to register a new settings dictionary.
|
|
32
80
|
* @beta
|
|
33
|
-
*
|
|
34
81
|
*/
|
|
35
|
-
export interface
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
82
|
+
export interface SettingsDictionary {
|
|
83
|
+
/** @internal */
|
|
84
|
+
[implementationProhibited]: unknown;
|
|
85
|
+
/** Metadata describing the dictionary. */
|
|
86
|
+
readonly props: SettingsDictionaryProps;
|
|
87
|
+
/** Obtain a copy of the value of the setting named `settingName` stored in this dictionary, or `undefined` if no such setting exists.
|
|
88
|
+
* The returned value is always cloned using [[Setting.clone]].
|
|
89
|
+
* @note Generally, applications use methods like [[Settings.getString]] and [[Setting.getArray]] to resolve a setting value from multiple
|
|
90
|
+
* dictionaries. Those methods - unlike this one - also validate that `settingName` is of type `T` as defined by its [[SettingSchema]].
|
|
91
|
+
*/
|
|
92
|
+
getSetting<T extends Setting>(settingName: SettingName): T | undefined;
|
|
39
93
|
}
|
|
40
|
-
/**
|
|
94
|
+
/** Uniquely identifies a [[SettingsDictionary]].
|
|
41
95
|
* @beta
|
|
42
96
|
*/
|
|
43
|
-
export interface
|
|
44
|
-
|
|
97
|
+
export interface SettingsDictionarySource {
|
|
98
|
+
/** The name of the dictionary, which must be unique within its [[workspaceDb]], or - if [[workspaceDb]] is undefined - unique among all dictionaries not associated with any [[WorkspaceDb]]. */
|
|
99
|
+
readonly name: string;
|
|
100
|
+
/** The [[WorkspaceDb]] from which the dictionary originated. */
|
|
101
|
+
readonly workspaceDb?: WorkspaceDb;
|
|
45
102
|
}
|
|
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
|
|
103
|
+
/** Properties of a [[SettingsDictionary]], defining its name, the [[WorkspaceDb]] (if any) from which it originated, and its [[priority]] relative to other dictionaries.
|
|
49
104
|
* @beta
|
|
50
105
|
*/
|
|
51
|
-
export
|
|
52
|
-
/**
|
|
53
|
-
|
|
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
|
|
106
|
+
export interface SettingsDictionaryProps extends SettingsDictionarySource {
|
|
107
|
+
/** Precedence value determining which setting value to use when multiple dictionaries supply values for the same [[SettingName]]. */
|
|
108
|
+
readonly priority: SettingsPriority;
|
|
67
109
|
}
|
|
68
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* The collection of [[Setting]]s that supply the run-time configuration of a [[Workspace]].
|
|
112
|
+
* The `Settings` object comprises a collection of named [[SettingsDictionary]] objects.
|
|
113
|
+
* Methods like [[getSetting]], [[getString]], and [[getArray]] provide access to the value of an individual [[Setting]] by searching
|
|
114
|
+
* the [[dictionaries]] in order by their [[SettingsPriority]] to find the highest-priority setting with the requested [[SettingName]].
|
|
115
|
+
* Most methods that retrieve [[Setting]] values validate them against their [[SettingSchema]]s to ensure that they are of the correct type.
|
|
116
|
+
* A [[SettingsDictionary]] can be added or removed using [[addDictionary]] and [[dropDictionary]].
|
|
117
|
+
* Because [[Setting]]s can change at any time during the session, you should avoid caching their values wherever possible.
|
|
118
|
+
* If you must cache them (for example, to display in a user interface), you should listen for the [[onSettingsChanged]] event to be
|
|
119
|
+
* notified of potential changes.
|
|
120
|
+
*
|
|
121
|
+
* Settings are accessed via [[Workspace.settings]]. They are defined at the application level by [[IModelHost.appWorkspace]], but individual iModels may supply
|
|
122
|
+
* additional iModel-specific settings or overrides for application-level settings. When working in the context of a specific iModel, use [[IModelDb.workspace]]'s `settings`
|
|
123
|
+
* property. Any settings not overridden by the iModel will fall back to the settings defined in [[IModelHost.appWorkspace]].
|
|
124
|
+
*
|
|
125
|
+
* Application settings are loaded into [[IModelHost.appWorkspace]] when the session begins (i.e., when [[IModelHost.startup]] is invoked), and unloaded when it ends (in [[IModelHost.shutdown]]).
|
|
126
|
+
* They are read from [JSON5](https://json5.org/) files delivered with the application. The application should register any additional [[SettingsDictionary]]'s '(and their corresponding
|
|
127
|
+
* [[SettingGroupSchema]]s) at this time.
|
|
128
|
+
*
|
|
129
|
+
* iModel-specific settings are stored in the iModel's property table and loaded into [[IModelDb.workspace]] when the iModel is first opened.
|
|
130
|
+
* You can add and remove a [[SettingsDictionary]] from the property table using [[IModelDb.saveSettingDictionary]] and [[IModelDb.deleteSettingDictionary]].
|
|
131
|
+
*
|
|
132
|
+
* See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.
|
|
133
|
+
*
|
|
134
|
+
* @see [[IModelHost.appWorkspace]] application-wide settings, and [[IModelDb.workspace]] for settings specific to a given iModel.
|
|
69
135
|
* @beta
|
|
70
136
|
*/
|
|
71
137
|
export interface Settings {
|
|
138
|
+
/** @internal */
|
|
139
|
+
[implementationProhibited]: unknown;
|
|
72
140
|
/** @internal */
|
|
73
141
|
close(): void;
|
|
74
|
-
/**
|
|
142
|
+
/** The set of settings dictionaries from which [[Setting]] values are obtained, sorted by [[SettingsPriority]].
|
|
143
|
+
* The set can contain at most one dictionary for each unique combination of name and [[WorkspaceDb]].
|
|
144
|
+
* @see [[addDictionary]], [[addFile]], [[addJson]], and [[addDirectory]] to add a new dictionary.
|
|
145
|
+
* @see [[dropDictionary]] to remove a dictionary.
|
|
146
|
+
* @see [[getDictionary]] to look up a dictionary.
|
|
147
|
+
*/
|
|
148
|
+
readonly dictionaries: readonly SettingsDictionary[];
|
|
149
|
+
/** Event raised whenever a [[SettingsDictionary]] is added or removed. */
|
|
75
150
|
readonly onSettingsChanged: BeEvent<() => void>;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param fileName the name of a local settings file
|
|
79
|
-
* @param priority the
|
|
80
|
-
* @note If the SettingDictionary was previously added, the new content overrides the old content.
|
|
151
|
+
/** Parses the contents of a local [JSON5](https://json5.org/) file as a [[SettingsContainer]] and invokes [[addDictionary]] to
|
|
152
|
+
* add a [[SettingsDictionary]] named `fileName` with the specified priority.
|
|
153
|
+
* @param fileName the name of a local settings file containing the dictionary.
|
|
154
|
+
* @param priority the priority for the dictionary.
|
|
81
155
|
*/
|
|
82
156
|
addFile(fileName: LocalFileName, priority: SettingsPriority): void;
|
|
83
|
-
/**
|
|
84
|
-
|
|
157
|
+
/** Invokes [[addFile]] for all files in `directory` with the extension ".json" or ".json5". */
|
|
158
|
+
addDirectory(directory: LocalDirName, priority: SettingsPriority): void;
|
|
159
|
+
/** Parses `settingsJson` as a [[SettingsContainer]] and invokes [[addDictionary]] to add a [[SettingsDictionary]] with the specified `props`.
|
|
160
|
+
* This is typically used when reading dictionaries out of a [[WorkspaceDb]], where they are stored as stringified JSON.
|
|
85
161
|
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
* @
|
|
91
|
-
* @
|
|
162
|
+
addJson(props: SettingsDictionaryProps, settingsJson: string): void;
|
|
163
|
+
/** Find a [[SettingsDictionary]] with the same name and [[WorkspaceDb]] as `source`. */
|
|
164
|
+
getDictionary(source: SettingsDictionarySource): SettingsDictionary | undefined;
|
|
165
|
+
/** Add a new [[SettingsDictionary]] with the priority, name, and [[WorkspaceDb]] specified by `props` and setting values supplied by `settings`.
|
|
166
|
+
* @note If a dictionary with the same name and [[WorkspaceDb]] already exists, it will be replaced.
|
|
167
|
+
* @see [[addFile]], [[addJson]], and [[addDirectory]] for convenient ways to add dictionaries from various sources.
|
|
92
168
|
*/
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
* @
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
169
|
+
addDictionary(props: SettingsDictionaryProps, settings: SettingsContainer): void;
|
|
170
|
+
/** Removes a previously-added [[SettingsDictionary]]. */
|
|
171
|
+
dropDictionary(props: SettingsDictionarySource): void;
|
|
172
|
+
/** Looks up the highest priority setting value for a SettingName, falling back to a default value if no value for the setting is found.
|
|
173
|
+
* The [[dictionaries]] are searched in order by [[SettingsPriority]]; the first one that provides a value for `settingName` wins.
|
|
174
|
+
* @param settingName The name of the setting.
|
|
175
|
+
* @param defaultValue value returned if settingName is not present in any [[SettingsDictionary]].
|
|
176
|
+
* @note This method is generic on [[Setting]] type, but no type checking is actually performed at run time. So, if you
|
|
116
177
|
* 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
|
|
178
|
+
* You must always type check the result. Use the non-generic "get" methods like [[getString]] and [[getArray]] if you only want the value
|
|
118
179
|
* if its type is correct.
|
|
180
|
+
* @note Unlike [[getArray]], this method does not combine arrays - it ignores [[SettingsSchema.combineArrays]].
|
|
119
181
|
*/
|
|
120
|
-
getSetting<T extends
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
|
|
182
|
+
getSetting<T extends Setting>(settingName: SettingName, defaultValue?: T): T | undefined;
|
|
183
|
+
/** Obtain an iterator over all of the values in the [[dictionaries]] for the [[Setting]] identified by `settingName`, ordered by [[SettingsPriority]]. */
|
|
184
|
+
getSettingEntries<T extends Setting>(settingName: SettingName): Iterable<{
|
|
185
|
+
value: T;
|
|
186
|
+
dictionary: SettingsDictionary;
|
|
187
|
+
}>;
|
|
188
|
+
/** Obtain an iterator over all of the values in the [[dictionaries]] for the [[Setting]] identified by `settingName`, ordered by [[SettingsPriority]]. */
|
|
189
|
+
getSettingValues<T extends Setting>(settingName: SettingName): Iterable<T>;
|
|
190
|
+
/** Look up the value of a string [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.
|
|
191
|
+
* @throws Error if the setting exists but is not a string.
|
|
124
192
|
*/
|
|
125
193
|
getString(settingName: SettingName, defaultValue: string): string;
|
|
126
194
|
getString(settingName: SettingName, defaultValue?: string): string | undefined;
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*/
|
|
195
|
+
/** Look up the value of a boolean [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.
|
|
196
|
+
* @throws Error if the setting exists but is not a boolean.
|
|
197
|
+
*/
|
|
131
198
|
getBoolean(settingName: SettingName, defaultValue: boolean): boolean;
|
|
132
199
|
getBoolean(settingName: SettingName, defaultValue?: boolean): boolean | undefined;
|
|
133
|
-
/**
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
*/
|
|
200
|
+
/** Look up the value of a numeric [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.
|
|
201
|
+
* @throws Error if the setting exists but is not a number.
|
|
202
|
+
*/
|
|
137
203
|
getNumber(settingName: SettingName, defaultValue: number): number;
|
|
138
204
|
getNumber(settingName: SettingName): number | undefined;
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
*/
|
|
205
|
+
/** Look up the value of an object [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.
|
|
206
|
+
* @throws Error if the setting exists but is not an object.
|
|
207
|
+
*/
|
|
143
208
|
getObject<T extends object>(settingName: SettingName, defaultValue: T): T;
|
|
144
209
|
getObject<T extends object>(settingName: SettingName): T | undefined;
|
|
145
|
-
/**
|
|
146
|
-
|
|
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.
|
|
210
|
+
/** Look up the value of an array [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.
|
|
211
|
+
* @throws Error if the setting exists but is not an array.
|
|
174
212
|
*/
|
|
175
|
-
|
|
176
|
-
|
|
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;
|
|
213
|
+
getArray<T extends Setting>(settingName: SettingName, defaultValue: Array<T>): Array<T>;
|
|
214
|
+
getArray<T extends Setting>(settingName: SettingName): Array<T> | undefined;
|
|
186
215
|
}
|
|
187
216
|
//# sourceMappingURL=Settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../src/workspace/Settings.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../src/workspace/Settings.ts"],"names":[],"mappings":"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"}
|
|
@@ -7,150 +7,80 @@
|
|
|
7
7
|
* @module Workspace
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function deepClone(obj) {
|
|
35
|
-
if (!obj || typeof obj !== "object")
|
|
36
|
-
return obj;
|
|
37
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
38
|
-
Object.keys(obj).forEach((key) => {
|
|
39
|
-
const val = obj[key];
|
|
40
|
-
if (val && typeof val === "object") {
|
|
41
|
-
result[key] = deepClone(val);
|
|
10
|
+
exports.SettingsPriority = exports.Setting = void 0;
|
|
11
|
+
const ImplementationProhibited_1 = require("../internal/ImplementationProhibited");
|
|
12
|
+
/** @beta */
|
|
13
|
+
var Setting;
|
|
14
|
+
(function (Setting) {
|
|
15
|
+
/** Create a deep copy of a [[Setting]]. */
|
|
16
|
+
function clone(setting) {
|
|
17
|
+
if (!setting || typeof setting !== "object")
|
|
18
|
+
return setting;
|
|
19
|
+
const result = Array.isArray(setting) ? [] : {};
|
|
20
|
+
Object.keys(setting).forEach((key) => result[key] = clone(setting[key]));
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
Setting.clone = clone;
|
|
24
|
+
/** Returns true if `a` and `b` are considered equivalent [[Setting]] values.
|
|
25
|
+
* Settings of primitive types like `number` and `string` are compared using `===`.
|
|
26
|
+
* Settings of type "object" are compared by comparing each property using `areEqual`; the objects are considered
|
|
27
|
+
* equal if they have the exact same set of property names with equivalent values.
|
|
28
|
+
* Settings of type "array" are compared by comparing each element of the arrays use `areEqual`; the arrays are considered
|
|
29
|
+
* equal if they have the same number of elements with equivalent values in the same exact order.
|
|
30
|
+
*/
|
|
31
|
+
function areEqual(a, b) {
|
|
32
|
+
if (a === b) {
|
|
33
|
+
return true;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
// For primitive types, === suffices.
|
|
36
|
+
if (typeof a !== "object" || typeof b !== "object") {
|
|
37
|
+
return false;
|
|
45
38
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class SettingsDictionary {
|
|
50
|
-
constructor(name, priority, settings) {
|
|
51
|
-
this.name = name;
|
|
52
|
-
this.priority = priority;
|
|
53
|
-
this.settings = settings;
|
|
54
|
-
}
|
|
55
|
-
getSetting(settingName) {
|
|
56
|
-
return this.settings[settingName];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Internal implementation of Settings interface.
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
class BaseSettings {
|
|
64
|
-
constructor() {
|
|
65
|
-
this._dictionaries = [];
|
|
66
|
-
this.onSettingsChanged = new core_bentley_1.BeEvent();
|
|
67
|
-
}
|
|
68
|
-
verifyPriority(_priority) { }
|
|
69
|
-
close() { }
|
|
70
|
-
addFile(fileName, priority) {
|
|
71
|
-
this.addJson(fileName, priority, fs.readFileSync(fileName, "utf-8"));
|
|
72
|
-
}
|
|
73
|
-
addDirectory(dirName, priority) {
|
|
74
|
-
for (const fileName of IModelJsFs_1.IModelJsFs.readdirSync(dirName)) {
|
|
75
|
-
const ext = (0, path_1.extname)(fileName);
|
|
76
|
-
if (ext === ".json5" || ext === ".json")
|
|
77
|
-
this.addFile((0, path_1.join)(dirName, fileName), priority);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
addJson(dictionaryName, priority, settingsJson) {
|
|
81
|
-
this.addDictionary(dictionaryName, priority, (0, json5_1.parse)(settingsJson));
|
|
82
|
-
}
|
|
83
|
-
addDictionary(dictionaryName, priority, settings) {
|
|
84
|
-
this.verifyPriority(priority);
|
|
85
|
-
this.dropDictionary(dictionaryName, false); // make sure we don't have the same dictionary twice
|
|
86
|
-
const file = new SettingsDictionary(dictionaryName, priority, settings);
|
|
87
|
-
const doAdd = () => {
|
|
88
|
-
for (let i = 0; i < this._dictionaries.length; ++i) {
|
|
89
|
-
if (this._dictionaries[i].priority <= file.priority) {
|
|
90
|
-
this._dictionaries.splice(i, 0, file);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
39
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
40
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {
|
|
41
|
+
return false;
|
|
93
42
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
dropDictionary(dictionaryName, raiseEvent = true) {
|
|
100
|
-
for (let i = 0; i < this._dictionaries.length; ++i) {
|
|
101
|
-
if (this._dictionaries[i].name === dictionaryName) {
|
|
102
|
-
this._dictionaries.splice(i, 1);
|
|
103
|
-
if (raiseEvent)
|
|
104
|
-
this.onSettingsChanged.raiseEvent();
|
|
105
|
-
return true;
|
|
43
|
+
for (let i = 0; i < a.length; i++) {
|
|
44
|
+
if (!areEqual(a[i], b[i])) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
106
47
|
}
|
|
48
|
+
return true;
|
|
107
49
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
50
|
+
const aKeys = Object.keys(a);
|
|
51
|
+
const bKeys = Object.keys(b);
|
|
52
|
+
if (aKeys.length !== bKeys.length) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
aKeys.sort();
|
|
56
|
+
bKeys.sort();
|
|
57
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
58
|
+
const key = aKeys[i];
|
|
59
|
+
if (key !== bKeys[i]) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (!areEqual(a[key], b[key])) {
|
|
63
|
+
return false;
|
|
116
64
|
}
|
|
117
65
|
}
|
|
118
|
-
return
|
|
119
|
-
}
|
|
120
|
-
getSetting(name, defaultValue) {
|
|
121
|
-
return this.resolveSetting(name, (val) => deepClone(val)) ?? defaultValue;
|
|
122
|
-
}
|
|
123
|
-
/** for debugging. Returns an array of all values for a setting, sorted by priority.
|
|
124
|
-
* @note values are not cloned. Do not modify objects or arrays.
|
|
125
|
-
*/
|
|
126
|
-
inspectSetting(name) {
|
|
127
|
-
const all = [];
|
|
128
|
-
this.resolveSetting(name, (value, dictionary, priority) => {
|
|
129
|
-
all.push({ value, dictionary, priority });
|
|
130
|
-
return undefined;
|
|
131
|
-
});
|
|
132
|
-
return all;
|
|
133
|
-
}
|
|
134
|
-
getString(name, defaultValue) {
|
|
135
|
-
const out = this.getSetting(name);
|
|
136
|
-
return typeof out === "string" ? out : defaultValue;
|
|
66
|
+
return true;
|
|
137
67
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
exports.
|
|
68
|
+
Setting.areEqual = areEqual;
|
|
69
|
+
})(Setting || (exports.Setting = Setting = {}));
|
|
70
|
+
/** @beta */
|
|
71
|
+
var SettingsPriority;
|
|
72
|
+
(function (SettingsPriority) {
|
|
73
|
+
/** Settings that originate from default setting files loaded automatically at the start of a session. */
|
|
74
|
+
SettingsPriority.defaults = 100;
|
|
75
|
+
/** Settings supplied by an application at runtime. */
|
|
76
|
+
SettingsPriority.application = 200;
|
|
77
|
+
/** Settings that apply to all iTwins for an organization. */
|
|
78
|
+
SettingsPriority.organization = 300;
|
|
79
|
+
/** Settings that apply to all iModels in an iTwin. */
|
|
80
|
+
SettingsPriority.iTwin = 400;
|
|
81
|
+
/** Settings that apply to all branches of an iModel. */
|
|
82
|
+
SettingsPriority.branch = 500;
|
|
83
|
+
/** Settings that apply to a specific iModel. */
|
|
84
|
+
SettingsPriority.iModel = 600;
|
|
85
|
+
})(SettingsPriority || (exports.SettingsPriority = SettingsPriority = {}));
|
|
156
86
|
//# sourceMappingURL=Settings.js.map
|