hadron-document 8.6.1 → 8.6.3
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/dist/document.d.ts +152 -0
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +161 -0
- package/dist/document.js.map +1 -1
- package/dist/editor/date.d.ts +36 -0
- package/dist/editor/date.d.ts.map +1 -1
- package/dist/editor/date.js +38 -0
- package/dist/editor/date.js.map +1 -1
- package/dist/editor/decimal128.d.ts +18 -0
- package/dist/editor/decimal128.d.ts.map +1 -1
- package/dist/editor/decimal128.js +18 -0
- package/dist/editor/decimal128.js.map +1 -1
- package/dist/editor/double.d.ts +25 -0
- package/dist/editor/double.d.ts.map +1 -1
- package/dist/editor/double.js +30 -1
- package/dist/editor/double.js.map +1 -1
- package/dist/editor/int32.d.ts +15 -0
- package/dist/editor/int32.d.ts.map +1 -1
- package/dist/editor/int32.js +15 -0
- package/dist/editor/int32.js.map +1 -1
- package/dist/editor/int64.d.ts +18 -0
- package/dist/editor/int64.d.ts.map +1 -1
- package/dist/editor/int64.js +18 -0
- package/dist/editor/int64.js.map +1 -1
- package/dist/editor/null.d.ts +20 -0
- package/dist/editor/null.d.ts.map +1 -1
- package/dist/editor/null.js +23 -0
- package/dist/editor/null.js.map +1 -1
- package/dist/editor/objectid.d.ts +20 -0
- package/dist/editor/objectid.d.ts.map +1 -1
- package/dist/editor/objectid.js +20 -0
- package/dist/editor/objectid.js.map +1 -1
- package/dist/editor/standard.d.ts +32 -0
- package/dist/editor/standard.d.ts.map +1 -1
- package/dist/editor/standard.js +36 -0
- package/dist/editor/standard.js.map +1 -1
- package/dist/editor/string.d.ts +8 -0
- package/dist/editor/string.d.ts.map +1 -1
- package/dist/editor/string.js +8 -0
- package/dist/editor/string.js.map +1 -1
- package/dist/editor/undefined.d.ts +20 -0
- package/dist/editor/undefined.d.ts.map +1 -1
- package/dist/editor/undefined.js +23 -0
- package/dist/editor/undefined.js.map +1 -1
- package/dist/element-events.d.ts +3 -0
- package/dist/element-events.d.ts.map +1 -1
- package/dist/element-events.js +3 -0
- package/dist/element-events.js.map +1 -1
- package/dist/element.d.ts +321 -0
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +341 -0
- package/dist/element.js.map +1 -1
- package/dist/object-generator.d.ts +96 -0
- package/dist/object-generator.d.ts.map +1 -1
- package/dist/object-generator.js +129 -0
- package/dist/object-generator.js.map +1 -1
- package/dist/utils.d.ts +22 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +25 -0
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
package/dist/editor/string.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import StandardEditor from './standard';
|
|
2
2
|
import type Element from '../element';
|
|
3
3
|
export declare const STRING_TYPE = "String";
|
|
4
|
+
/**
|
|
5
|
+
* CRUD editor for string values.
|
|
6
|
+
*/
|
|
4
7
|
export default class StringEditor extends StandardEditor {
|
|
8
|
+
/**
|
|
9
|
+
* Create the editor with the element.
|
|
10
|
+
*
|
|
11
|
+
* @param {Element} element - The hadron document element.
|
|
12
|
+
*/
|
|
5
13
|
constructor(element: Element);
|
|
6
14
|
}
|
|
7
15
|
//# sourceMappingURL=string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/editor/string.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,WAAW,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/editor/string.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD;;;;OAIG;gBACS,OAAO,EAAE,OAAO;CAG7B"}
|
package/dist/editor/string.js
CHANGED
|
@@ -6,7 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.STRING_TYPE = void 0;
|
|
7
7
|
const standard_1 = __importDefault(require("./standard"));
|
|
8
8
|
exports.STRING_TYPE = 'String';
|
|
9
|
+
/**
|
|
10
|
+
* CRUD editor for string values.
|
|
11
|
+
*/
|
|
9
12
|
class StringEditor extends standard_1.default {
|
|
13
|
+
/**
|
|
14
|
+
* Create the editor with the element.
|
|
15
|
+
*
|
|
16
|
+
* @param {Element} element - The hadron document element.
|
|
17
|
+
*/
|
|
10
18
|
constructor(element) {
|
|
11
19
|
super(element);
|
|
12
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/editor/string.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAwC;AAG3B,QAAA,WAAW,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/editor/string.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAwC;AAG3B,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEpC;;GAEG;AACH,MAAqB,YAAa,SAAQ,kBAAc;IACtD;;;;OAIG;IACH,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AATD,+BASC"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import StandardEditor from './standard';
|
|
2
2
|
import type Element from '../element';
|
|
3
|
+
/**
|
|
4
|
+
* CRUD editor for undefined values.
|
|
5
|
+
*/
|
|
3
6
|
export default class UndefinedEditor extends StandardEditor {
|
|
7
|
+
/**
|
|
8
|
+
* Create the editor with the element.
|
|
9
|
+
*
|
|
10
|
+
* @param {Element} element - The hadron document element.
|
|
11
|
+
*/
|
|
4
12
|
constructor(element: Element);
|
|
13
|
+
/**
|
|
14
|
+
* Get the number of characters the value should display.
|
|
15
|
+
*
|
|
16
|
+
* @param {Boolean} editMode - If the element is being edited.
|
|
17
|
+
*
|
|
18
|
+
* @returns {Number} The number of characters.
|
|
19
|
+
*/
|
|
5
20
|
size(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Get the value being edited.
|
|
23
|
+
*
|
|
24
|
+
* @returns {Object} The value.
|
|
25
|
+
*/
|
|
6
26
|
value(): 'undefined';
|
|
7
27
|
}
|
|
8
28
|
//# sourceMappingURL=undefined.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undefined.d.ts","sourceRoot":"","sources":["../../src/editor/undefined.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"undefined.d.ts","sourceRoot":"","sources":["../../src/editor/undefined.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAOtC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,cAAc;IACzD;;;;OAIG;gBACS,OAAO,EAAE,OAAO;IAI5B;;;;;;OAMG;IACH,IAAI,IAAI,MAAM;IAId;;;;OAIG;IACH,KAAK,IAAI,WAAW;CAGrB"}
|
package/dist/editor/undefined.js
CHANGED
|
@@ -4,14 +4,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const standard_1 = __importDefault(require("./standard"));
|
|
7
|
+
/**
|
|
8
|
+
* Undefined is always 'undefined'
|
|
9
|
+
*/
|
|
7
10
|
const VALUE = 'undefined';
|
|
11
|
+
/**
|
|
12
|
+
* CRUD editor for undefined values.
|
|
13
|
+
*/
|
|
8
14
|
class UndefinedEditor extends standard_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Create the editor with the element.
|
|
17
|
+
*
|
|
18
|
+
* @param {Element} element - The hadron document element.
|
|
19
|
+
*/
|
|
9
20
|
constructor(element) {
|
|
10
21
|
super(element);
|
|
11
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the number of characters the value should display.
|
|
25
|
+
*
|
|
26
|
+
* @param {Boolean} editMode - If the element is being edited.
|
|
27
|
+
*
|
|
28
|
+
* @returns {Number} The number of characters.
|
|
29
|
+
*/
|
|
12
30
|
size() {
|
|
13
31
|
return VALUE.length;
|
|
14
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the value being edited.
|
|
35
|
+
*
|
|
36
|
+
* @returns {Object} The value.
|
|
37
|
+
*/
|
|
15
38
|
value() {
|
|
16
39
|
return VALUE;
|
|
17
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undefined.js","sourceRoot":"","sources":["../../src/editor/undefined.ts"],"names":[],"mappings":";;;;;AAAA,0DAAwC;
|
|
1
|
+
{"version":3,"file":"undefined.js","sourceRoot":"","sources":["../../src/editor/undefined.ts"],"names":[],"mappings":";;;;;AAAA,0DAAwC;AAGxC;;GAEG;AACH,MAAM,KAAK,GAAG,WAAW,CAAC;AAE1B;;GAEG;AACH,MAAqB,eAAgB,SAAQ,kBAAc;IACzD;;;;OAIG;IACH,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACH,IAAI;QACF,OAAO,KAAK,CAAC,MAAM,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA7BD,kCA6BC"}
|
package/dist/element-events.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-events.d.ts","sourceRoot":"","sources":["../src/element-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"element-events.d.ts","sourceRoot":"","sources":["../src/element-events.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;AACH,wBAWW"}
|
package/dist/element-events.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-events.js","sourceRoot":"","sources":["../src/element-events.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"element-events.js","sourceRoot":"","sources":["../src/element-events.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,kBAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,kBAAkB;IAC3B,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,oBAAoB;IAC/B,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,oBAAoB;IAC/B,sBAAsB,EAAE,iCAAiC;CACjD,CAAC"}
|
package/dist/element.d.ts
CHANGED
|
@@ -7,9 +7,16 @@ import type { BSONArray, BSONObject, BSONValue } from './utils';
|
|
|
7
7
|
import { ElementEvents } from '.';
|
|
8
8
|
export declare const DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS";
|
|
9
9
|
export { Events };
|
|
10
|
+
/**
|
|
11
|
+
* Is this the path to a field that is used internally by the
|
|
12
|
+
* MongoDB driver or server and not for user consumption?
|
|
13
|
+
*/
|
|
10
14
|
export declare function isInternalFieldPath(path: string | number): boolean;
|
|
11
15
|
export declare const DEFAULT_VISIBLE_ELEMENTS = 25;
|
|
12
16
|
export declare function isValueExpandable(value: BSONValue): value is BSONObject | BSONArray;
|
|
17
|
+
/**
|
|
18
|
+
* Represents an element in a document.
|
|
19
|
+
*/
|
|
13
20
|
export declare class Element extends EventEmitter {
|
|
14
21
|
uuid: string;
|
|
15
22
|
key: string | number;
|
|
@@ -29,66 +36,335 @@ export declare class Element extends EventEmitter {
|
|
|
29
36
|
decrypted: boolean;
|
|
30
37
|
expanded: boolean;
|
|
31
38
|
maxVisibleElementsCount: number;
|
|
39
|
+
/**
|
|
40
|
+
* Cancel any modifications to the element.
|
|
41
|
+
*/
|
|
32
42
|
cancel(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Create the element.
|
|
45
|
+
*
|
|
46
|
+
* @param key - The key.
|
|
47
|
+
* @param value - The value.
|
|
48
|
+
* @param parent - The parent element.
|
|
49
|
+
* @param added - Is the element a new 'addition'?
|
|
50
|
+
*/
|
|
33
51
|
constructor(key: string | number, value: BSONValue | number, parent?: Element | Document | null, added?: boolean);
|
|
34
52
|
get nextElement(): Element | undefined;
|
|
35
53
|
get previousElement(): Element | undefined;
|
|
36
54
|
_getLevel(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Edit the element.
|
|
57
|
+
*
|
|
58
|
+
* @param value - The new value.
|
|
59
|
+
*/
|
|
37
60
|
edit(value: BSONValue): void;
|
|
38
61
|
changeType(newType: TypeCastTypes): void;
|
|
39
62
|
getRoot(): Document;
|
|
63
|
+
/**
|
|
64
|
+
* Get an element by its key.
|
|
65
|
+
*
|
|
66
|
+
* @param key - The key name.
|
|
67
|
+
*
|
|
68
|
+
* @returns The element.
|
|
69
|
+
*/
|
|
40
70
|
get(key: string | number): Element | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Get an element by its index.
|
|
73
|
+
*
|
|
74
|
+
* @param i - The index.
|
|
75
|
+
*
|
|
76
|
+
* @returns The element.
|
|
77
|
+
*/
|
|
41
78
|
at(i: number): Element | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Rename the element. Update the parent's mapping if available.
|
|
81
|
+
*
|
|
82
|
+
* @param key - The new key.
|
|
83
|
+
*/
|
|
42
84
|
rename(key: string | number): void;
|
|
85
|
+
/**
|
|
86
|
+
* Generate the javascript object for this element.
|
|
87
|
+
*
|
|
88
|
+
* @returns The javascript object.
|
|
89
|
+
*/
|
|
43
90
|
generateObject(options?: ObjectGeneratorOptions): BSONValue;
|
|
91
|
+
/**
|
|
92
|
+
* Generate the javascript object representing the original values
|
|
93
|
+
* for this element (pre-element removal, renaming, editing).
|
|
94
|
+
*
|
|
95
|
+
* @returns The javascript object.
|
|
96
|
+
*/
|
|
44
97
|
generateOriginalObject(options?: ObjectGeneratorOptions): BSONValue;
|
|
98
|
+
/**
|
|
99
|
+
* Insert an element after the provided element. If this element is an array,
|
|
100
|
+
* then ignore the key specified by the caller and use the correct index.
|
|
101
|
+
* Update the keys of the rest of the elements in the LinkedList.
|
|
102
|
+
*
|
|
103
|
+
* @param element - The element to insert after.
|
|
104
|
+
* @param key - The key.
|
|
105
|
+
* @param value - The value.
|
|
106
|
+
*
|
|
107
|
+
* @returns The new element.
|
|
108
|
+
*/
|
|
45
109
|
insertAfter(element: Element, key: string | number, value: BSONValue): Element;
|
|
110
|
+
/**
|
|
111
|
+
* Add a new element to this element.
|
|
112
|
+
*
|
|
113
|
+
* @param| Number} key - The element key.
|
|
114
|
+
* @param value - The value.
|
|
115
|
+
*
|
|
116
|
+
* @returns The new element.
|
|
117
|
+
*/
|
|
46
118
|
insertEnd(key: string | number, value: BSONValue): Element;
|
|
119
|
+
/**
|
|
120
|
+
* Insert a placeholder element at the end of the element.
|
|
121
|
+
*
|
|
122
|
+
* @returns The placeholder element.
|
|
123
|
+
*/
|
|
47
124
|
insertPlaceholder(): Element;
|
|
48
125
|
insertSiblingPlaceholder(): Element;
|
|
126
|
+
/**
|
|
127
|
+
* Is the element a newly added element
|
|
128
|
+
*
|
|
129
|
+
* @returns If the element is newly added.
|
|
130
|
+
*/
|
|
49
131
|
isAdded(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Is the element blank?
|
|
134
|
+
*
|
|
135
|
+
* @returns If the element is blank.
|
|
136
|
+
*/
|
|
50
137
|
isBlank(): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Does the element have a valid value for the current type?
|
|
140
|
+
*
|
|
141
|
+
* @returns If the value is valid.
|
|
142
|
+
*/
|
|
51
143
|
isCurrentTypeValid(): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Set the element as valid.
|
|
146
|
+
*/
|
|
52
147
|
setValid(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Set the element as invalid.
|
|
150
|
+
*
|
|
151
|
+
* @param value - The value.
|
|
152
|
+
* @param newType - The new type.
|
|
153
|
+
* @param message - The error message.
|
|
154
|
+
*/
|
|
53
155
|
setInvalid(value: BSONValue, newType: TypeCastTypes, message: string): void;
|
|
156
|
+
/**
|
|
157
|
+
* Determine if the key is a duplicate.
|
|
158
|
+
*
|
|
159
|
+
* @param value - The value to check.
|
|
160
|
+
*
|
|
161
|
+
* @returns If the key is a duplicate.
|
|
162
|
+
*/
|
|
54
163
|
isDuplicateKey(value: string | number): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Determine if the element is edited - returns true if
|
|
166
|
+
* the key or value changed. Does not count array values whose keys have
|
|
167
|
+
* changed as edited.
|
|
168
|
+
*
|
|
169
|
+
* @returns If the element is edited.
|
|
170
|
+
*/
|
|
55
171
|
isEdited(): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Check for value equality.
|
|
174
|
+
|
|
175
|
+
* @returns If the value is equal.
|
|
176
|
+
*/
|
|
56
177
|
_valuesEqual(): boolean;
|
|
57
178
|
_isObjectIdEqual(): boolean;
|
|
58
179
|
_isExpandable(): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Is the element the last in the elements.
|
|
182
|
+
*
|
|
183
|
+
* @returns If the element is last.
|
|
184
|
+
*/
|
|
59
185
|
isLast(): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Determine if the element was explicitly renamed by the user.
|
|
188
|
+
*
|
|
189
|
+
* @returns If the element was explicitly renamed by the user.
|
|
190
|
+
*/
|
|
60
191
|
isRenamed(): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Determine if the element was renamed, potentially as part
|
|
194
|
+
* of moving array elements.
|
|
195
|
+
*
|
|
196
|
+
* @returns If the element was renamed, explicitly or implicitly.
|
|
197
|
+
*/
|
|
61
198
|
hasChangedKey(): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Can changes to the element be reverted?
|
|
201
|
+
*
|
|
202
|
+
* @returns If the element can be reverted.
|
|
203
|
+
*/
|
|
62
204
|
isRevertable(): boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Can the element be removed?
|
|
207
|
+
*
|
|
208
|
+
* @returns If the element can be removed.
|
|
209
|
+
*/
|
|
63
210
|
isRemovable(): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Can no action be taken on the element
|
|
213
|
+
*
|
|
214
|
+
* @returns If no action can be taken.
|
|
215
|
+
*/
|
|
64
216
|
isNotActionable(): boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Determine if the value has been decrypted via CSFLE.
|
|
219
|
+
*
|
|
220
|
+
* Warning: This does *not* apply to the children of decrypted elements!
|
|
221
|
+
* This only returns true for the exact field that was decrypted.
|
|
222
|
+
*
|
|
223
|
+
* a: Object
|
|
224
|
+
* \-- b: Object <- decrypted
|
|
225
|
+
* \-- c: number
|
|
226
|
+
*
|
|
227
|
+
* a.isValueDecrypted() === false
|
|
228
|
+
* a.get('b')?.isValueDecrypted() === true
|
|
229
|
+
* a.get('b')?.get('c')?.isValueDecrypted() === true
|
|
230
|
+
*
|
|
231
|
+
* @returns If the value was encrypted on the server and is now decrypted.
|
|
232
|
+
*/
|
|
65
233
|
isValueDecrypted(): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Detemine if this value or any of its children were marked
|
|
236
|
+
* as having been decrypted with CSFLE.
|
|
237
|
+
*
|
|
238
|
+
* Warning: This does *not* apply to the children of decrypted elements!
|
|
239
|
+
* This only returns true for the exact field that was decrypted
|
|
240
|
+
* and its parents.
|
|
241
|
+
*
|
|
242
|
+
* a: Object
|
|
243
|
+
* \-- b: Object <- decrypted
|
|
244
|
+
* \-- c: number
|
|
245
|
+
*
|
|
246
|
+
* a.containsDecryptedChildren() === true
|
|
247
|
+
* a.get('b')?.containsDecryptedChildren() === true
|
|
248
|
+
* a.get('b')?.get('c')?.containsDecryptedChildren() === false
|
|
249
|
+
*
|
|
250
|
+
* @returns If any child of this element has been decrypted directly.
|
|
251
|
+
*/
|
|
66
252
|
containsDecryptedChildren(): boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Determine if the value is editable.
|
|
255
|
+
*
|
|
256
|
+
* @returns If the value is editable.
|
|
257
|
+
*/
|
|
67
258
|
isValueEditable(): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Determine if the key of the parent element is editable.
|
|
261
|
+
*
|
|
262
|
+
* @returns If the parent's key is editable.
|
|
263
|
+
*/
|
|
68
264
|
isParentEditable(): boolean;
|
|
69
265
|
_isKeyLegallyEditable(): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Determine if the key is editable.
|
|
268
|
+
*
|
|
269
|
+
* @returns If the key is editable.
|
|
270
|
+
*/
|
|
70
271
|
isKeyEditable(): boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Is this a field that is used internally by the MongoDB driver or server
|
|
274
|
+
* and not for user consumption?
|
|
275
|
+
*
|
|
276
|
+
* @returns
|
|
277
|
+
*/
|
|
71
278
|
isInternalField(): boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Determine if the element is modified at all.
|
|
281
|
+
*
|
|
282
|
+
* @returns If the element is modified.
|
|
283
|
+
*/
|
|
72
284
|
isModified(): boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Is the element flagged for removal?
|
|
287
|
+
*
|
|
288
|
+
* @returns If the element is flagged for removal.
|
|
289
|
+
*/
|
|
73
290
|
isRemoved(): boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Are any immediate children of this element flagged for removal?
|
|
293
|
+
*
|
|
294
|
+
* @returns If any immediate children of this element are flagged for removal.
|
|
295
|
+
*/
|
|
74
296
|
hasAnyRemovedChild(): boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Elements themselves are not the root.
|
|
299
|
+
*
|
|
300
|
+
* @returns Always false.
|
|
301
|
+
*/
|
|
75
302
|
isRoot(): false;
|
|
303
|
+
/**
|
|
304
|
+
* Flag the element for removal.
|
|
305
|
+
*/
|
|
76
306
|
remove(): void;
|
|
307
|
+
/**
|
|
308
|
+
* Revert the changes to the element.
|
|
309
|
+
*/
|
|
77
310
|
revert(): void;
|
|
311
|
+
/**
|
|
312
|
+
* Expands the target element and optionally its children as well.
|
|
313
|
+
* Document.expand is when we would want to expand the children otherwise we
|
|
314
|
+
* will most expand the element itself.
|
|
315
|
+
*/
|
|
78
316
|
expand(expandChildren?: boolean): void;
|
|
317
|
+
/**
|
|
318
|
+
* Collapses only the target element
|
|
319
|
+
*/
|
|
79
320
|
collapse(): void;
|
|
321
|
+
/**
|
|
322
|
+
* Fire and bubble up the event.
|
|
323
|
+
*
|
|
324
|
+
* @param evt - The event.
|
|
325
|
+
* @paramdata - Optional.
|
|
326
|
+
*/
|
|
80
327
|
_bubbleUp(evt: typeof Events[keyof typeof Events], ...data: BSONArray): void;
|
|
328
|
+
/**
|
|
329
|
+
* Convert this element to an empty object.
|
|
330
|
+
*/
|
|
81
331
|
_convertToEmptyObject(): void;
|
|
332
|
+
/**
|
|
333
|
+
* Convert to an empty array.
|
|
334
|
+
*/
|
|
82
335
|
_convertToEmptyArray(): void;
|
|
336
|
+
/**
|
|
337
|
+
* Is the element empty?
|
|
338
|
+
*
|
|
339
|
+
* @param element - The element to check.
|
|
340
|
+
*
|
|
341
|
+
* @returns If the element is empty.
|
|
342
|
+
*/
|
|
83
343
|
_isElementEmpty(element: Element | undefined | null): boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Generates a sequence of child elements.
|
|
346
|
+
*
|
|
347
|
+
* @param object - The object to generate from.
|
|
348
|
+
*
|
|
349
|
+
* @returns The elements.
|
|
350
|
+
*/
|
|
84
351
|
_generateElements(object: BSONObject | BSONArray): ElementList;
|
|
352
|
+
/**
|
|
353
|
+
* Removes the added elements from the element.
|
|
354
|
+
*/
|
|
85
355
|
_removeAddedElements(): void;
|
|
86
356
|
getVisibleElements(): Element[];
|
|
87
357
|
setMaxVisibleElementsCount(newCount: number): void;
|
|
88
358
|
getTotalVisibleElementsCount(): number;
|
|
89
359
|
private emitVisibleElementsChanged;
|
|
360
|
+
/**
|
|
361
|
+
* @deprecated Use ElementEvents import instead
|
|
362
|
+
*/
|
|
90
363
|
static get Events(): typeof ElementEvents;
|
|
91
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Represents a doubly linked list.
|
|
367
|
+
*/
|
|
92
368
|
export declare class ElementList implements Iterable<Element> {
|
|
93
369
|
private parent;
|
|
94
370
|
private elements;
|
|
@@ -101,10 +377,55 @@ export declare class ElementList implements Iterable<Element> {
|
|
|
101
377
|
every(predicate: (value: Element, index: number, array: Element[]) => unknown): boolean;
|
|
102
378
|
get firstElement(): Element | undefined;
|
|
103
379
|
get lastElement(): Element | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* Insert data after the provided element.
|
|
382
|
+
*
|
|
383
|
+
* @param afterElement - The element to insert after.
|
|
384
|
+
* @param key - The element key.
|
|
385
|
+
* @param value - The element value.
|
|
386
|
+
* @param added - If the element is new.
|
|
387
|
+
*
|
|
388
|
+
* @returns The inserted element.
|
|
389
|
+
*/
|
|
104
390
|
insertAfter(afterElement: Element, key: string | number, value: BSONValue, added?: boolean): Element | undefined;
|
|
391
|
+
/**
|
|
392
|
+
* Insert data before the provided element.
|
|
393
|
+
*
|
|
394
|
+
* @param beforeElement - The element to insert before.
|
|
395
|
+
* @param key - The element key.
|
|
396
|
+
* @param value - The element value.
|
|
397
|
+
* @param added - If the element is new.
|
|
398
|
+
*
|
|
399
|
+
* @returns The inserted element.
|
|
400
|
+
*/
|
|
105
401
|
insertBefore(beforeElement: Element, key: string | number, value: BSONValue, added?: boolean): Element | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* Insert data at the beginning of the list.
|
|
404
|
+
*
|
|
405
|
+
* @param key - The element key.
|
|
406
|
+
* @param value - The element value.
|
|
407
|
+
* @param added - If the element is new.
|
|
408
|
+
*
|
|
409
|
+
* @returns The data element.
|
|
410
|
+
*/
|
|
106
411
|
insertBeginning(key: string | number, value: BSONValue, added?: boolean): Element;
|
|
412
|
+
/**
|
|
413
|
+
* Insert data at the end of the list.
|
|
414
|
+
*
|
|
415
|
+
* @param key - The element key.
|
|
416
|
+
* @param value - The element value.
|
|
417
|
+
* @param added - If the element is new.
|
|
418
|
+
*
|
|
419
|
+
* @returns The data element.
|
|
420
|
+
*/
|
|
107
421
|
insertEnd(key: string | number, value: BSONValue, added?: boolean): Element;
|
|
422
|
+
/**
|
|
423
|
+
* Remove the element from the list.
|
|
424
|
+
*
|
|
425
|
+
* @param removeElement - The element to remove.
|
|
426
|
+
*
|
|
427
|
+
* @returns The list with the element removed.
|
|
428
|
+
*/
|
|
108
429
|
remove(removeElement: Element): this;
|
|
109
430
|
findNext(el: Element): Element | undefined;
|
|
110
431
|
findPrevious(el: Element): Element | undefined;
|
package/dist/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAKjE,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhE,OAAO,EAAkB,aAAa,EAAE,MAAM,GAAG,CAAC;AAElD,eAAO,MAAM,WAAW,4BAA4B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,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