@itwin/core-bentley 5.9.0-dev.8 → 5.9.0
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 +30 -1
- package/lib/cjs/AccessToken.js.map +1 -1
- package/lib/cjs/Assert.js.map +1 -1
- package/lib/cjs/BeEvent.d.ts +55 -1
- package/lib/cjs/BeEvent.d.ts.map +1 -1
- package/lib/cjs/BeEvent.js +111 -8
- package/lib/cjs/BeEvent.js.map +1 -1
- package/lib/cjs/BeSQLite.js.map +1 -1
- package/lib/cjs/BentleyError.js.map +1 -1
- package/lib/cjs/BentleyLoggerCategory.js.map +1 -1
- package/lib/cjs/ByteStream.js.map +1 -1
- package/lib/cjs/ClassUtils.js.map +1 -1
- package/lib/cjs/Compare.js.map +1 -1
- package/lib/cjs/CompressedId64Set.js.map +1 -1
- package/lib/cjs/Dictionary.js.map +1 -1
- package/lib/cjs/Disposable.js.map +1 -1
- package/lib/cjs/Expect.js.map +1 -1
- package/lib/cjs/Id.d.ts.map +1 -1
- package/lib/cjs/Id.js +1 -3
- package/lib/cjs/Id.js.map +1 -1
- package/lib/cjs/IndexMap.js.map +1 -1
- package/lib/cjs/JsonSchema.js.map +1 -1
- package/lib/cjs/JsonUtils.js.map +1 -1
- package/lib/cjs/LRUMap.js.map +1 -1
- package/lib/cjs/Logger.js.map +1 -1
- package/lib/cjs/ObservableSet.js.map +1 -1
- package/lib/cjs/OneAtATimeAction.js.map +1 -1
- package/lib/cjs/OrderedId64Iterable.js.map +1 -1
- package/lib/cjs/OrderedSet.js.map +1 -1
- package/lib/cjs/PriorityQueue.js.map +1 -1
- package/lib/cjs/ProcessDetector.js.map +1 -1
- package/lib/cjs/SortedArray.js.map +1 -1
- package/lib/cjs/StatusCategory.js.map +1 -1
- package/lib/cjs/StringUtils.js.map +1 -1
- package/lib/cjs/Time.js.map +1 -1
- package/lib/cjs/Tracing.js.map +1 -1
- package/lib/cjs/TupleKeyedMap.js.map +1 -1
- package/lib/cjs/TypedArrayBuilder.js.map +1 -1
- package/lib/cjs/UnexpectedErrors.js.map +1 -1
- package/lib/cjs/UtilityFunctions.d.ts +17 -0
- package/lib/cjs/UtilityFunctions.d.ts.map +1 -0
- package/lib/cjs/UtilityFunctions.js +52 -0
- package/lib/cjs/UtilityFunctions.js.map +1 -0
- package/lib/cjs/UtilityTypes.js.map +1 -1
- package/lib/cjs/YieldManager.js.map +1 -1
- package/lib/cjs/core-bentley.d.ts +1 -0
- package/lib/cjs/core-bentley.d.ts.map +1 -1
- package/lib/cjs/core-bentley.js +1 -0
- package/lib/cjs/core-bentley.js.map +1 -1
- package/lib/cjs/internal/BeSQLiteInternal.js.map +1 -1
- package/lib/cjs/internal/RepositoryStatus.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/partitionArray.js.map +1 -1
- package/lib/esm/AccessToken.js.map +1 -1
- package/lib/esm/Assert.js.map +1 -1
- package/lib/esm/BeEvent.d.ts +55 -1
- package/lib/esm/BeEvent.d.ts.map +1 -1
- package/lib/esm/BeEvent.js +108 -7
- package/lib/esm/BeEvent.js.map +1 -1
- package/lib/esm/BeSQLite.js.map +1 -1
- package/lib/esm/BentleyError.js.map +1 -1
- package/lib/esm/BentleyLoggerCategory.js.map +1 -1
- package/lib/esm/ByteStream.js.map +1 -1
- package/lib/esm/ClassUtils.js.map +1 -1
- package/lib/esm/Compare.js.map +1 -1
- package/lib/esm/CompressedId64Set.js.map +1 -1
- package/lib/esm/Dictionary.js.map +1 -1
- package/lib/esm/Disposable.js.map +1 -1
- package/lib/esm/Expect.js.map +1 -1
- package/lib/esm/Id.d.ts.map +1 -1
- package/lib/esm/Id.js +1 -3
- package/lib/esm/Id.js.map +1 -1
- package/lib/esm/IndexMap.js.map +1 -1
- package/lib/esm/JsonSchema.js.map +1 -1
- package/lib/esm/JsonUtils.js.map +1 -1
- package/lib/esm/LRUMap.js.map +1 -1
- package/lib/esm/Logger.js.map +1 -1
- package/lib/esm/ObservableSet.js.map +1 -1
- package/lib/esm/OneAtATimeAction.js.map +1 -1
- package/lib/esm/OrderedId64Iterable.js.map +1 -1
- package/lib/esm/OrderedSet.js.map +1 -1
- package/lib/esm/PriorityQueue.js.map +1 -1
- package/lib/esm/ProcessDetector.js.map +1 -1
- package/lib/esm/SortedArray.js.map +1 -1
- package/lib/esm/StatusCategory.js.map +1 -1
- package/lib/esm/StringUtils.js.map +1 -1
- package/lib/esm/Time.js.map +1 -1
- package/lib/esm/Tracing.js.map +1 -1
- package/lib/esm/TupleKeyedMap.js.map +1 -1
- package/lib/esm/TypedArrayBuilder.js.map +1 -1
- package/lib/esm/UnexpectedErrors.js.map +1 -1
- package/lib/esm/UtilityFunctions.d.ts +17 -0
- package/lib/esm/UtilityFunctions.d.ts.map +1 -0
- package/lib/esm/UtilityFunctions.js +49 -0
- package/lib/esm/UtilityFunctions.js.map +1 -0
- package/lib/esm/UtilityTypes.js.map +1 -1
- package/lib/esm/YieldManager.js.map +1 -1
- package/lib/esm/core-bentley.d.ts +1 -0
- package/lib/esm/core-bentley.d.ts.map +1 -1
- package/lib/esm/core-bentley.js +1 -0
- package/lib/esm/core-bentley.js.map +1 -1
- package/lib/esm/internal/BeSQLiteInternal.js.map +1 -1
- package/lib/esm/internal/RepositoryStatus.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/partitionArray.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
# Change Log - @itwin/core-bentley
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 04 May 2026 16:32:08 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.9.0
|
|
6
|
+
Mon, 04 May 2026 16:32:08 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Add BeUnorderedEvent and BeUnorderedUiEvent — Set-backed event classes with safe concurrent modification during emit.
|
|
11
|
+
|
|
12
|
+
### Updates
|
|
13
|
+
|
|
14
|
+
- Improved `Id64.iterable` performance >10x.
|
|
15
|
+
- Added wrapTimerCallback utility function.
|
|
16
|
+
|
|
17
|
+
## 5.8.4
|
|
18
|
+
Thu, 23 Apr 2026 18:05:13 GMT
|
|
19
|
+
|
|
20
|
+
_Version update only_
|
|
21
|
+
|
|
22
|
+
## 5.8.3
|
|
23
|
+
Thu, 23 Apr 2026 14:52:42 GMT
|
|
24
|
+
|
|
25
|
+
### Updates
|
|
26
|
+
|
|
27
|
+
- Added wrapTimerCallback utility function.
|
|
28
|
+
|
|
29
|
+
## 5.8.2
|
|
30
|
+
Thu, 16 Apr 2026 11:05:01 GMT
|
|
31
|
+
|
|
32
|
+
_Version update only_
|
|
4
33
|
|
|
5
34
|
## 5.8.1
|
|
6
35
|
Fri, 10 Apr 2026 13:02:00 GMT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessToken.js","sourceRoot":"","sources":["../../src/AccessToken.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["\
|
|
1
|
+
{"version":3,"file":"AccessToken.js","sourceRoot":"","sources":["../../src/AccessToken.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\n/** A string representing a token used to access resources. An empty string represents an invalid/unavailable token.\n * @see [IModelHost.getAccessToken]($backend) and [IModelApp.getAccessToken]($frontend) to obtain an access token.\n * @see [IModelHostOptions.authorizationClient]($backend) and [IModelAppOptions.authorizationClient]($frontend) to configure how access tokens are obtained.\n * @note Access tokens expire periodically and are automatically refreshed when possible; therefore, tokens should always be requested via an [AuthorizationClient]($common), not cached for later reuse.\n * @public\n */\nexport type AccessToken = string;\n"]}
|
package/lib/cjs/Assert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Assert.js","sourceRoot":"","sources":["../../src/Assert.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAyBH,wBAeC;AAtCD,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,MAAM,CAAC,SAAoC,EAAE,OAAiC;IAC5F,IAAI,CAAC,iBAAiB;QACpB,OAAO;IAET,IAAI,SAAS,KAAK,OAAO,SAAS;QAChC,SAAS,GAAG,SAAS,EAAE,CAAC;IAE1B,IAAI,SAAS;QACX,OAAO;IAET,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAAC;IACxC,IAAI,QAAQ,KAAK,OAAO,OAAO;QAC7B,OAAO,GAAG,OAAO,EAAE,CAAC;IAEtB,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Assert.js","sourceRoot":"","sources":["../../src/Assert.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAyBH,wBAeC;AAtCD,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,MAAM,CAAC,SAAoC,EAAE,OAAiC;IAC5F,IAAI,CAAC,iBAAiB;QACpB,OAAO;IAET,IAAI,SAAS,KAAK,OAAO,SAAS;QAChC,SAAS,GAAG,SAAS,EAAE,CAAC;IAE1B,IAAI,SAAS;QACX,OAAO;IAET,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAAC;IACxC,IAAI,QAAQ,KAAK,OAAO,OAAO;QAC7B,OAAO,GAAG,OAAO,EAAE,CAAC;IAEtB,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\nconst assertionsEnabled = process.env.NODE_ENV === \"development\";\n\n/** Asserts that a condition is `true` and - when enabled - throws an error if it is not.\n * Assertions are enabled only if the build configuration defines `process.env.NODE_ENV` as `development` at build time.\n *\n * Assertions exist solely to assist programmers during development, in the following ways:\n * 1 They allow the programmer to declare conditions that they believe cannot possibly occur. If such conditions occur, they indicate\n * a serious flaw in the programmer's logic.\n * 2 They allow the programmer to assure the TypeScript compiler of the truth of some condition that the compiler cannot itself infer.\n * 3 They allow the author of an API to indicate to consumers of the API a serious misuse that should be corrected during development.\n *\n * Assertions should **never** be used to test for conditions - however unlikely - that could be expected to occur at run-time,\n * such as failing to write to a file or load a resource over the network. If the condition asserted ever fails in a production environment,\n * the programmer has made a serious mistake.\n *\n * Note that even when assertions are disabled, calls to `assert` remain in the code and their arguments will be evaluated at run-time.\n * Therefore, if your condition or message requires computation, prefer to pass it as a function to prevent it from being evaluated when assertions are disabled.\n *\n * @param condition The condition that is asserted to be `true`. If the condition is more complex than a simple `boolean` variable, pass it as a function to prevent it from being evaluated when assertions are disabled.\n * @param message An optional description of the condition being asserted, to be included in the exception if `condition` is `false`. If the message must be computed, pass it as a function to prevent it from being evaluated when assertions are disabled. Defaults to \"Programmer Error\".\n * @throws Error containing the specified `message` if `condition` is `false`.\n * @public\n */\nexport function assert(condition: boolean | (() => boolean), message?: string | (() => string)): asserts condition {\n if (!assertionsEnabled)\n return;\n\n if (\"boolean\" !== typeof condition)\n condition = condition();\n\n if (condition)\n return;\n\n message = message ?? \"Programmer Error\";\n if (\"string\" !== typeof message)\n message = message();\n\n throw new Error(`Assert: ${message}`);\n}\n"]}
|
package/lib/cjs/BeEvent.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type Listener = (...arg: any[]) => void;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare class BeEvent<T extends Listener> {
|
|
15
15
|
private _listeners;
|
|
16
|
-
private
|
|
16
|
+
private _emitDepth;
|
|
17
17
|
/** The number of listeners currently subscribed to the event. */
|
|
18
18
|
get numberOfListeners(): number;
|
|
19
19
|
/**
|
|
@@ -61,6 +61,60 @@ export declare class BeUiEvent<TEventArgs> extends BeEvent<(args: TEventArgs) =>
|
|
|
61
61
|
/** Raises event with single strongly typed argument. */
|
|
62
62
|
emit(args: TEventArgs): void;
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Manages a set of *listeners* for a particular event and notifies them when the event is raised.
|
|
66
|
+
* Unlike [[BeEvent]], this class uses a `Set` internally to support safe concurrent modification
|
|
67
|
+
* during emit. When a listener is removed during emit, it is marked for deferred removal instead
|
|
68
|
+
* of mutating the set immediately.
|
|
69
|
+
*
|
|
70
|
+
* Listeners are managed exclusively through the disposal closure returned by [[addListener]] and
|
|
71
|
+
* [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned
|
|
72
|
+
* closure to unsubscribe.
|
|
73
|
+
* @beta
|
|
74
|
+
*/
|
|
75
|
+
export declare class BeUnorderedEvent<T extends Listener> {
|
|
76
|
+
private _listeners;
|
|
77
|
+
private _emitDepth;
|
|
78
|
+
private _hasTombstones;
|
|
79
|
+
/** The number of listeners currently subscribed to the event.
|
|
80
|
+
* @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
|
|
81
|
+
* but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
|
|
82
|
+
*/
|
|
83
|
+
get numberOfListeners(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Registers a Listener to be executed whenever this event is raised.
|
|
86
|
+
* @param listener The function to be executed when the event is raised.
|
|
87
|
+
* @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.
|
|
88
|
+
* @returns A function that will remove this event listener in O(1).
|
|
89
|
+
*/
|
|
90
|
+
addListener(listener: T, scope?: any): () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Registers a callback function to be executed *only once* when the event is raised.
|
|
93
|
+
* @param listener The function to be executed once when the event is raised.
|
|
94
|
+
* @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.
|
|
95
|
+
* @returns A function that will remove this event listener in O(1).
|
|
96
|
+
*/
|
|
97
|
+
addOnce(listener: T, scope?: any): () => void;
|
|
98
|
+
/** Remove a specific context entry, deferring during emit. */
|
|
99
|
+
private _removeCtx;
|
|
100
|
+
/**
|
|
101
|
+
* Raises the event by calling each registered listener with the supplied arguments.
|
|
102
|
+
* @param args This method takes any number of parameters and passes them through to the listeners.
|
|
103
|
+
*/
|
|
104
|
+
raiseEvent(...args: Parameters<T>): void;
|
|
105
|
+
/** Clear all listeners from this BeUnorderedEvent.
|
|
106
|
+
* @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped
|
|
107
|
+
* immediately rather than being tombstoned.
|
|
108
|
+
*/
|
|
109
|
+
clear(): void;
|
|
110
|
+
}
|
|
111
|
+
/** Specialization of BeUnorderedEvent for events that take a single strongly typed argument, primarily used for UI events.
|
|
112
|
+
* @beta
|
|
113
|
+
*/
|
|
114
|
+
export declare class BeUnorderedUiEvent<TEventArgs> extends BeUnorderedEvent<(args: TEventArgs) => void> {
|
|
115
|
+
/** Raises event with single strongly typed argument. */
|
|
116
|
+
emit(args: TEventArgs): void;
|
|
117
|
+
}
|
|
64
118
|
/**
|
|
65
119
|
* A list of BeEvent objects, accessible by an event name.
|
|
66
120
|
* This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.
|
package/lib/cjs/BeEvent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeEvent.d.ts","sourceRoot":"","sources":["../../src/BeEvent.ts"],"names":[],"mappings":"AAIA;;GAEG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G,MAAM,IAAI,CAAC;CACpD,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
package/lib/cjs/BeEvent.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Events
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.BeEventList = exports.BeUiEvent = exports.BeEvent = void 0;
|
|
10
|
+
exports.BeEventList = exports.BeUnorderedUiEvent = exports.BeUnorderedEvent = exports.BeUiEvent = exports.BeEvent = void 0;
|
|
11
11
|
const UnexpectedErrors_1 = require("./UnexpectedErrors");
|
|
12
12
|
/**
|
|
13
13
|
* Manages a set of *listeners* for a particular event and notifies them when the event is raised.
|
|
@@ -17,7 +17,7 @@ const UnexpectedErrors_1 = require("./UnexpectedErrors");
|
|
|
17
17
|
*/
|
|
18
18
|
class BeEvent {
|
|
19
19
|
_listeners = [];
|
|
20
|
-
|
|
20
|
+
_emitDepth = 0;
|
|
21
21
|
/** The number of listeners currently subscribed to the event. */
|
|
22
22
|
get numberOfListeners() { return this._listeners.length; }
|
|
23
23
|
/**
|
|
@@ -54,7 +54,7 @@ class BeEvent {
|
|
|
54
54
|
for (let i = 0; i < listeners.length; ++i) {
|
|
55
55
|
const context = listeners[i];
|
|
56
56
|
if (context.listener === listener && context.scope === scope) {
|
|
57
|
-
if (this.
|
|
57
|
+
if (this._emitDepth > 0) {
|
|
58
58
|
context.listener = undefined;
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
@@ -71,7 +71,7 @@ class BeEvent {
|
|
|
71
71
|
* @see [[BeEvent.removeListener]], [[BeEvent.addListener]]
|
|
72
72
|
*/
|
|
73
73
|
raiseEvent(...args) {
|
|
74
|
-
this.
|
|
74
|
+
this._emitDepth++;
|
|
75
75
|
const listeners = this._listeners;
|
|
76
76
|
const length = listeners.length;
|
|
77
77
|
let dropped = false;
|
|
@@ -87,16 +87,21 @@ class BeEvent {
|
|
|
87
87
|
catch (e) {
|
|
88
88
|
UnexpectedErrors_1.UnexpectedErrors.handle(e);
|
|
89
89
|
}
|
|
90
|
-
if (context.
|
|
90
|
+
if (!context.listener) {
|
|
91
|
+
// listener was removed during its own callback
|
|
92
|
+
dropped = true;
|
|
93
|
+
}
|
|
94
|
+
else if (context.once) {
|
|
91
95
|
context.listener = undefined;
|
|
92
96
|
dropped = true;
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
this._emitDepth--;
|
|
101
|
+
// Only sweep tombstoned entries when the outermost emit completes,
|
|
102
|
+
// so nested raiseEvent calls never mutate the array mid-iteration.
|
|
103
|
+
if (dropped && this._emitDepth === 0)
|
|
98
104
|
this._listeners = this._listeners.filter((ctx) => ctx.listener !== undefined);
|
|
99
|
-
this._insideRaiseEvent = false;
|
|
100
105
|
}
|
|
101
106
|
/** Determine whether this BeEvent has a specified listener registered.
|
|
102
107
|
* @param listener The listener to check.
|
|
@@ -122,6 +127,104 @@ class BeUiEvent extends BeEvent {
|
|
|
122
127
|
emit(args) { this.raiseEvent(args); }
|
|
123
128
|
}
|
|
124
129
|
exports.BeUiEvent = BeUiEvent;
|
|
130
|
+
/**
|
|
131
|
+
* Manages a set of *listeners* for a particular event and notifies them when the event is raised.
|
|
132
|
+
* Unlike [[BeEvent]], this class uses a `Set` internally to support safe concurrent modification
|
|
133
|
+
* during emit. When a listener is removed during emit, it is marked for deferred removal instead
|
|
134
|
+
* of mutating the set immediately.
|
|
135
|
+
*
|
|
136
|
+
* Listeners are managed exclusively through the disposal closure returned by [[addListener]] and
|
|
137
|
+
* [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned
|
|
138
|
+
* closure to unsubscribe.
|
|
139
|
+
* @beta
|
|
140
|
+
*/
|
|
141
|
+
class BeUnorderedEvent {
|
|
142
|
+
_listeners = new Set();
|
|
143
|
+
_emitDepth = 0;
|
|
144
|
+
_hasTombstones = false;
|
|
145
|
+
/** The number of listeners currently subscribed to the event.
|
|
146
|
+
* @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
|
|
147
|
+
* but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
|
|
148
|
+
*/
|
|
149
|
+
get numberOfListeners() { return this._listeners.size; }
|
|
150
|
+
/**
|
|
151
|
+
* Registers a Listener to be executed whenever this event is raised.
|
|
152
|
+
* @param listener The function to be executed when the event is raised.
|
|
153
|
+
* @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.
|
|
154
|
+
* @returns A function that will remove this event listener in O(1).
|
|
155
|
+
*/
|
|
156
|
+
addListener(listener, scope) {
|
|
157
|
+
const ctx = { listener, scope, once: false };
|
|
158
|
+
this._listeners.add(ctx);
|
|
159
|
+
return () => this._removeCtx(ctx);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Registers a callback function to be executed *only once* when the event is raised.
|
|
163
|
+
* @param listener The function to be executed once when the event is raised.
|
|
164
|
+
* @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.
|
|
165
|
+
* @returns A function that will remove this event listener in O(1).
|
|
166
|
+
*/
|
|
167
|
+
addOnce(listener, scope) {
|
|
168
|
+
const ctx = { listener, scope, once: true };
|
|
169
|
+
this._listeners.add(ctx);
|
|
170
|
+
return () => this._removeCtx(ctx);
|
|
171
|
+
}
|
|
172
|
+
/** Remove a specific context entry, deferring during emit. */
|
|
173
|
+
_removeCtx(ctx) {
|
|
174
|
+
if (this._emitDepth > 0) {
|
|
175
|
+
ctx.listener = undefined; // tombstone for deferred cleanup
|
|
176
|
+
this._hasTombstones = true;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
this._listeners.delete(ctx);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Raises the event by calling each registered listener with the supplied arguments.
|
|
184
|
+
* @param args This method takes any number of parameters and passes them through to the listeners.
|
|
185
|
+
*/
|
|
186
|
+
raiseEvent(...args) {
|
|
187
|
+
this._emitDepth++;
|
|
188
|
+
for (const ctx of this._listeners) {
|
|
189
|
+
if (!ctx.listener) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
ctx.listener.apply(ctx.scope, args);
|
|
194
|
+
}
|
|
195
|
+
catch (e) {
|
|
196
|
+
UnexpectedErrors_1.UnexpectedErrors.handle(e);
|
|
197
|
+
}
|
|
198
|
+
if (ctx.listener && ctx.once) {
|
|
199
|
+
ctx.listener = undefined;
|
|
200
|
+
this._hasTombstones = true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
this._emitDepth--;
|
|
204
|
+
// Only clean up tombstoned entries when we're back at the outermost emit
|
|
205
|
+
if (this._hasTombstones && this._emitDepth === 0) {
|
|
206
|
+
this._hasTombstones = false;
|
|
207
|
+
for (const ctx of this._listeners) {
|
|
208
|
+
if (ctx.listener === undefined)
|
|
209
|
+
this._listeners.delete(ctx);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/** Clear all listeners from this BeUnorderedEvent.
|
|
214
|
+
* @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped
|
|
215
|
+
* immediately rather than being tombstoned.
|
|
216
|
+
*/
|
|
217
|
+
clear() { this._listeners.clear(); }
|
|
218
|
+
}
|
|
219
|
+
exports.BeUnorderedEvent = BeUnorderedEvent;
|
|
220
|
+
/** Specialization of BeUnorderedEvent for events that take a single strongly typed argument, primarily used for UI events.
|
|
221
|
+
* @beta
|
|
222
|
+
*/
|
|
223
|
+
class BeUnorderedUiEvent extends BeUnorderedEvent {
|
|
224
|
+
/** Raises event with single strongly typed argument. */
|
|
225
|
+
emit(args) { this.raiseEvent(args); }
|
|
226
|
+
}
|
|
227
|
+
exports.BeUnorderedUiEvent = BeUnorderedUiEvent;
|
|
125
228
|
/**
|
|
126
229
|
* A list of BeEvent objects, accessible by an event name.
|
|
127
230
|
* This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.
|
package/lib/cjs/BeEvent.js.map
C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AG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAEhF,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;IACjC,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,QAAW,EAAE,KAAW;QACjC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClC,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBACrD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,6CAA6C;IACtC,KAAK,KAAW,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;CACrD;AA1GD,0BA0GC;AAED;;GAEG;AACH,MAAa,SAAsB,SAAQ,OAAmC;IAC5E,wDAAwD;IACjD,IAAI,CAAC,IAAgB,IAAU,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CAC/D;AAHD,8BAGC;AAED;;;;GAIG;AACH,MAAa,WAAW;IACd,OAAO,GAA+C,EAAE,CAAC;IAEjE;;;OAGG;IACI,GAAG,CAAC,IAAY;QACrB,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK;YACP,OAAO,KAAK,CAAC;QAEf,KAAK,GAAG,IAAI,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAY;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IACjC,CAAC;CACF;AAxBD,kCAwBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Events\r\n */\r\n\r\nimport { UnexpectedErrors } from \"./UnexpectedErrors\";\r\n\r\n/** A function invoked when a BeEvent is raised.\r\n * @public\r\n */\r\nexport type Listener = (...arg: any[]) => void;\r\n\r\ninterface EventContext {\r\n listener: Listener | undefined;\r\n scope: any;\r\n once: boolean;\r\n}\r\n\r\n/**\r\n * Manages a set of *listeners* for a particular event and notifies them when the event is raised.\r\n * This class is usually instantiated inside of a container class and\r\n * exposed as a property for others to *subscribe* via [[BeEvent.addListener]].\r\n * @public\r\n */\r\nexport class BeEvent<T extends Listener> {\r\n private _listeners: EventContext[] = [];\r\n private _insideRaiseEvent: boolean = false;\r\n\r\n /** The number of listeners currently subscribed to the event. */\r\n public get numberOfListeners() { return this._listeners.length; }\r\n\r\n /**\r\n * Registers a Listener to be executed whenever this event is raised.\r\n * @param listener The function to be executed when the event is raised.\r\n * @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.\r\n * @returns A function that will remove this event listener.\r\n * @see [[BeEvent.raiseEvent]], [[BeEvent.removeListener]]\r\n */\r\n public addListener(listener: T, scope?: any): () => void {\r\n this._listeners.push({ listener, scope, once: false });\r\n return () => this.removeListener(listener, scope);\r\n }\r\n\r\n /**\r\n * Registers a callback function to be executed *only once* when the event is raised.\r\n * @param listener The function to be executed once when the event is raised.\r\n * @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.\r\n * @returns A function that will remove this event listener.\r\n * @see [[BeEvent.raiseEvent]], [[BeEvent.removeListener]]\r\n */\r\n public addOnce(listener: T, scope?: any): () => void {\r\n this._listeners.push({ listener, scope, once: true });\r\n return () => this.removeListener(listener, scope);\r\n }\r\n\r\n /**\r\n * Un-register a previously registered listener.\r\n * @param listener The listener to be unregistered.\r\n * @param scope The scope that was originally passed to addListener.\r\n * @returns 'true' if the listener was removed; 'false' if the listener and scope are not registered with the event.\r\n * @see [[BeEvent.raiseEvent]], [[BeEvent.addListener]]\r\n */\r\n public removeListener(listener: T, scope?: any): boolean {\r\n const listeners = this._listeners;\r\n\r\n for (let i = 0; i < listeners.length; ++i) {\r\n const context = listeners[i];\r\n if (context.listener === listener && context.scope === scope) {\r\n if (this._insideRaiseEvent) {\r\n context.listener = undefined;\r\n } else {\r\n listeners.splice(i, 1);\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Raises the event by calling each registered listener with the supplied arguments.\r\n * @param args This method takes any number of parameters and passes them through to the listeners.\r\n * @see [[BeEvent.removeListener]], [[BeEvent.addListener]]\r\n */\r\n public raiseEvent(...args: Parameters<T>) {\r\n this._insideRaiseEvent = true;\r\n\r\n const listeners = this._listeners;\r\n const length = listeners.length;\r\n let dropped = false;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n const context = listeners[i];\r\n if (!context.listener) {\r\n dropped = true;\r\n } else {\r\n try {\r\n context.listener.apply(context.scope, args);\r\n } catch (e) {\r\n UnexpectedErrors.handle(e);\r\n }\r\n if (context.once) {\r\n context.listener = undefined;\r\n dropped = true;\r\n }\r\n }\r\n }\r\n\r\n // if we had dropped listeners, remove them now\r\n if (dropped)\r\n this._listeners = this._listeners.filter((ctx) => ctx.listener !== undefined);\r\n\r\n this._insideRaiseEvent = false;\r\n }\r\n\r\n /** Determine whether this BeEvent has a specified listener registered.\r\n * @param listener The listener to check.\r\n * @param scope optional scope argument to match call to addListener\r\n */\r\n public has(listener: T, scope?: any): boolean {\r\n for (const ctx of this._listeners) {\r\n if (ctx.listener === listener && ctx.scope === scope) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Clear all Listeners from this BeEvent. */\r\n public clear(): void { this._listeners.length = 0; }\r\n}\r\n\r\n/** Specialization of BeEvent for events that take a single strongly typed argument, primarily used for UI events.\r\n * @public\r\n */\r\nexport class BeUiEvent<TEventArgs> extends BeEvent<(args: TEventArgs) => void> {\r\n /** Raises event with single strongly typed argument. */\r\n public emit(args: TEventArgs): void { this.raiseEvent(args); }\r\n}\r\n\r\n/**\r\n * A list of BeEvent objects, accessible by an event name.\r\n * This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.\r\n * @public\r\n */\r\nexport class BeEventList<T extends Listener> {\r\n private _events: { [name: string]: BeEvent<T> | undefined } = {};\r\n\r\n /**\r\n * Gets the event associated with the specified name, creating the event if it does not already exist.\r\n * @param name The name of the event.\r\n */\r\n public get(name: string): BeEvent<T> {\r\n let event = this._events[name];\r\n if (event)\r\n return event;\r\n\r\n event = new BeEvent();\r\n this._events[name] = event;\r\n return event;\r\n }\r\n\r\n /**\r\n * Removes the event associated with a name.\r\n * @param name The name of the event.\r\n */\r\n public remove(name: string): void {\r\n this._events[name] = undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Retrieves the type of the callback function for an event type like [[BeEvent]].\r\n * For example:\r\n * ```ts\r\n * const event = new BeEvent<(x: number, y: string) => void>();\r\n * const callback: ListenerType<typeof event> = (x, y) => {\r\n * console.log(`${x}, ${y}`);\r\n * };\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport type ListenerType<TEvent extends {\r\n addListener(listener: Listener): () => void;\r\n}> =\r\n TEvent extends {\r\n addListener(listener: infer TListener): () => void;\r\n } ? TListener : never;\r\n"]}
|
|
1
|
+
{"version":3,"file":"BeEvent.js","sourceRoot":"","sources":["../../src/BeEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yDAAsD;AAatD;;;;;GAKG;AACH,MAAa,OAAO;IACV,UAAU,GAAmB,EAAE,CAAC;IAChC,UAAU,GAAW,CAAC,CAAC;IAE/B,iEAAiE;IACjE,IAAW,iBAAiB,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAEjE;;;;;;OAMG;IACI,WAAW,CAAC,QAAW,EAAE,KAAW;QACzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE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AU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAClD;AApFD,4CAoFC;AAED;;GAEG;AACH,MAAa,kBAA+B,SAAQ,gBAA4C;IAC9F,wDAAwD;IACjD,IAAI,CAAC,IAAgB,IAAU,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CAC/D;AAHD,gDAGC;AAED;;;;GAIG;AACH,MAAa,WAAW;IACd,OAAO,GAA+C,EAAE,CAAC;IAEjE;;;OAGG;IACI,GAAG,CAAC,IAAY;QACrB,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK;YACP,OAAO,KAAK,CAAC;QAEf,KAAK,GAAG,IAAI,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAY;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IACjC,CAAC;CACF;AAxBD,kCAwBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Events\n */\n\nimport { UnexpectedErrors } from \"./UnexpectedErrors\";\n\n/** A function invoked when a BeEvent is raised.\n * @public\n */\nexport type Listener = (...arg: any[]) => void;\n\ninterface EventContext {\n listener: Listener | undefined;\n scope: any;\n once: boolean;\n}\n\n/**\n * Manages a set of *listeners* for a particular event and notifies them when the event is raised.\n * This class is usually instantiated inside of a container class and\n * exposed as a property for others to *subscribe* via [[BeEvent.addListener]].\n * @public\n */\nexport class BeEvent<T extends Listener> {\n private _listeners: EventContext[] = [];\n private _emitDepth: number = 0;\n\n /** The number of listeners currently subscribed to the event. */\n public get numberOfListeners() { return this._listeners.length; }\n\n /**\n * Registers a Listener to be executed whenever this event is raised.\n * @param listener The function to be executed when the event is raised.\n * @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.\n * @returns A function that will remove this event listener.\n * @see [[BeEvent.raiseEvent]], [[BeEvent.removeListener]]\n */\n public addListener(listener: T, scope?: any): () => void {\n this._listeners.push({ listener, scope, once: false });\n return () => this.removeListener(listener, scope);\n }\n\n /**\n * Registers a callback function to be executed *only once* when the event is raised.\n * @param listener The function to be executed once when the event is raised.\n * @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.\n * @returns A function that will remove this event listener.\n * @see [[BeEvent.raiseEvent]], [[BeEvent.removeListener]]\n */\n public addOnce(listener: T, scope?: any): () => void {\n this._listeners.push({ listener, scope, once: true });\n return () => this.removeListener(listener, scope);\n }\n\n /**\n * Un-register a previously registered listener.\n * @param listener The listener to be unregistered.\n * @param scope The scope that was originally passed to addListener.\n * @returns 'true' if the listener was removed; 'false' if the listener and scope are not registered with the event.\n * @see [[BeEvent.raiseEvent]], [[BeEvent.addListener]]\n */\n public removeListener(listener: T, scope?: any): boolean {\n const listeners = this._listeners;\n\n for (let i = 0; i < listeners.length; ++i) {\n const context = listeners[i];\n if (context.listener === listener && context.scope === scope) {\n if (this._emitDepth > 0) {\n context.listener = undefined;\n } else {\n listeners.splice(i, 1);\n }\n return true;\n }\n }\n return false;\n }\n\n /**\n * Raises the event by calling each registered listener with the supplied arguments.\n * @param args This method takes any number of parameters and passes them through to the listeners.\n * @see [[BeEvent.removeListener]], [[BeEvent.addListener]]\n */\n public raiseEvent(...args: Parameters<T>) {\n this._emitDepth++;\n\n const listeners = this._listeners;\n const length = listeners.length;\n let dropped = false;\n\n for (let i = 0; i < length; ++i) {\n const context = listeners[i];\n if (!context.listener) {\n dropped = true;\n } else {\n try {\n context.listener.apply(context.scope, args);\n } catch (e) {\n UnexpectedErrors.handle(e);\n }\n if (!context.listener) {\n // listener was removed during its own callback\n dropped = true;\n } else if (context.once) {\n context.listener = undefined;\n dropped = true;\n }\n }\n }\n\n this._emitDepth--;\n\n // Only sweep tombstoned entries when the outermost emit completes,\n // so nested raiseEvent calls never mutate the array mid-iteration.\n if (dropped && this._emitDepth === 0)\n this._listeners = this._listeners.filter((ctx) => ctx.listener !== undefined);\n }\n\n /** Determine whether this BeEvent has a specified listener registered.\n * @param listener The listener to check.\n * @param scope optional scope argument to match call to addListener\n */\n public has(listener: T, scope?: any): boolean {\n for (const ctx of this._listeners) {\n if (ctx.listener === listener && ctx.scope === scope) {\n return true;\n }\n }\n return false;\n }\n\n /** Clear all Listeners from this BeEvent. */\n public clear(): void { this._listeners.length = 0; }\n}\n\n/** Specialization of BeEvent for events that take a single strongly typed argument, primarily used for UI events.\n * @public\n */\nexport class BeUiEvent<TEventArgs> extends BeEvent<(args: TEventArgs) => void> {\n /** Raises event with single strongly typed argument. */\n public emit(args: TEventArgs): void { this.raiseEvent(args); }\n}\n\ninterface UnorderedEventContext {\n listener: Listener | undefined;\n scope: any;\n once: boolean;\n}\n\n/**\n * Manages a set of *listeners* for a particular event and notifies them when the event is raised.\n * Unlike [[BeEvent]], this class uses a `Set` internally to support safe concurrent modification\n * during emit. When a listener is removed during emit, it is marked for deferred removal instead\n * of mutating the set immediately.\n *\n * Listeners are managed exclusively through the disposal closure returned by [[addListener]] and\n * [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned\n * closure to unsubscribe.\n * @beta\n */\nexport class BeUnorderedEvent<T extends Listener> {\n private _listeners: Set<UnorderedEventContext> = new Set();\n private _emitDepth: number = 0;\n private _hasTombstones: boolean = false;\n\n /** The number of listeners currently subscribed to the event.\n * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot\n * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.\n */\n public get numberOfListeners() { return this._listeners.size; }\n\n /**\n * Registers a Listener to be executed whenever this event is raised.\n * @param listener The function to be executed when the event is raised.\n * @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.\n * @returns A function that will remove this event listener in O(1).\n */\n public addListener(listener: T, scope?: any): () => void {\n const ctx: UnorderedEventContext = { listener, scope, once: false };\n this._listeners.add(ctx);\n return () => this._removeCtx(ctx);\n }\n\n /**\n * Registers a callback function to be executed *only once* when the event is raised.\n * @param listener The function to be executed once when the event is raised.\n * @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.\n * @returns A function that will remove this event listener in O(1).\n */\n public addOnce(listener: T, scope?: any): () => void {\n const ctx: UnorderedEventContext = { listener, scope, once: true };\n this._listeners.add(ctx);\n return () => this._removeCtx(ctx);\n }\n\n /** Remove a specific context entry, deferring during emit. */\n private _removeCtx(ctx: UnorderedEventContext): void {\n if (this._emitDepth > 0) {\n ctx.listener = undefined; // tombstone for deferred cleanup\n this._hasTombstones = true;\n } else {\n this._listeners.delete(ctx);\n }\n }\n\n /**\n * Raises the event by calling each registered listener with the supplied arguments.\n * @param args This method takes any number of parameters and passes them through to the listeners.\n */\n public raiseEvent(...args: Parameters<T>) {\n this._emitDepth++;\n\n for (const ctx of this._listeners) {\n if (!ctx.listener) {\n continue;\n }\n try {\n ctx.listener.apply(ctx.scope, args);\n } catch (e) {\n UnexpectedErrors.handle(e);\n }\n if (ctx.listener && ctx.once) {\n ctx.listener = undefined;\n this._hasTombstones = true;\n }\n }\n\n this._emitDepth--;\n\n // Only clean up tombstoned entries when we're back at the outermost emit\n if (this._hasTombstones && this._emitDepth === 0) {\n this._hasTombstones = false;\n for (const ctx of this._listeners) {\n if (ctx.listener === undefined)\n this._listeners.delete(ctx);\n }\n }\n }\n\n /** Clear all listeners from this BeUnorderedEvent.\n * @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped\n * immediately rather than being tombstoned.\n */\n public clear(): void { this._listeners.clear(); }\n}\n\n/** Specialization of BeUnorderedEvent for events that take a single strongly typed argument, primarily used for UI events.\n * @beta\n */\nexport class BeUnorderedUiEvent<TEventArgs> extends BeUnorderedEvent<(args: TEventArgs) => void> {\n /** Raises event with single strongly typed argument. */\n public emit(args: TEventArgs): void { this.raiseEvent(args); }\n}\n\n/**\n * A list of BeEvent objects, accessible by an event name.\n * This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.\n * @public\n */\nexport class BeEventList<T extends Listener> {\n private _events: { [name: string]: BeEvent<T> | undefined } = {};\n\n /**\n * Gets the event associated with the specified name, creating the event if it does not already exist.\n * @param name The name of the event.\n */\n public get(name: string): BeEvent<T> {\n let event = this._events[name];\n if (event)\n return event;\n\n event = new BeEvent();\n this._events[name] = event;\n return event;\n }\n\n /**\n * Removes the event associated with a name.\n * @param name The name of the event.\n */\n public remove(name: string): void {\n this._events[name] = undefined;\n }\n}\n\n/**\n * Retrieves the type of the callback function for an event type like [[BeEvent]].\n * For example:\n * ```ts\n * const event = new BeEvent<(x: number, y: string) => void>();\n * const callback: ListenerType<typeof event> = (x, y) => {\n * console.log(`${x}, ${y}`);\n * };\n * ```\n *\n * @public\n */\nexport type ListenerType<TEvent extends {\n addListener(listener: Listener): () => void;\n}> =\n TEvent extends {\n addListener(listener: infer TListener): () => void;\n } ? TListener : never;\n"]}
|
package/lib/cjs/BeSQLite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeSQLite.js","sourceRoot":"","sources":["../../src/BeSQLite.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+CAAqB,CAAA;IACrB,iDAAsB,CAAA;AACxB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,yBAAyB;IACzB,2CAAU,CAAA;IACV,8BAA8B;IAC9B,4CAAW,CAAA;IACX,oDAAoD;IACpD,4CAAW,CAAA;AACb,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAED;;GAEG;AACH,8GAA8G;AAC9G,IAAY,QA0JX;AA1JD,WAAY,QAAQ;I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,iFAA0D,CAAA;IAC1D,uFAA6D,CAAA;IAC7D,6EAAuD,CAAA;IACvD,uFAA6D,CAAA;IAC7D,uFAA6D,CAAA;IAC7D,uFAA6D,CAAA;IAC7D,iFAAuD,CAAA;IACvD,qFAAmE,CAAA;IACnE,+FAAwE,CAAA;IACxE,+FAAwE,CAAA;IACxE,4FAAsE,CAAA;IACtE,0FAAqE,CAAA;IACrE,gGAAwE,CAAA;IACxE,0FAAqE,CAAA;IACrE,wFAAoE,CAAA;IACpE,oFAAkE,CAAA;AACpE,CAAC,EA1JW,QAAQ,wBAAR,QAAQ,QA0JnB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BeSQLite\r\n */\r\n\r\n/** Whether to open a database readonly or writeable.\r\n * @public\r\n */\r\nexport enum OpenMode {\r\n Readonly = 0x00000001,\r\n ReadWrite = 0x00000002,\r\n}\r\n\r\n/** Values, stored in changesets, that indicate what operation was performed on the database.\r\n * @public\r\n */\r\nexport enum DbOpcode {\r\n /** A row was deleted. */\r\n Delete = 9,\r\n /** A new row was inserted. */\r\n Insert = 18,\r\n /** Some columns of an existing row were updated. */\r\n Update = 23,\r\n}\r\n\r\n/** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.\r\n * @public\r\n */\r\n// Disabling for the rest of the file since eslint does not correctly parse the entire enum, only parts of it\r\nexport enum DbResult {\r\n /** Success */\r\n BE_SQLITE_OK = 0,\r\n /** SQL error or missing database */\r\n BE_SQLITE_ERROR = 1,\r\n /** Internal logic error */\r\n BE_SQLITE_INTERNAL = 2,\r\n /** Access permission denied */\r\n BE_SQLITE_PERM = 3,\r\n /** Callback routine requested an abort */\r\n BE_SQLITE_ABORT = 4,\r\n /** The database file is locked */\r\n BE_SQLITE_BUSY = 5,\r\n /** A table in the database is locked */\r\n BE_SQLITE_LOCKED = 6,\r\n /** A malloc() failed */\r\n BE_SQLITE_NOMEM = 7,\r\n /** Attempt to write a readonly database */\r\n BE_SQLITE_READONLY = 8,\r\n /** Operation terminated by interrupt */\r\n BE_SQLITE_INTERRUPT = 9,\r\n /** Some kind of disk I/O error occurred */\r\n BE_SQLITE_IOERR = 10,\r\n /** The database disk image is malformed */\r\n BE_SQLITE_CORRUPT = 11,\r\n /** NOT USED. Table or record not found */\r\n BE_SQLITE_NOTFOUND = 12,\r\n /** Insertion failed because database is full or write operation failed because disk is full */\r\n BE_SQLITE_FULL = 13,\r\n /** Unable to open the database file */\r\n BE_SQLITE_CANTOPEN = 14,\r\n /** Database lock protocol error */\r\n BE_SQLITE_PROTOCOL = 15,\r\n /** Database is empty */\r\n BE_SQLITE_EMPTY = 16,\r\n /** The database schema changed */\r\n BE_SQLITE_SCHEMA = 17,\r\n /** String or BLOB exceeds size limit */\r\n BE_SQLITE_TOOBIG = 18,\r\n /** Abort due to constraint violation. See extended error values. */\r\n BE_SQLITE_CONSTRAINT_BASE = 19,\r\n /** Data type mismatch */\r\n BE_SQLITE_MISMATCH = 20,\r\n /** Library used incorrectly */\r\n BE_SQLITE_MISUSE = 21,\r\n /** Uses OS features not supported on host */\r\n BE_SQLITE_NOLFS = 22,\r\n /** Authorization denied */\r\n BE_SQLITE_AUTH = 23,\r\n /** Auxiliary database format error */\r\n BE_SQLITE_FORMAT = 24,\r\n /** 2nd parameter to Bind out of range */\r\n BE_SQLITE_RANGE = 25,\r\n /** File opened that is not a database file */\r\n BE_SQLITE_NOTADB = 26,\r\n /** Step() has another row ready */\r\n BE_SQLITE_ROW = 100,\r\n /** Step() has finished executing */\r\n BE_SQLITE_DONE = 101,\r\n\r\n BE_SQLITE_IOERR_READ = (BE_SQLITE_IOERR | (1 << 8)),\r\n BE_SQLITE_IOERR_SHORT_READ = (BE_SQLITE_IOERR | (2 << 8)),\r\n BE_SQLITE_IOERR_WRITE = (BE_SQLITE_IOERR | (3 << 8)),\r\n BE_SQLITE_IOERR_FSYNC = (BE_SQLITE_IOERR | (4 << 8)),\r\n BE_SQLITE_IOERR_DIR_FSYNC = (BE_SQLITE_IOERR | (5 << 8)),\r\n BE_SQLITE_IOERR_TRUNCATE = (BE_SQLITE_IOERR | (6 << 8)),\r\n BE_SQLITE_IOERR_FSTAT = (BE_SQLITE_IOERR | (7 << 8)),\r\n BE_SQLITE_IOERR_UNLOCK = (BE_SQLITE_IOERR | (8 << 8)),\r\n BE_SQLITE_IOERR_RDLOCK = (BE_SQLITE_IOERR | (9 << 8)),\r\n BE_SQLITE_IOERR_DELETE = (BE_SQLITE_IOERR | (10 << 8)),\r\n BE_SQLITE_IOERR_BLOCKED = (BE_SQLITE_IOERR | (11 << 8)),\r\n BE_SQLITE_IOERR_NOMEM = (BE_SQLITE_IOERR | (12 << 8)),\r\n BE_SQLITE_IOERR_ACCESS = (BE_SQLITE_IOERR | (13 << 8)),\r\n BE_SQLITE_IOERR_CHECKRESERVEDLOCK = (BE_SQLITE_IOERR | (14 << 8)),\r\n BE_SQLITE_IOERR_LOCK = (BE_SQLITE_IOERR | (15 << 8)),\r\n BE_SQLITE_IOERR_CLOSE = (BE_SQLITE_IOERR | (16 << 8)),\r\n BE_SQLITE_IOERR_DIR_CLOSE = (BE_SQLITE_IOERR | (17 << 8)),\r\n BE_SQLITE_IOERR_SHMOPEN = (BE_SQLITE_IOERR | (18 << 8)),\r\n BE_SQLITE_IOERR_SHMSIZE = (BE_SQLITE_IOERR | (19 << 8)),\r\n BE_SQLITE_IOERR_SHMLOCK = (BE_SQLITE_IOERR | (20 << 8)),\r\n BE_SQLITE_IOERR_SHMMAP = (BE_SQLITE_IOERR | (21 << 8)),\r\n BE_SQLITE_IOERR_SEEK = (BE_SQLITE_IOERR | (22 << 8)),\r\n BE_SQLITE_IOERR_DELETE_NOENT = (BE_SQLITE_IOERR | (23 << 8)),\r\n\r\n /** attempt to create a new file when a file by that name already exists */\r\n BE_SQLITE_ERROR_FileExists = (BE_SQLITE_IOERR | (1 << 24)),\r\n /** attempt to open a BeSQLite::Db that is already in use somewhere. */\r\n BE_SQLITE_ERROR_AlreadyOpen = (BE_SQLITE_IOERR | (2 << 24)),\r\n /** attempt to open a BeSQLite::Db that doesn't have a property table. */\r\n BE_SQLITE_ERROR_NoPropertyTable = (BE_SQLITE_IOERR | (3 << 24)),\r\n /** the database name is not a file. */\r\n BE_SQLITE_ERROR_FileNotFound = (BE_SQLITE_IOERR | (4 << 24)),\r\n /** there is no transaction active and the database was opened with AllowImplicitTransactions=false */\r\n BE_SQLITE_ERROR_NoTxnActive = (BE_SQLITE_IOERR | (5 << 24)),\r\n /** wrong BeSQLite profile version */\r\n BE_SQLITE_ERROR_BadDbProfile = (BE_SQLITE_IOERR | (6 << 24)),\r\n /** Profile of file could not be determined. */\r\n BE_SQLITE_ERROR_InvalidProfileVersion = (BE_SQLITE_IOERR | (7 << 24)),\r\n /** Upgrade of profile of file failed. */\r\n BE_SQLITE_ERROR_ProfileUpgradeFailed = (BE_SQLITE_IOERR | (8 << 24)),\r\n /** Profile of file is too old. Therefore file can only be opened read-only. */\r\n BE_SQLITE_ERROR_ProfileTooOldForReadWrite = (BE_SQLITE_IOERR | (9 << 24)),\r\n /** Profile of file is too old. Therefore file cannot be opened. */\r\n BE_SQLITE_ERROR_ProfileTooOld = (BE_SQLITE_IOERR | (10 << 24)),\r\n /** Profile of file is too new for read-write access. Therefore file can only be opened read-only. */\r\n BE_SQLITE_ERROR_ProfileTooNewForReadWrite = (BE_SQLITE_IOERR | (11 << 24)),\r\n /** Profile of file is too new. Therefore file cannot be opened. */\r\n BE_SQLITE_ERROR_ProfileTooNew = (BE_SQLITE_IOERR | (12 << 24)),\r\n /** attempt to commit with active changetrack */\r\n BE_SQLITE_ERROR_ChangeTrackError = (BE_SQLITE_IOERR | (13 << 24)),\r\n /** invalid version of the revision file is being imported */\r\n BE_SQLITE_ERROR_InvalidChangeSetVersion = (BE_SQLITE_IOERR | (14 << 24)),\r\n /** The schemas found in the database need to be upgraded */\r\n BE_SQLITE_ERROR_SchemaUpgradeRequired = (BE_SQLITE_IOERR | 15 << 24),\r\n /** The schemas found in the database are too new, and the application needs to be upgraded. */\r\n BE_SQLITE_ERROR_SchemaTooNew = (BE_SQLITE_IOERR | 16 << 24),\r\n /** The schemas found in the database are too old, and the DgnDb needs to be upgraded. */\r\n BE_SQLITE_ERROR_SchemaTooOld = (BE_SQLITE_IOERR | 17 << 24),\r\n /** Error acquiring a lock on the schemas before upgrade. */\r\n BE_SQLITE_ERROR_SchemaLockFailed = (BE_SQLITE_IOERR | 18 << 24),\r\n /** Error upgrading the schemas in the database. */\r\n BE_SQLITE_ERROR_SchemaUpgradeFailed = (BE_SQLITE_IOERR | 19 << 24),\r\n /** Error importing the schemas into the database. */\r\n BE_SQLITE_ERROR_SchemaImportFailed = (BE_SQLITE_IOERR | 20 << 24),\r\n /** Error acquiring locks or codes */\r\n BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes = (BE_SQLITE_IOERR | 21 << 24),\r\n /** Recommended that the schemas found in the database be upgraded */\r\n BE_SQLITE_ERROR_SchemaUpgradeRecommended = (BE_SQLITE_IOERR | 22 << 24),\r\n /** schema update require data transform */\r\n BE_SQLITE_ERROR_DataTransformRequired = (BE_SQLITE_IOERR | (23 << 24)),\r\n /** Db not open */\r\n BE_SQLITE_ERROR_NOTOPEN = (BE_SQLITE_ERROR | (1<<24)),\r\n /** Error propagating changes during commit */\r\n BE_SQLITE_ERROR_PropagateChangesFailed = (BE_SQLITE_ERROR | (2<<24)),\r\n\r\n BE_SQLITE_LOCKED_SHAREDCACHE = (BE_SQLITE_LOCKED | (1 << 8)),\r\n BE_SQLITE_BUSY_RECOVERY = (BE_SQLITE_BUSY | (1 << 8)),\r\n BE_SQLITE_CANTOPEN_NOTEMPDIR = (BE_SQLITE_CANTOPEN | (1 << 8)),\r\n BE_SQLITE_CANTOPEN_ISDIR = (BE_SQLITE_CANTOPEN | (2 << 8)),\r\n BE_SQLITE_CANTOPEN_FULLPATH = (BE_SQLITE_CANTOPEN | (3 << 8)),\r\n BE_SQLITE_CORRUPT_VTAB = (BE_SQLITE_CORRUPT | (1 << 8)),\r\n BE_SQLITE_READONLY_RECOVERY = (BE_SQLITE_READONLY | (1 << 8)),\r\n BE_SQLITE_READONLY_CANTLOCK = (BE_SQLITE_READONLY | (2 << 8)),\r\n BE_SQLITE_READONLY_ROLLBACK = (BE_SQLITE_READONLY | (3 << 8)),\r\n BE_SQLITE_ABORT_ROLLBACK = (BE_SQLITE_ABORT | (2 << 8)),\r\n BE_SQLITE_CONSTRAINT_CHECK = (BE_SQLITE_CONSTRAINT_BASE | (1 << 8)),\r\n BE_SQLITE_CONSTRAINT_COMMITHOOK = (BE_SQLITE_CONSTRAINT_BASE | (2 << 8)),\r\n BE_SQLITE_CONSTRAINT_FOREIGNKEY = (BE_SQLITE_CONSTRAINT_BASE | (3 << 8)),\r\n BE_SQLITE_CONSTRAINT_FUNCTION = (BE_SQLITE_CONSTRAINT_BASE | (4 << 8)),\r\n BE_SQLITE_CONSTRAINT_NOTNULL = (BE_SQLITE_CONSTRAINT_BASE | (5 << 8)),\r\n BE_SQLITE_CONSTRAINT_PRIMARYKEY = (BE_SQLITE_CONSTRAINT_BASE | (6 << 8)),\r\n BE_SQLITE_CONSTRAINT_TRIGGER = (BE_SQLITE_CONSTRAINT_BASE | (7 << 8)),\r\n BE_SQLITE_CONSTRAINT_UNIQUE = (BE_SQLITE_CONSTRAINT_BASE | (8 << 8)),\r\n BE_SQLITE_CONSTRAINT_VTAB = (BE_SQLITE_CONSTRAINT_BASE | (9 << 8)),\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BeSQLite.js","sourceRoot":"","sources":["../../src/BeSQLite.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+CAAqB,CAAA;IACrB,iDAAsB,CAAA;AAC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D;IACnD,6GAAkE,CAAA;IAClE,qDAAqD;IACrD,2GAAiE,CAAA;IACjE,qCAAqC;IACrC,6HAA0E,CAAA;IAC1E,qEAAqE;IACrE,uHAAuE,CAAA;IACvE,2CAA2C;IAC3C,iHAAsE,CAAA;IACtE,kBAAkB;IAClB,oFAAqD,CAAA;IACrD,8CAA8C;IAC9C,kHAAoE,CAAA;IAEpE,yFAA4D,CAAA;IAC5D,+EAAqD,CAAA;IACrD,yFAA8D,CAAA;IAC9D,iFAA0D,CAAA;IAC1D,uFAA6D,CAAA;IAC7D,6EAAuD,CAAA;IACvD,uFAA6D,CAAA;IAC7D,uFAA6D,CAAA;IAC7D,uFAA6D,CAAA;IAC7D,iFAAuD,CAAA;IACvD,qFAAmE,CAAA;IACnE,+FAAwE,CAAA;IACxE,+FAAwE,CAAA;IACxE,4FAAsE,CAAA;IACtE,0FAAqE,CAAA;IACrE,gGAAwE,CAAA;IACxE,0FAAqE,CAAA;IACrE,wFAAoE,CAAA;IACpE,oFAAkE,CAAA;AACpE,CAAC,EA1JW,QAAQ,wBAAR,QAAQ,QA0JnB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module BeSQLite\n */\n\n/** Whether to open a database readonly or writeable.\n * @public\n */\nexport enum OpenMode {\n Readonly = 0x00000001,\n ReadWrite = 0x00000002,\n}\n\n/** Values, stored in changesets, that indicate what operation was performed on the database.\n * @public\n */\nexport enum DbOpcode {\n /** A row was deleted. */\n Delete = 9,\n /** A new row was inserted. */\n Insert = 18,\n /** Some columns of an existing row were updated. */\n Update = 23,\n}\n\n/** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.\n * @public\n */\n// Disabling for the rest of the file since eslint does not correctly parse the entire enum, only parts of it\nexport enum DbResult {\n /** Success */\n BE_SQLITE_OK = 0,\n /** SQL error or missing database */\n BE_SQLITE_ERROR = 1,\n /** Internal logic error */\n BE_SQLITE_INTERNAL = 2,\n /** Access permission denied */\n BE_SQLITE_PERM = 3,\n /** Callback routine requested an abort */\n BE_SQLITE_ABORT = 4,\n /** The database file is locked */\n BE_SQLITE_BUSY = 5,\n /** A table in the database is locked */\n BE_SQLITE_LOCKED = 6,\n /** A malloc() failed */\n BE_SQLITE_NOMEM = 7,\n /** Attempt to write a readonly database */\n BE_SQLITE_READONLY = 8,\n /** Operation terminated by interrupt */\n BE_SQLITE_INTERRUPT = 9,\n /** Some kind of disk I/O error occurred */\n BE_SQLITE_IOERR = 10,\n /** The database disk image is malformed */\n BE_SQLITE_CORRUPT = 11,\n /** NOT USED. Table or record not found */\n BE_SQLITE_NOTFOUND = 12,\n /** Insertion failed because database is full or write operation failed because disk is full */\n BE_SQLITE_FULL = 13,\n /** Unable to open the database file */\n BE_SQLITE_CANTOPEN = 14,\n /** Database lock protocol error */\n BE_SQLITE_PROTOCOL = 15,\n /** Database is empty */\n BE_SQLITE_EMPTY = 16,\n /** The database schema changed */\n BE_SQLITE_SCHEMA = 17,\n /** String or BLOB exceeds size limit */\n BE_SQLITE_TOOBIG = 18,\n /** Abort due to constraint violation. See extended error values. */\n BE_SQLITE_CONSTRAINT_BASE = 19,\n /** Data type mismatch */\n BE_SQLITE_MISMATCH = 20,\n /** Library used incorrectly */\n BE_SQLITE_MISUSE = 21,\n /** Uses OS features not supported on host */\n BE_SQLITE_NOLFS = 22,\n /** Authorization denied */\n BE_SQLITE_AUTH = 23,\n /** Auxiliary database format error */\n BE_SQLITE_FORMAT = 24,\n /** 2nd parameter to Bind out of range */\n BE_SQLITE_RANGE = 25,\n /** File opened that is not a database file */\n BE_SQLITE_NOTADB = 26,\n /** Step() has another row ready */\n BE_SQLITE_ROW = 100,\n /** Step() has finished executing */\n BE_SQLITE_DONE = 101,\n\n BE_SQLITE_IOERR_READ = (BE_SQLITE_IOERR | (1 << 8)),\n BE_SQLITE_IOERR_SHORT_READ = (BE_SQLITE_IOERR | (2 << 8)),\n BE_SQLITE_IOERR_WRITE = (BE_SQLITE_IOERR | (3 << 8)),\n BE_SQLITE_IOERR_FSYNC = (BE_SQLITE_IOERR | (4 << 8)),\n BE_SQLITE_IOERR_DIR_FSYNC = (BE_SQLITE_IOERR | (5 << 8)),\n BE_SQLITE_IOERR_TRUNCATE = (BE_SQLITE_IOERR | (6 << 8)),\n BE_SQLITE_IOERR_FSTAT = (BE_SQLITE_IOERR | (7 << 8)),\n BE_SQLITE_IOERR_UNLOCK = (BE_SQLITE_IOERR | (8 << 8)),\n BE_SQLITE_IOERR_RDLOCK = (BE_SQLITE_IOERR | (9 << 8)),\n BE_SQLITE_IOERR_DELETE = (BE_SQLITE_IOERR | (10 << 8)),\n BE_SQLITE_IOERR_BLOCKED = (BE_SQLITE_IOERR | (11 << 8)),\n BE_SQLITE_IOERR_NOMEM = (BE_SQLITE_IOERR | (12 << 8)),\n BE_SQLITE_IOERR_ACCESS = (BE_SQLITE_IOERR | (13 << 8)),\n BE_SQLITE_IOERR_CHECKRESERVEDLOCK = (BE_SQLITE_IOERR | (14 << 8)),\n BE_SQLITE_IOERR_LOCK = (BE_SQLITE_IOERR | (15 << 8)),\n BE_SQLITE_IOERR_CLOSE = (BE_SQLITE_IOERR | (16 << 8)),\n BE_SQLITE_IOERR_DIR_CLOSE = (BE_SQLITE_IOERR | (17 << 8)),\n BE_SQLITE_IOERR_SHMOPEN = (BE_SQLITE_IOERR | (18 << 8)),\n BE_SQLITE_IOERR_SHMSIZE = (BE_SQLITE_IOERR | (19 << 8)),\n BE_SQLITE_IOERR_SHMLOCK = (BE_SQLITE_IOERR | (20 << 8)),\n BE_SQLITE_IOERR_SHMMAP = (BE_SQLITE_IOERR | (21 << 8)),\n BE_SQLITE_IOERR_SEEK = (BE_SQLITE_IOERR | (22 << 8)),\n BE_SQLITE_IOERR_DELETE_NOENT = (BE_SQLITE_IOERR | (23 << 8)),\n\n /** attempt to create a new file when a file by that name already exists */\n BE_SQLITE_ERROR_FileExists = (BE_SQLITE_IOERR | (1 << 24)),\n /** attempt to open a BeSQLite::Db that is already in use somewhere. */\n BE_SQLITE_ERROR_AlreadyOpen = (BE_SQLITE_IOERR | (2 << 24)),\n /** attempt to open a BeSQLite::Db that doesn't have a property table. */\n BE_SQLITE_ERROR_NoPropertyTable = (BE_SQLITE_IOERR | (3 << 24)),\n /** the database name is not a file. */\n BE_SQLITE_ERROR_FileNotFound = (BE_SQLITE_IOERR | (4 << 24)),\n /** there is no transaction active and the database was opened with AllowImplicitTransactions=false */\n BE_SQLITE_ERROR_NoTxnActive = (BE_SQLITE_IOERR | (5 << 24)),\n /** wrong BeSQLite profile version */\n BE_SQLITE_ERROR_BadDbProfile = (BE_SQLITE_IOERR | (6 << 24)),\n /** Profile of file could not be determined. */\n BE_SQLITE_ERROR_InvalidProfileVersion = (BE_SQLITE_IOERR | (7 << 24)),\n /** Upgrade of profile of file failed. */\n BE_SQLITE_ERROR_ProfileUpgradeFailed = (BE_SQLITE_IOERR | (8 << 24)),\n /** Profile of file is too old. Therefore file can only be opened read-only. */\n BE_SQLITE_ERROR_ProfileTooOldForReadWrite = (BE_SQLITE_IOERR | (9 << 24)),\n /** Profile of file is too old. Therefore file cannot be opened. */\n BE_SQLITE_ERROR_ProfileTooOld = (BE_SQLITE_IOERR | (10 << 24)),\n /** Profile of file is too new for read-write access. Therefore file can only be opened read-only. */\n BE_SQLITE_ERROR_ProfileTooNewForReadWrite = (BE_SQLITE_IOERR | (11 << 24)),\n /** Profile of file is too new. Therefore file cannot be opened. */\n BE_SQLITE_ERROR_ProfileTooNew = (BE_SQLITE_IOERR | (12 << 24)),\n /** attempt to commit with active changetrack */\n BE_SQLITE_ERROR_ChangeTrackError = (BE_SQLITE_IOERR | (13 << 24)),\n /** invalid version of the revision file is being imported */\n BE_SQLITE_ERROR_InvalidChangeSetVersion = (BE_SQLITE_IOERR | (14 << 24)),\n /** The schemas found in the database need to be upgraded */\n BE_SQLITE_ERROR_SchemaUpgradeRequired = (BE_SQLITE_IOERR | 15 << 24),\n /** The schemas found in the database are too new, and the application needs to be upgraded. */\n BE_SQLITE_ERROR_SchemaTooNew = (BE_SQLITE_IOERR | 16 << 24),\n /** The schemas found in the database are too old, and the DgnDb needs to be upgraded. */\n BE_SQLITE_ERROR_SchemaTooOld = (BE_SQLITE_IOERR | 17 << 24),\n /** Error acquiring a lock on the schemas before upgrade. */\n BE_SQLITE_ERROR_SchemaLockFailed = (BE_SQLITE_IOERR | 18 << 24),\n /** Error upgrading the schemas in the database. */\n BE_SQLITE_ERROR_SchemaUpgradeFailed = (BE_SQLITE_IOERR | 19 << 24),\n /** Error importing the schemas into the database. */\n BE_SQLITE_ERROR_SchemaImportFailed = (BE_SQLITE_IOERR | 20 << 24),\n /** Error acquiring locks or codes */\n BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes = (BE_SQLITE_IOERR | 21 << 24),\n /** Recommended that the schemas found in the database be upgraded */\n BE_SQLITE_ERROR_SchemaUpgradeRecommended = (BE_SQLITE_IOERR | 22 << 24),\n /** schema update require data transform */\n BE_SQLITE_ERROR_DataTransformRequired = (BE_SQLITE_IOERR | (23 << 24)),\n /** Db not open */\n BE_SQLITE_ERROR_NOTOPEN = (BE_SQLITE_ERROR | (1<<24)),\n /** Error propagating changes during commit */\n BE_SQLITE_ERROR_PropagateChangesFailed = (BE_SQLITE_ERROR | (2<<24)),\n\n BE_SQLITE_LOCKED_SHAREDCACHE = (BE_SQLITE_LOCKED | (1 << 8)),\n BE_SQLITE_BUSY_RECOVERY = (BE_SQLITE_BUSY | (1 << 8)),\n BE_SQLITE_CANTOPEN_NOTEMPDIR = (BE_SQLITE_CANTOPEN | (1 << 8)),\n BE_SQLITE_CANTOPEN_ISDIR = (BE_SQLITE_CANTOPEN | (2 << 8)),\n BE_SQLITE_CANTOPEN_FULLPATH = (BE_SQLITE_CANTOPEN | (3 << 8)),\n BE_SQLITE_CORRUPT_VTAB = (BE_SQLITE_CORRUPT | (1 << 8)),\n BE_SQLITE_READONLY_RECOVERY = (BE_SQLITE_READONLY | (1 << 8)),\n BE_SQLITE_READONLY_CANTLOCK = (BE_SQLITE_READONLY | (2 << 8)),\n BE_SQLITE_READONLY_ROLLBACK = (BE_SQLITE_READONLY | (3 << 8)),\n BE_SQLITE_ABORT_ROLLBACK = (BE_SQLITE_ABORT | (2 << 8)),\n BE_SQLITE_CONSTRAINT_CHECK = (BE_SQLITE_CONSTRAINT_BASE | (1 << 8)),\n BE_SQLITE_CONSTRAINT_COMMITHOOK = (BE_SQLITE_CONSTRAINT_BASE | (2 << 8)),\n BE_SQLITE_CONSTRAINT_FOREIGNKEY = (BE_SQLITE_CONSTRAINT_BASE | (3 << 8)),\n BE_SQLITE_CONSTRAINT_FUNCTION = (BE_SQLITE_CONSTRAINT_BASE | (4 << 8)),\n BE_SQLITE_CONSTRAINT_NOTNULL = (BE_SQLITE_CONSTRAINT_BASE | (5 << 8)),\n BE_SQLITE_CONSTRAINT_PRIMARYKEY = (BE_SQLITE_CONSTRAINT_BASE | (6 << 8)),\n BE_SQLITE_CONSTRAINT_TRIGGER = (BE_SQLITE_CONSTRAINT_BASE | (7 << 8)),\n BE_SQLITE_CONSTRAINT_UNIQUE = (BE_SQLITE_CONSTRAINT_BASE | (8 << 8)),\n BE_SQLITE_CONSTRAINT_VTAB = (BE_SQLITE_CONSTRAINT_BASE | (9 << 8)),\n}\n"]}
|