@fluid-experimental/property-properties 0.59.1001-62246 → 0.59.2000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/properties/abstractStaticCollectionProperty.d.ts +5 -5
  2. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  3. package/dist/properties/abstractStaticCollectionProperty.js +3 -3
  4. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  5. package/dist/properties/intProperties.d.ts +4 -4
  6. package/dist/properties/intProperties.d.ts.map +1 -1
  7. package/dist/properties/intProperties.js +2 -2
  8. package/dist/properties/intProperties.js.map +1 -1
  9. package/dist/propertyUtils.d.ts +1 -1
  10. package/dist/propertyUtils.js +1 -1
  11. package/dist/propertyUtils.js.map +1 -1
  12. package/dist/test/tsconfig.tsbuildinfo +6 -6
  13. package/lib/containerSerializer.d.ts +27 -0
  14. package/lib/containerSerializer.d.ts.map +1 -0
  15. package/lib/enableValidations.d.ts +15 -0
  16. package/lib/enableValidations.d.ts.map +1 -0
  17. package/lib/index.d.ts +25 -0
  18. package/lib/index.d.ts.map +1 -0
  19. package/lib/properties/abstractStaticCollectionProperty.d.ts +153 -0
  20. package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -0
  21. package/lib/properties/abstractStaticCollectionProperty.js +3 -3
  22. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  23. package/lib/properties/arrayProperty.d.ts +315 -0
  24. package/lib/properties/arrayProperty.d.ts.map +1 -0
  25. package/lib/properties/baseProperty.d.ts +594 -0
  26. package/lib/properties/baseProperty.d.ts.map +1 -0
  27. package/lib/properties/boolProperty.d.ts +12 -0
  28. package/lib/properties/boolProperty.d.ts.map +1 -0
  29. package/lib/properties/containerProperty.d.ts +102 -0
  30. package/lib/properties/containerProperty.d.ts.map +1 -0
  31. package/lib/properties/enumArrayProperty.d.ts +60 -0
  32. package/lib/properties/enumArrayProperty.d.ts.map +1 -0
  33. package/lib/properties/enumProperty.d.ts +36 -0
  34. package/lib/properties/enumProperty.d.ts.map +1 -0
  35. package/lib/properties/floatProperties.d.ts +32 -0
  36. package/lib/properties/floatProperties.d.ts.map +1 -0
  37. package/lib/properties/index.d.ts +29 -0
  38. package/lib/properties/index.d.ts.map +1 -0
  39. package/lib/properties/indexedCollectionBaseProperty.d.ts +74 -0
  40. package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -0
  41. package/lib/properties/intProperties.d.ts +132 -0
  42. package/lib/properties/intProperties.d.ts.map +1 -0
  43. package/lib/properties/intProperties.js +2 -2
  44. package/lib/properties/intProperties.js.map +1 -1
  45. package/lib/properties/lazyLoadedProperties.d.ts +14 -0
  46. package/lib/properties/lazyLoadedProperties.d.ts.map +1 -0
  47. package/lib/properties/mapProperty.d.ts +84 -0
  48. package/lib/properties/mapProperty.d.ts.map +1 -0
  49. package/lib/properties/namedNodeProperty.d.ts +25 -0
  50. package/lib/properties/namedNodeProperty.d.ts.map +1 -0
  51. package/lib/properties/namedProperty.d.ts +20 -0
  52. package/lib/properties/namedProperty.d.ts.map +1 -0
  53. package/lib/properties/nodeProperty.d.ts +17 -0
  54. package/lib/properties/nodeProperty.d.ts.map +1 -0
  55. package/lib/properties/primitiveTypeCasts.d.ts +15 -0
  56. package/lib/properties/primitiveTypeCasts.d.ts.map +1 -0
  57. package/lib/properties/referenceArrayProperty.d.ts +47 -0
  58. package/lib/properties/referenceArrayProperty.d.ts.map +1 -0
  59. package/lib/properties/referenceMapProperty.d.ts +46 -0
  60. package/lib/properties/referenceMapProperty.d.ts.map +1 -0
  61. package/lib/properties/referenceProperty.d.ts +59 -0
  62. package/lib/properties/referenceProperty.d.ts.map +1 -0
  63. package/lib/properties/setProperty.d.ts +69 -0
  64. package/lib/properties/setProperty.d.ts.map +1 -0
  65. package/lib/properties/stringProperty.d.ts +39 -0
  66. package/lib/properties/stringProperty.d.ts.map +1 -0
  67. package/lib/properties/uintProperties.d.ts +47 -0
  68. package/lib/properties/uintProperties.d.ts.map +1 -0
  69. package/lib/properties/valueArrayProperty.d.ts +216 -0
  70. package/lib/properties/valueArrayProperty.d.ts.map +1 -0
  71. package/lib/properties/valueMapProperty.d.ts +224 -0
  72. package/lib/properties/valueMapProperty.d.ts.map +1 -0
  73. package/lib/properties/valueProperty.d.ts +50 -0
  74. package/lib/properties/valueProperty.d.ts.map +1 -0
  75. package/lib/propertyFactory.d.ts +3 -0
  76. package/lib/propertyFactory.d.ts.map +1 -0
  77. package/lib/propertyTemplate.d.ts +137 -0
  78. package/lib/propertyTemplate.d.ts.map +1 -0
  79. package/lib/propertyTemplateWrapper.d.ts +74 -0
  80. package/lib/propertyTemplateWrapper.d.ts.map +1 -0
  81. package/lib/propertyUtils.d.ts +15 -0
  82. package/lib/propertyUtils.d.ts.map +1 -0
  83. package/lib/propertyUtils.js +1 -1
  84. package/lib/propertyUtils.js.map +1 -1
  85. package/package.json +8 -5
  86. package/src/index.d.ts +3 -3
@@ -0,0 +1,315 @@
1
+ export class ArrayProperty extends AbstractStaticCollectionProperty {
2
+ /**
3
+ * Default constructor for ArrayProperty
4
+ * @param {Object} [in_params] - the parameters
5
+ * @param {Number} [in_params.length = 0] the length of the array, if applicable
6
+ * @param {string} [in_scope] - The scope in which the property typeid is defined
7
+ * @protected
8
+ */
9
+ protected constructor();
10
+ _scope: string;
11
+ /**
12
+ * Insert into the array at a given position.
13
+ * It will not overwrite the existing values, it will push them to the right.
14
+ * @param {number} in_position target index
15
+ * @param {*} in_value inserted value or property
16
+ * @throws if in_position is smaller than zero, larger than the length of the array or not a number.
17
+ * @throws if trying to insert a property that already has a parent.
18
+ * @throws if trying to modify a referenced property.
19
+ * @throws if trying to insert a property that is a root property
20
+ */
21
+ insert(in_position: number, in_value: any): void;
22
+ /**
23
+ * Add one or more values at the end of the array
24
+ * @param {Array<property-properties.BaseProperty>|property-properties.BaseProperty|*|Array<*>} in_values
25
+ * the item or items to be pushed (either properties or values). If an array is passed, .push
26
+ * will be called on each item in the array.
27
+ * @throws if trying to push a property that is a root property
28
+ * @return {number} new length of the array
29
+ */
30
+ push(in_values: any): number;
31
+ /**
32
+ * Add elements to the end of the queue (array)
33
+ */
34
+ enqueue(...args: any[]): number;
35
+ /**
36
+ * Add a value at the front of the array or letters to the beginning of a string (for StringProperty)
37
+ * It can also add multiple values to an array if you pass in an array of values.
38
+ * @param {Array<*>|*|Array<property-properties.BaseProperty>|property-properties.BaseProperty} in_values the values
39
+ * or properties to be pushed
40
+ * @throws if trying to insert a property that already has a parent.
41
+ * @throws if trying to insert a root property
42
+ * @throws if trying to modify a referenced property.
43
+ * @return {number} new length of the array
44
+ */
45
+ unshift(in_values: any): number;
46
+ /**
47
+ * Removes an element of the array (or a letter in a StringProperty) and shifts remaining elements to the left
48
+ * E.g. [1, 2, 3] .remove(1) => [1, 3]
49
+ * E.g. (StringProperty) 'ABCDE' .remove(1) => 'ACDE'
50
+ * @param {number} in_position the index that will be removed
51
+ * @throws if in_position is not a number
52
+ * @throws if trying to remove something that does not exist
53
+ * @throws if trying to remove an item with a parent
54
+ * @return {property-properties.BaseProperty | * } the value that was removed.
55
+ */
56
+ remove(in_position: number): any;
57
+ /**
58
+ * Removes the last element of the array or the last letter of a string (for StringProperty)
59
+ * @throws if trying to modify a referenced property
60
+ * @return {property-properties.BaseProperty|*} deleted element.
61
+ */
62
+ pop(): any;
63
+ /**
64
+ * Removes an element from the front of the array or a letter from the beginning of a string (for StringProperty)
65
+ * @return {*|property-properties.BaseProperty} the element removed.
66
+ */
67
+ shift(): any | any;
68
+ /**
69
+ * Removes elements from the front of the queue (array)
70
+ */
71
+ dequeue(): any;
72
+ /**
73
+ * Change an existing element of the array. This will overwrite an existing element.
74
+ * E.g. [1, 2, 3] .set(1, 8) => [1, 8, 3]
75
+ * @param {number} in_position the target index
76
+ * @param {*} in_value the new property or value
77
+ * @throws if in_position is not a number
78
+ * @throws if in_position is smaller than zero
79
+ */
80
+ set(in_position: number, in_value: any): void;
81
+ /**
82
+ * @param {Array<*>|Object} in_values an array or object containing the values to be set.
83
+ * @see {setValues}
84
+ */
85
+ _setValuesInternal(in_values: Array<any> | any): void;
86
+ /**
87
+ * Deletes all values from an array
88
+ */
89
+ clear(): void;
90
+ /**
91
+ * Private helper function to update the internal dirty and pending changes
92
+ * is overwritten by StringProperty
93
+ *
94
+ * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply
95
+ * @private
96
+ */
97
+ private _updateChanges;
98
+ /**
99
+ * Returns the pending changeset for this object
100
+ * @return {property-properties.SerializedChangeSet} The pending changes
101
+ */
102
+ _getPendingChanges(): any;
103
+ /**
104
+ * Returns the dirty changeset for this object
105
+ * @return {property-properties.SerializedChangeSet} The dirty changes
106
+ */
107
+ _getDirtyChanges(): any;
108
+ /**
109
+ * Sets the pending and dirty changesets
110
+ *
111
+ * @param {property-properties.SerializedChangeSet|undefined|null} in_pending
112
+ * The pending changeset. If null is passed, no change will be
113
+ * applied. undefined indicates that the changes should be reset
114
+ * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty
115
+ * The dirty changeset. If null is passed, no change will be
116
+ * applied. undefined indicates that the changes should be reset
117
+ */
118
+ _setChanges(in_pending: any, in_dirty: any): void;
119
+ /**
120
+ * Inserts the content of a given array into the array property
121
+ * It will not overwrite the existing values but push them to the right instead.
122
+ * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]
123
+ * @param {number} in_offset target index
124
+ * @param {Array<*>} in_array the array to be inserted
125
+ * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.
126
+ * @throws if trying to insert a property that already has a parent.
127
+ * @throws if trying to modify a referenced property.
128
+ * @throws if trying to insert a property that is not an array.
129
+ * @throws if trying to insert a root property.
130
+ */
131
+ insertRange(in_offset: number, in_array: Array<any>): void;
132
+ /**
133
+ * inserts the content of a given array, but doesn't dirty the property
134
+ * this is useful for batch changes
135
+ * @param {number} in_offset target index
136
+ * @param {Array<*>} in_array the array to be inserted
137
+ * @param {Boolean=} [in_setParents=true] If true, set parent of inserted properties.
138
+ * If false, caller has already set parents.
139
+ * @private
140
+ */
141
+ private _insertRangeWithoutDirtying;
142
+ /**
143
+ * Removes a given number of elements from the array property (or given number of letters from a StringProperty)
144
+ * and shifts remaining values to the left.
145
+ * E.g. [1, 2, 3, 4, 5] .removeRange(1, 3) => [1, 5]
146
+ * @param {number} in_offset target start index
147
+ * @param {number} in_deleteCount number of elements to be deleted
148
+ * @throws if in_offset is not a number
149
+ * @throws if in_deleteCount is not a number
150
+ * @throws if trying to remove an item with a parent
151
+ * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array
152
+ * @return {Array<*>| Array<property-properties.BaseProperty>} an array containing the values or
153
+ * properties removed.
154
+ */
155
+ removeRange(in_offset: number, in_deleteCount: number): Array<any> | Array<any>;
156
+ /**
157
+ * removes a given number of elements from the array property, and ensures, if this is not
158
+ * a primitive array, that any existing properties have their parent pointer cleared.
159
+ * @param {number} in_offset target start index
160
+ * @param {number} in_deleteCount number of elements to be deleted
161
+ * @private
162
+ */
163
+ private _clearRange;
164
+ /**
165
+ * removes a given number of elements from the array property, but doesn't dirty the property
166
+ * this is useful for batch changes
167
+ * @param {number} in_offset target start index
168
+ * @param {number} in_deleteCount number of elements to be deleted
169
+ * @private
170
+ */
171
+ private _removeRangeWithoutDirtying;
172
+ /**
173
+ * Sets the array properties elements to the content of the given array
174
+ * All changed elements must already exist. This will overwrite existing elements.
175
+ * E.g. [1, 2, 3, 4, 5] .setRange(1, [7, 8]) => [1, 7, 8, 4, 5]
176
+ * @param {number} in_offset target start index
177
+ * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set
178
+ * @throws if in_offset is not a number
179
+ * @throws if in_offset is smaller than zero or higher than the length of the array
180
+ */
181
+ setRange(in_offset: number, in_array: any): void;
182
+ /**
183
+ * sets the array properties elements to the content of the given array
184
+ * all changed elements must already exist. This version doesn't dirty the property,
185
+ * which is useful for batch changes
186
+ * @param {number} in_offset target start index
187
+ * @param {Array<*>} in_array contains the elements to be set
188
+ */
189
+ _setRangeWithoutDirtying(in_offset: number, in_array: Array<any>): void;
190
+ /**
191
+ * sets the array properties elements to the content of the given array
192
+ * all changed elements must already exist. This version doesn't dirty the property,
193
+ * which is useful for batch changes
194
+ * @param {number} in_offset target start index
195
+ * @param {Array<*>} in_array contains the elements to be set
196
+ */
197
+ _modifyRangeWithoutDirtying(in_offset: number, in_array: Array<any>): void;
198
+ /**
199
+ * @return {Number} the current length of the array
200
+ */
201
+ getLength(): number;
202
+ /**
203
+ * Internal helper function that implements the deserialize algorithm for an array of named properties.
204
+ *
205
+ * @param {property-properties.SerializedChangeSet} in_serializedObj - The serialized changeset to apply. This
206
+ * has to be a normalized change-set (only containing inserts. Removes and Modifies are forbidden).
207
+ * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view
208
+ * and trigger a modified event there. When batching updates, this
209
+ * can be prevented via this flag.
210
+ * @return {property-properties.SerializedChangeSet} ChangeSet with the changes that actually were performed during the
211
+ * deserialization
212
+ */
213
+ _deserializeNamedPropertyArray(in_serializedObj: any, in_reportToView?: boolean): any;
214
+ /**
215
+ * Function to deserialize special primitive types.
216
+ * Some primitive types (e.g. Int64, which is not natively supported by javascript) require
217
+ * special treatment on deserialization. For supported types, we can just return the input here.
218
+ *
219
+ * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized
220
+ * @return {*} the deserialized value
221
+ */
222
+ _deserializeValue(in_serializedObj: any): any;
223
+ /**
224
+ * Function to serialize special primitive types.
225
+ * Some primitive types (e.g. Int64, which is not natively supported by javascript) require
226
+ * special treatment on serialization. For supported types, we can just return the input here.
227
+ *
228
+ * @param {*} in_obj - The object to be serialized
229
+ * @return {property-properties.SerializedChangeSet} the serialized object
230
+ */
231
+ _serializeValue(in_obj: any): any;
232
+ /**
233
+ * Function to serialize arrays of special primitive types.
234
+ * Some primitive types (e.g. Int64, which is not natively supported by javascript) require
235
+ * special treatment on serialization. For supported types, we can just return the input here.
236
+ *
237
+ * @param {Array} in_array - The array of special objects to be serialized
238
+ * @return {Array<property-properties.SerializedChangeSet>} the serialized object
239
+ */
240
+ _serializeArray(in_array: any[]): Array<any>;
241
+ /**
242
+ * Function to deserialize arrays of special primitive types.
243
+ * Some primitive types (e.g. Int64, which is not natively supported by javascript) require
244
+ * special treatment on deserialization. For supported types, we can just return the input here.
245
+ *
246
+ * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object
247
+ * @return {Array} in_array - The array of special objects that were deserialized
248
+ */
249
+ _deserializeArray(in_serializedObj: any): any[];
250
+ _getChangesetForCustomTypeArray(in_basePropertyChangeset: any, in_dirtinessType: any, in_includeReferencedRepositories: any): {
251
+ remove: any;
252
+ modify: any[];
253
+ insert: any[];
254
+ };
255
+ /**
256
+ * Creates and initializes the data array
257
+ * @param {Number} in_length the initial length of the array
258
+ */
259
+ _dataArrayCreate(in_length: number): void;
260
+ _dataArrayRef: UniversalDataArray;
261
+ /**
262
+ * Returns the length of the data array
263
+ * @return {Number} The length
264
+ */
265
+ _dataArrayGetLength(): number;
266
+ /**
267
+ * Returns the data array's internal buffer
268
+ * @return {Array} The buffer
269
+ */
270
+ _dataArrayGetBuffer(): any[];
271
+ /**
272
+ * Returns an entry from the data array
273
+ * @param {Number} in_index - Position in the array
274
+ *
275
+ * @return {*} The value at index in_index
276
+ */
277
+ _dataArrayGetValue(in_index: number): any;
278
+ /**
279
+ * Sets an entry in the data array
280
+ * @param {Number} in_index - Position in the array
281
+ * @param {*} in_value - The new value at index in_index
282
+ */
283
+ _dataArraySetValue(in_index: number, in_value: any): void;
284
+ /**
285
+ * Set the array to the given new array
286
+ * @param {Array} in_newArray - The new contents of the array
287
+ */
288
+ _dataArrayDeserialize(in_newArray: any[]): void;
289
+ /**
290
+ * Inserts a range into the data array
291
+ * @param {Number} in_position - Position at which the insert should be done
292
+ * @param {Array} in_range - The array to insert
293
+ */
294
+ _dataArrayInsertRange(in_position: number, in_range: any[]): void;
295
+ /**
296
+ * Removes a range from the data array
297
+ * @param {Number} in_position - Position at which to start the removal
298
+ * @param {Number} in_length - The number of entries to remove
299
+ */
300
+ _dataArrayRemoveRange(in_position: number, in_length: number): void;
301
+ /**
302
+ * Overwrites a range in the data array
303
+ * @param {Number} in_position - Position at which to start the removal
304
+ * @param {Array} in_range - The array to overwrite
305
+ */
306
+ _dataArraySetRange(in_position: number, in_range: any[]): void;
307
+ set length(arg: number);
308
+ /**
309
+ * returns the length of the current array property
310
+ */
311
+ get length(): number;
312
+ }
313
+ import { AbstractStaticCollectionProperty } from "./abstractStaticCollectionProperty";
314
+ import { UniversalDataArray } from "@fluid-experimental/property-common/dist/datastructures/dataArray";
315
+ //# sourceMappingURL=arrayProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/arrayProperty.js"],"names":[],"mappings":"AA6IA;IACI;;;;;;OAMG;IACH,wBAaC;IAJO,eAAsB;IAqD9B;;;;;;;;;OASG;IACH,oBAPW,MAAM,uBAShB;IAaD;;;;;;;OAOG;IACH,sBAFY,MAAM,CASjB;IAED;;OAEG;IACH,gCAEC;IAED;;;;;;;;;OASG;IACH,yBAFY,MAAM,CASjB;IAED;;;;;;;;;OASG;IACH,oBANW,MAAM,OAUhB;IAED;;;;OAIG;IACH,WASC;IAED;;;OAGG;IACH,SAFY,SAAU,CAUrB;IAED;;OAEG;IACH,eAEC;IAED;;;;;;;OAOG;IACH,iBALW,MAAM,uBAUhB;IAwCD;;;OAGG;IACH,8BAHW,UAAQ,MAAO,QA8BzB;IAuBD;;OAEG;IACH,cAIC;IAYD;;;;;;OAMG;IACH,uBAUC;IAED;;;OAGG;IACH,0BAEC;IAED;;;OAGG;IACH,wBAEC;IAED;;;;;;;;;OASG;IACH,kDAwCC;IAoCD;;;;;;;;;;;OAWG;IACH,uBARW,MAAM,YACN,UAAQ,QAsBlB;IAED;;;;;;;;OAQG;IACH,oCAgCC;IAED;;;;;;;;;;;;OAYG;IACH,uBATW,MAAM,kBACN,MAAM,GAKL,UAAQ,GAAE,UAAc,CAkBnC;IAED;;;;;;OAMG;IACH,oBAYC;IAED;;;;;;OAMG;IACH,oCAQC;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,uBAmBhB;IAED;;;;;;OAMG;IACH,oCAHW,MAAM,YACN,UAAQ,QAIlB;IAED;;;;;;OAMG;IACH,uCAHW,MAAM,YACN,UAAQ,QAmClB;IA4HD;;OAEG;IACH,oBAEC;IAkJD;;;;;;;;;;OAUG;IACH,wEANW,OAAO,OA+JjB;IAED;;;;;;;OAOG;IACH,8CAEC;IAED;;;;;;;OAOG;IACH,kCAGC;IAED;;;;;;;OAOG;IACH,kCAFY,UAAc,CAezB;IAED;;;;;;;OAOG;IACH,gDAEC;IAyGD;;;;MA4GC;IAmJD;;;OAGG;IACH,0CASC;IANG,kCAAsD;IAQ1D;;;OAGG;IACH,8BAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;;;OAKG;IACH,0CAEC;IAED;;;;OAIG;IACH,0DAEC;IAED;;;OAGG;IACH,gDAEC;IAED;;;;OAIG;IACH,kEAEC;IAED;;;;OAIG;IACH,oEAEC;IAED;;;;OAIG;IACH,+DAEC;IAyBD,wBAEC;IARD;;OAEG;IACH,qBAEC;CAIJ"}