vis-data 7.1.9 → 8.0.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/declarations/data-interface.d.ts +14 -60
- package/declarations/data-interface.d.ts.map +1 -1
- package/declarations/data-pipe.d.ts +5 -13
- package/declarations/data-pipe.d.ts.map +1 -1
- package/declarations/data-set-check.d.ts +2 -3
- package/declarations/data-set-check.d.ts.map +1 -1
- package/declarations/data-set-part.d.ts +1 -2
- package/declarations/data-set-part.d.ts.map +1 -1
- package/declarations/data-set.d.ts +18 -32
- package/declarations/data-set.d.ts.map +1 -1
- package/declarations/data-stream.d.ts +1 -19
- package/declarations/data-stream.d.ts.map +1 -1
- package/declarations/data-view-check.d.ts +2 -3
- package/declarations/data-view-check.d.ts.map +1 -1
- package/declarations/data-view.d.ts +13 -19
- package/declarations/data-view.d.ts.map +1 -1
- package/declarations/entry-esnext.d.ts +8 -8
- package/declarations/entry-esnext.d.ts.map +1 -1
- package/declarations/entry-peer.d.ts +1 -1
- package/declarations/entry-peer.d.ts.map +1 -1
- package/declarations/entry-standalone.d.ts +1 -1
- package/declarations/entry-standalone.d.ts.map +1 -1
- package/declarations/index.d.ts +4 -4
- package/declarations/index.d.ts.map +1 -1
- package/declarations/queue.d.ts +1 -8
- package/declarations/queue.d.ts.map +1 -1
- package/dist/esm.js +9503 -8599
- package/dist/esm.js.map +1 -1
- package/dist/umd.js +13772 -12868
- package/dist/umd.js.map +1 -1
- package/esnext/esm/vis-data.js +1957 -2000
- package/esnext/esm/vis-data.js.map +1 -1
- package/esnext/esm/vis-data.min.js +3 -3
- package/esnext/esm/vis-data.min.js.map +1 -1
- package/esnext/esm/vis-data.min.mjs +27 -0
- package/esnext/esm/vis-data.min.mjs.map +1 -0
- package/esnext/esm/vis-data.mjs +2005 -0
- package/esnext/esm/vis-data.mjs.map +1 -0
- package/esnext/umd/vis-data.cjs +2005 -0
- package/esnext/umd/vis-data.cjs.map +1 -0
- package/esnext/umd/vis-data.js +1970 -2026
- package/esnext/umd/vis-data.js.map +1 -1
- package/esnext/umd/vis-data.min.cjs +27 -0
- package/esnext/umd/vis-data.min.cjs.map +1 -0
- package/esnext/umd/vis-data.min.js +3 -3
- package/esnext/umd/vis-data.min.js.map +1 -1
- package/package.json +159 -31
- package/peer/esm/vis-data.js +9407 -8443
- package/peer/esm/vis-data.js.map +1 -1
- package/peer/esm/vis-data.min.js +29 -4
- package/peer/esm/vis-data.min.js.map +1 -1
- package/peer/esm/vis-data.min.mjs +59 -0
- package/peer/esm/vis-data.min.mjs.map +1 -0
- package/peer/esm/vis-data.mjs +13804 -0
- package/peer/esm/vis-data.mjs.map +1 -0
- package/peer/umd/vis-data.cjs +13818 -0
- package/peer/umd/vis-data.cjs.map +1 -0
- package/peer/umd/vis-data.js +13762 -12798
- package/peer/umd/vis-data.js.map +1 -1
- package/peer/umd/vis-data.min.cjs +59 -0
- package/peer/umd/vis-data.min.cjs.map +1 -0
- package/peer/umd/vis-data.min.js +34 -9
- package/peer/umd/vis-data.min.js.map +1 -1
- package/standalone/esm/vis-data.js +9407 -8443
- package/standalone/esm/vis-data.js.map +1 -1
- package/standalone/esm/vis-data.min.js +29 -4
- package/standalone/esm/vis-data.min.js.map +1 -1
- package/standalone/esm/vis-data.min.mjs +59 -0
- package/standalone/esm/vis-data.min.mjs.map +1 -0
- package/standalone/esm/vis-data.mjs +13804 -0
- package/standalone/esm/vis-data.mjs.map +1 -0
- package/standalone/umd/vis-data.cjs +13818 -0
- package/standalone/umd/vis-data.cjs.map +1 -0
- package/standalone/umd/vis-data.js +13762 -12798
- package/standalone/umd/vis-data.js.map +1 -1
- package/standalone/umd/vis-data.min.cjs +59 -0
- package/standalone/umd/vis-data.min.cjs.map +1 -0
- package/standalone/umd/vis-data.min.js +34 -9
- package/standalone/umd/vis-data.min.js.map +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { DataInterface, DataInterfaceForEachOptions, DataInterfaceGetIdsOptions, DataInterfaceGetOptions, DataInterfaceGetOptionsArray, DataInterfaceGetOptionsObject, DataInterfaceMapOptions, DeepPartial, FullItem, Id, PartItem, UpdateItem } from "./data-interface";
|
|
2
|
-
import { Queue, QueueOptions } from "./queue";
|
|
3
|
-
import { DataSetPart } from "./data-set-part";
|
|
4
|
-
import { DataStream } from "./data-stream";
|
|
1
|
+
import { type DataInterface, type DataInterfaceForEachOptions, type DataInterfaceGetIdsOptions, type DataInterfaceGetOptions, type DataInterfaceGetOptionsArray, type DataInterfaceGetOptionsObject, type DataInterfaceMapOptions, type DeepPartial, type FullItem, type Id, type PartItem, type UpdateItem } from "./data-interface.ts";
|
|
2
|
+
import { Queue, type QueueOptions } from "./queue.ts";
|
|
3
|
+
import { DataSetPart } from "./data-set-part.ts";
|
|
4
|
+
import { DataStream } from "./data-stream.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Initial DataSet configuration object.
|
|
7
|
-
*
|
|
8
7
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
9
8
|
*/
|
|
10
9
|
export interface DataSetInitialOptions<IdProp extends string> {
|
|
@@ -51,15 +50,15 @@ export interface DataSetOptions {
|
|
|
51
50
|
* // add items
|
|
52
51
|
* // note that the data items can contain different properties and data formats
|
|
53
52
|
* data.add([
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
53
|
+
* {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
|
|
54
|
+
* {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
|
|
55
|
+
* {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
|
|
56
|
+
* {id: 4, text: 'item 4'}
|
|
58
57
|
* ]);
|
|
59
58
|
*
|
|
60
59
|
* // subscribe to any change in the DataSet
|
|
61
60
|
* data.on('*', function (event, properties, senderId) {
|
|
62
|
-
*
|
|
61
|
+
* console.log('event', event, properties);
|
|
63
62
|
* });
|
|
64
63
|
*
|
|
65
64
|
* // update an existing item
|
|
@@ -78,13 +77,12 @@ export interface DataSetOptions {
|
|
|
78
77
|
*
|
|
79
78
|
* // retrieve a filtered subset of the data
|
|
80
79
|
* var items = data.get({
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
80
|
+
* filter: function (item) {
|
|
81
|
+
* return item.group == 1;
|
|
82
|
+
* }
|
|
84
83
|
* });
|
|
85
84
|
* console.log('filtered items', items);
|
|
86
85
|
* ```
|
|
87
|
-
*
|
|
88
86
|
* @typeParam Item - Item type that may or may not have an id.
|
|
89
87
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
90
88
|
*/
|
|
@@ -110,7 +108,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
110
108
|
constructor(data: Item[], options?: DataSetInitialOptions<IdProp>);
|
|
111
109
|
/**
|
|
112
110
|
* Set new options.
|
|
113
|
-
*
|
|
114
111
|
* @param options - The new options.
|
|
115
112
|
*/
|
|
116
113
|
setOptions(options?: DataSetOptions): void;
|
|
@@ -127,14 +124,13 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
127
124
|
*
|
|
128
125
|
* // add items
|
|
129
126
|
* const ids = data.add([
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
127
|
+
* { id: 1, text: 'item 1' },
|
|
128
|
+
* { id: 2, text: 'item 2' },
|
|
129
|
+
* { text: 'item without an id' }
|
|
133
130
|
* ])
|
|
134
131
|
*
|
|
135
132
|
* console.log(ids) // [1, 2, '<UUIDv4>']
|
|
136
133
|
* ```
|
|
137
|
-
*
|
|
138
134
|
* @param data - Items to be added (ids will be generated if missing).
|
|
139
135
|
* @param senderId - Sender id.
|
|
140
136
|
* @returns addedIds - Array with the ids (generated if not present) of the added items.
|
|
@@ -143,7 +139,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
143
139
|
add(data: Item | Item[], senderId?: Id | null): (string | number)[];
|
|
144
140
|
/**
|
|
145
141
|
* Update existing items. When an item does not exist, it will be created.
|
|
146
|
-
*
|
|
147
142
|
* @remarks
|
|
148
143
|
* The provided properties will be merged in the existing item. When an item does not exist, it will be created.
|
|
149
144
|
*
|
|
@@ -178,7 +173,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
178
173
|
update(data: DeepPartial<Item> | DeepPartial<Item>[], senderId?: Id | null): Id[];
|
|
179
174
|
/**
|
|
180
175
|
* Update existing items. When an item does not exist, an error will be thrown.
|
|
181
|
-
*
|
|
182
176
|
* @remarks
|
|
183
177
|
* The provided properties will be deeply merged into the existing item.
|
|
184
178
|
* When an item does not exist (id not present in the data set or absent), an error will be thrown and nothing will be changed.
|
|
@@ -248,7 +242,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
248
242
|
private _filterFields;
|
|
249
243
|
/**
|
|
250
244
|
* Sort the provided array with items.
|
|
251
|
-
*
|
|
252
245
|
* @param items - Items to be sorted in place.
|
|
253
246
|
* @param order - A field name or custom sort function.
|
|
254
247
|
* @typeParam T - The type of the items in the items array.
|
|
@@ -265,9 +258,9 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
265
258
|
* ```javascript
|
|
266
259
|
* // create a DataSet
|
|
267
260
|
* const data = new vis.DataSet([
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
261
|
+
* { id: 1, text: 'item 1' },
|
|
262
|
+
* { id: 2, text: 'item 2' },
|
|
263
|
+
* { id: 3, text: 'item 3' }
|
|
271
264
|
* ])
|
|
272
265
|
*
|
|
273
266
|
* // remove items
|
|
@@ -275,7 +268,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
275
268
|
*
|
|
276
269
|
* console.log(ids) // [2, 3]
|
|
277
270
|
* ```
|
|
278
|
-
*
|
|
279
271
|
* @param id - One or more items or ids of items to be removed.
|
|
280
272
|
* @param senderId - Sender id.
|
|
281
273
|
* @returns The ids of the removed items.
|
|
@@ -283,7 +275,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
283
275
|
remove(id: Id | Item | (Id | Item)[], senderId?: Id | null): Id[];
|
|
284
276
|
/**
|
|
285
277
|
* Remove an item by its id or reference.
|
|
286
|
-
*
|
|
287
278
|
* @param id - Id of an item or the item itself.
|
|
288
279
|
* @returns The removed item if removed, null otherwise.
|
|
289
280
|
*/
|
|
@@ -292,21 +283,18 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
292
283
|
* Clear the entire data set.
|
|
293
284
|
*
|
|
294
285
|
* After the items are removed, the {@link DataSet} will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
|
|
295
|
-
*
|
|
296
286
|
* @param senderId - Sender id.
|
|
297
287
|
* @returns removedIds - The ids of all removed items.
|
|
298
288
|
*/
|
|
299
289
|
clear(senderId?: Id | null): Id[];
|
|
300
290
|
/**
|
|
301
291
|
* Find the item with maximum value of a specified field.
|
|
302
|
-
*
|
|
303
292
|
* @param field - Name of the property that should be searched for max value.
|
|
304
293
|
* @returns Item containing max value, or null if no items.
|
|
305
294
|
*/
|
|
306
295
|
max(field: keyof Item): Item | null;
|
|
307
296
|
/**
|
|
308
297
|
* Find the item with minimum value of a specified field.
|
|
309
|
-
*
|
|
310
298
|
* @param field - Name of the property that should be searched for min value.
|
|
311
299
|
* @returns Item containing min value, or null if no items.
|
|
312
300
|
*/
|
|
@@ -315,7 +303,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
315
303
|
distinct(prop: string): unknown[];
|
|
316
304
|
/**
|
|
317
305
|
* Add a single item. Will fail when an item with the same id already exists.
|
|
318
|
-
*
|
|
319
306
|
* @param item - A new item to be added.
|
|
320
307
|
* @returns Added item's id. An id is generated when it is not present in the item.
|
|
321
308
|
*/
|
|
@@ -323,7 +310,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
323
310
|
/**
|
|
324
311
|
* Update a single item: merge with existing item.
|
|
325
312
|
* Will fail when the item has no id, or when there does not exist an item with the same id.
|
|
326
|
-
*
|
|
327
313
|
* @param update - The new item
|
|
328
314
|
* @returns The id of the updated item.
|
|
329
315
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-set.d.ts","sourceRoot":"","sources":["../src/data-set.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"data-set.d.ts","sourceRoot":"","sources":["../src/data-set.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAE5B,KAAK,WAAW,EAEhB,KAAK,QAAQ,EACb,KAAK,EAAE,EAEP,KAAK,QAAQ,EACb,KAAK,UAAU,EAEhB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM,SAAS,MAAM;IAC1D;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;CAC9B;AACD,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,KAAK,CAAC;CACtC;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,qBAAa,OAAO,CAChB,I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AAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAEzD;IACD,IAAW,cAAc,IAAI,MAAM,CAElC;IACD,IAAW,eAAe,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAE1D;IACD,IAAW,aAAa,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAE7C;IACD,IAAW,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,EAE7C;CAEF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Id } from "./data-interface";
|
|
1
|
+
import type { Id } from "./data-interface.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Data stream
|
|
4
|
-
*
|
|
5
4
|
* @remarks
|
|
6
5
|
* {@link DataStream} offers an always up to date stream of items from a {@link DataSet} or {@link DataView}.
|
|
7
6
|
* That means that the stream is evaluated at the time of iteration, conversion to another data type or when {@link cache} is called, not when the {@link DataStream} was created.
|
|
@@ -12,7 +11,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
12
11
|
private readonly _pairs;
|
|
13
12
|
/**
|
|
14
13
|
* Create a new data stream.
|
|
15
|
-
*
|
|
16
14
|
* @param pairs - The id, item pairs.
|
|
17
15
|
*/
|
|
18
16
|
constructor(pairs: Iterable<[Id, Item]>);
|
|
@@ -34,7 +32,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
34
32
|
values(): IterableIterator<Item>;
|
|
35
33
|
/**
|
|
36
34
|
* Return an array containing all the ids in this stream.
|
|
37
|
-
*
|
|
38
35
|
* @remarks
|
|
39
36
|
* The array may contain duplicities.
|
|
40
37
|
* @returns The array with all ids from this stream.
|
|
@@ -42,7 +39,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
42
39
|
toIdArray(): Id[];
|
|
43
40
|
/**
|
|
44
41
|
* Return an array containing all the items in this stream.
|
|
45
|
-
*
|
|
46
42
|
* @remarks
|
|
47
43
|
* The array may contain duplicities.
|
|
48
44
|
* @returns The array with all items from this stream.
|
|
@@ -50,7 +46,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
50
46
|
toItemArray(): Item[];
|
|
51
47
|
/**
|
|
52
48
|
* Return an array containing all the entries in this stream.
|
|
53
|
-
*
|
|
54
49
|
* @remarks
|
|
55
50
|
* The array may contain duplicities.
|
|
56
51
|
* @returns The array with all entries from this stream.
|
|
@@ -58,7 +53,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
58
53
|
toEntryArray(): [Id, Item][];
|
|
59
54
|
/**
|
|
60
55
|
* Return an object map containing all the items in this stream accessible by ids.
|
|
61
|
-
*
|
|
62
56
|
* @remarks
|
|
63
57
|
* In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
|
|
64
58
|
* @returns The object map of all id → item pairs from this stream.
|
|
@@ -66,25 +60,21 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
66
60
|
toObjectMap(): Record<Id, Item>;
|
|
67
61
|
/**
|
|
68
62
|
* Return a map containing all the items in this stream accessible by ids.
|
|
69
|
-
*
|
|
70
63
|
* @returns The map of all id → item pairs from this stream.
|
|
71
64
|
*/
|
|
72
65
|
toMap(): Map<Id, Item>;
|
|
73
66
|
/**
|
|
74
67
|
* Return a set containing all the (unique) ids in this stream.
|
|
75
|
-
*
|
|
76
68
|
* @returns The set of all ids from this stream.
|
|
77
69
|
*/
|
|
78
70
|
toIdSet(): Set<Id>;
|
|
79
71
|
/**
|
|
80
72
|
* Return a set containing all the (unique) items in this stream.
|
|
81
|
-
*
|
|
82
73
|
* @returns The set of all items from this stream.
|
|
83
74
|
*/
|
|
84
75
|
toItemSet(): Set<Item>;
|
|
85
76
|
/**
|
|
86
77
|
* Cache the items from this stream.
|
|
87
|
-
*
|
|
88
78
|
* @remarks
|
|
89
79
|
* This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
|
|
90
80
|
* It can also be used to optimize performance as {@link DataStream} would otherwise reevaluate everything upon each iteration.
|
|
@@ -107,7 +97,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
107
97
|
cache(): DataStream<Item>;
|
|
108
98
|
/**
|
|
109
99
|
* Get the distinct values of given property.
|
|
110
|
-
*
|
|
111
100
|
* @param callback - The function that picks and possibly converts the property.
|
|
112
101
|
* @typeParam T - The type of the distinct value.
|
|
113
102
|
* @returns A set of all distinct properties.
|
|
@@ -115,20 +104,17 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
115
104
|
distinct<T>(callback: (item: Item, id: Id) => T): Set<T>;
|
|
116
105
|
/**
|
|
117
106
|
* Filter the items of the stream.
|
|
118
|
-
*
|
|
119
107
|
* @param callback - The function that decides whether an item will be included.
|
|
120
108
|
* @returns A new data stream with the filtered items.
|
|
121
109
|
*/
|
|
122
110
|
filter(callback: (item: Item, id: Id) => boolean): DataStream<Item>;
|
|
123
111
|
/**
|
|
124
112
|
* Execute a callback for each item of the stream.
|
|
125
|
-
*
|
|
126
113
|
* @param callback - The function that will be invoked for each item.
|
|
127
114
|
*/
|
|
128
115
|
forEach(callback: (item: Item, id: Id) => boolean): void;
|
|
129
116
|
/**
|
|
130
117
|
* Map the items into a different type.
|
|
131
|
-
*
|
|
132
118
|
* @param callback - The function that does the conversion.
|
|
133
119
|
* @typeParam Mapped - The type of the item after mapping.
|
|
134
120
|
* @returns A new data stream with the mapped items.
|
|
@@ -136,21 +122,18 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
136
122
|
map<Mapped>(callback: (item: Item, id: Id) => Mapped): DataStream<Mapped>;
|
|
137
123
|
/**
|
|
138
124
|
* Get the item with the maximum value of given property.
|
|
139
|
-
*
|
|
140
125
|
* @param callback - The function that picks and possibly converts the property.
|
|
141
126
|
* @returns The item with the maximum if found otherwise null.
|
|
142
127
|
*/
|
|
143
128
|
max(callback: (item: Item, id: Id) => number): Item | null;
|
|
144
129
|
/**
|
|
145
130
|
* Get the item with the minimum value of given property.
|
|
146
|
-
*
|
|
147
131
|
* @param callback - The function that picks and possibly converts the property.
|
|
148
132
|
* @returns The item with the minimum if found otherwise null.
|
|
149
133
|
*/
|
|
150
134
|
min(callback: (item: Item, id: Id) => number): Item | null;
|
|
151
135
|
/**
|
|
152
136
|
* Reduce the items into a single value.
|
|
153
|
-
*
|
|
154
137
|
* @param callback - The function that does the reduction.
|
|
155
138
|
* @param accumulator - The initial value of the accumulator.
|
|
156
139
|
* @typeParam T - The type of the accumulated value.
|
|
@@ -159,7 +142,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
159
142
|
reduce<T>(callback: (accumulator: T, item: Item, id: Id) => T, accumulator: T): T;
|
|
160
143
|
/**
|
|
161
144
|
* Sort the items.
|
|
162
|
-
*
|
|
163
145
|
* @param callback - Item comparator.
|
|
164
146
|
* @returns A new stream with sorted items.
|
|
165
147
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../src/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../src/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAAa,UAAU,CAAC,IAAI,CAAE,YAAW,QAAQ,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAE9C;;;OAGG;gBACgB,KAAK,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAI9C;;OAEG;IACK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAMzD;;OAEG;IACK,OA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;;;;OAIG;IACI,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,MAAM,GAAG,IAAI,GAAG,IAAI;IAqBjE;;;;OAIG;IACI,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,MAAM,GAAG,IAAI,GAAG,IAAI;IAqBjE;;;;;;OAMG;IACI,MAAM,CAAC,CAAC,EACb,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EACnD,WAAW,EAAE,CAAC,GACb,CAAC;IAOJ;;;;OAIG;IACI,IAAI,CACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,MAAM,GAC/D,UAAU,CAAC,IAAI,CAAC;CAUpB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { DataView } from "./data-view";
|
|
2
|
-
import { PartItem } from "./data-interface";
|
|
1
|
+
import type { DataView } from "./data-view.ts";
|
|
2
|
+
import type { PartItem } from "./data-interface.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Check that given value is compatible with Vis Data View interface.
|
|
5
|
-
*
|
|
6
5
|
* @param idProp - The expected property to contain item id.
|
|
7
6
|
* @param v - The value to be tested.
|
|
8
7
|
* @returns True if all expected values and methods match, false otherwise.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-view-check.d.ts","sourceRoot":"","sources":["../src/data-view-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"data-view-check.d.ts","sourceRoot":"","sources":["../src/data-view-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,SAAS,QAAQ,CAAC,MAAM,CAAC,EAC7B,MAAM,SAAS,MAAM,GAAG,IAAI,EAC5B,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAgBrD"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { DataInterface, DataInterfaceForEachOptions, DataInterfaceGetIdsOptions, DataInterfaceGetOptions, DataInterfaceGetOptionsArray, DataInterfaceGetOptionsObject, DataInterfaceMapOptions, FullItem, Id, PartItem } from "./data-interface";
|
|
2
|
-
import { DataSet } from "./data-set";
|
|
3
|
-
import { DataSetPart } from "./data-set-part";
|
|
4
|
-
import { DataStream } from "./data-stream";
|
|
1
|
+
import { type DataInterface, type DataInterfaceForEachOptions, type DataInterfaceGetIdsOptions, type DataInterfaceGetOptions, type DataInterfaceGetOptionsArray, type DataInterfaceGetOptionsObject, type DataInterfaceMapOptions, type FullItem, type Id, type PartItem } from "./data-interface.ts";
|
|
2
|
+
import { DataSet } from "./data-set.ts";
|
|
3
|
+
import { DataSetPart } from "./data-set-part.ts";
|
|
4
|
+
import { DataStream } from "./data-stream.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Data view options.
|
|
7
|
-
*
|
|
8
7
|
* @typeParam Item - Item type that may or may not have an id.
|
|
9
8
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
10
9
|
*/
|
|
@@ -26,25 +25,25 @@ export interface DataViewOptions<Item, IdProp extends string> {
|
|
|
26
25
|
* // create a DataSet
|
|
27
26
|
* var data = new vis.DataSet();
|
|
28
27
|
* data.add([
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
|
|
29
|
+
* {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
|
|
30
|
+
* {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
|
|
31
|
+
* {id: 4, text: 'item 4'}
|
|
33
32
|
* ]);
|
|
34
33
|
*
|
|
35
34
|
* // create a DataView
|
|
36
35
|
* // the view will only contain items having a property group with value 1,
|
|
37
36
|
* // and will only output fields id, text, and date.
|
|
38
37
|
* var view = new vis.DataView(data, {
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
38
|
+
* filter: function (item) {
|
|
39
|
+
* return (item.group == 1);
|
|
40
|
+
* },
|
|
41
|
+
* fields: ['id', 'text', 'date']
|
|
43
42
|
* });
|
|
44
43
|
*
|
|
45
44
|
* // subscribe to any change in the DataView
|
|
46
45
|
* view.on('*', function (event, properties, senderId) {
|
|
47
|
-
*
|
|
46
|
+
* console.log('event', event, properties);
|
|
48
47
|
* });
|
|
49
48
|
*
|
|
50
49
|
* // update an item in the data set
|
|
@@ -57,7 +56,6 @@ export interface DataViewOptions<Item, IdProp extends string> {
|
|
|
57
56
|
* // get all items in the view
|
|
58
57
|
* var items = view.get();
|
|
59
58
|
* ```
|
|
60
|
-
*
|
|
61
59
|
* @typeParam Item - Item type that may or may not have an id.
|
|
62
60
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
63
61
|
*/
|
|
@@ -72,14 +70,12 @@ export declare class DataView<Item extends PartItem<IdProp>, IdProp extends stri
|
|
|
72
70
|
private readonly _options;
|
|
73
71
|
/**
|
|
74
72
|
* Create a DataView.
|
|
75
|
-
*
|
|
76
73
|
* @param data - The instance containing data (directly or indirectly).
|
|
77
74
|
* @param options - Options to configure this data view.
|
|
78
75
|
*/
|
|
79
76
|
constructor(data: DataInterface<Item, IdProp>, options?: DataViewOptions<Item, IdProp>);
|
|
80
77
|
/**
|
|
81
78
|
* Set a data source for the view.
|
|
82
|
-
*
|
|
83
79
|
* @param data - The instance containing data (directly or indirectly).
|
|
84
80
|
* @remarks
|
|
85
81
|
* Note that when the data view is bound to a data set it won't be garbage
|
|
@@ -131,7 +127,6 @@ export declare class DataView<Item extends PartItem<IdProp>, IdProp extends stri
|
|
|
131
127
|
stream(ids?: Iterable<Id>): DataStream<Item>;
|
|
132
128
|
/**
|
|
133
129
|
* Render the instance unusable prior to garbage collection.
|
|
134
|
-
*
|
|
135
130
|
* @remarks
|
|
136
131
|
* The intention of this method is to help discover scenarios where the data
|
|
137
132
|
* view is being used when the programmer thinks it has been garbage collected
|
|
@@ -140,7 +135,6 @@ export declare class DataView<Item extends PartItem<IdProp>, IdProp extends stri
|
|
|
140
135
|
dispose(): void;
|
|
141
136
|
/**
|
|
142
137
|
* Event listener. Will propagate all events from the connected data set to the subscribers of the DataView, but will filter the items and only trigger when there are changes in the filtered data set.
|
|
143
|
-
*
|
|
144
138
|
* @param event - The name of the event.
|
|
145
139
|
* @param params - Parameters of the event.
|
|
146
140
|
* @param senderId - Id supplied by the sender.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-view.d.ts","sourceRoot":"","sources":["../src/data-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"data-view.d.ts","sourceRoot":"","sources":["../src/data-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAI5B,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,QAAQ,EAId,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;GAIG;AACH,MA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CAAC,IAAI,CAAC;IAQnD;;;;;;OAMG;IACI,OAAO,IAAI,IAAI;IAqBtB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAsGjB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { DataInterface, DataInterfaceGetIdsOptions, DataInterfaceGetOptions, DataInterfaceGetOptionsArray, DataInterfaceGetOptionsObject, DataInterfaceMapOptions, DataInterfaceOrder, EventCallbacks, EventCallbacksWithAny, EventName, EventNameWithAny, } from "./data-interface";
|
|
2
|
-
export * from "./data-pipe";
|
|
1
|
+
export type { DataInterface, DataInterfaceGetIdsOptions, DataInterfaceGetOptions, DataInterfaceGetOptionsArray, DataInterfaceGetOptionsObject, DataInterfaceMapOptions, DataInterfaceOrder, EventCallbacks, EventCallbacksWithAny, EventName, EventNameWithAny, } from "./data-interface.ts";
|
|
2
|
+
export * from "./data-pipe.ts";
|
|
3
3
|
export { DELETE } from "vis-util/esnext";
|
|
4
|
-
export { DataSet, DataSetOptions } from "./data-set";
|
|
5
|
-
export { DataStream } from "./data-stream";
|
|
6
|
-
export { DataView, DataViewOptions } from "./data-view";
|
|
7
|
-
export { Queue } from "./queue";
|
|
8
|
-
export { isDataSetLike } from "./data-set-check";
|
|
9
|
-
export { isDataViewLike } from "./data-view-check";
|
|
4
|
+
export { DataSet, type DataSetOptions } from "./data-set.ts";
|
|
5
|
+
export { DataStream } from "./data-stream.ts";
|
|
6
|
+
export { DataView, type DataViewOptions } from "./data-view.ts";
|
|
7
|
+
export { Queue } from "./queue.ts";
|
|
8
|
+
export { isDataSetLike } from "./data-set-check.ts";
|
|
9
|
+
export { isDataViewLike } from "./data-view-check.ts";
|
|
10
10
|
//# sourceMappingURL=entry-esnext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-esnext.d.ts","sourceRoot":"","sources":["../src/entry-esnext.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"entry-esnext.d.ts","sourceRoot":"","sources":["../src/entry-esnext.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,aAAa,EACb,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,SAAS,EACT,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./entry-esnext";
|
|
1
|
+
export * from "./entry-esnext.ts";
|
|
2
2
|
//# sourceMappingURL=entry-peer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-peer.d.ts","sourceRoot":"","sources":["../src/entry-peer.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"entry-peer.d.ts","sourceRoot":"","sources":["../src/entry-peer.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./entry-esnext";
|
|
1
|
+
export * from "./entry-esnext.ts";
|
|
2
2
|
//# sourceMappingURL=entry-standalone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-standalone.d.ts","sourceRoot":"","sources":["../src/entry-standalone.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"entry-standalone.d.ts","sourceRoot":"","sources":["../src/entry-standalone.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
package/declarations/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./entry-esnext";
|
|
2
|
-
import { DataSet } from "./data-set";
|
|
3
|
-
import { DataView } from "./data-view";
|
|
4
|
-
import { Queue } from "./queue";
|
|
1
|
+
export * from "./entry-esnext.ts";
|
|
2
|
+
import { DataSet } from "./data-set.ts";
|
|
3
|
+
import { DataView } from "./data-view.ts";
|
|
4
|
+
import { Queue } from "./queue.ts";
|
|
5
5
|
declare const _default: {
|
|
6
6
|
DataSet: typeof DataSet;
|
|
7
7
|
DataView: typeof DataView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;;;;;;AAEnC,wBAA4C"}
|
package/declarations/queue.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export interface QueueOptions {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Queue extending options.
|
|
10
|
-
*
|
|
11
10
|
* @typeParam T - The type of method names to be replaced by queued versions.
|
|
12
11
|
*/
|
|
13
12
|
export interface QueueExtendOptions<T> {
|
|
@@ -23,7 +22,7 @@ export interface QueueExtendOptions<T> {
|
|
|
23
22
|
* - A function to be executed.
|
|
24
23
|
* - An object with function, args, context (like function.bind(context, ...args)).
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
type QueueCallEntry = Function | {
|
|
27
26
|
fn: Function;
|
|
28
27
|
args: unknown[];
|
|
29
28
|
} | {
|
|
@@ -33,7 +32,6 @@ declare type QueueCallEntry = Function | {
|
|
|
33
32
|
};
|
|
34
33
|
/**
|
|
35
34
|
* A queue.
|
|
36
|
-
*
|
|
37
35
|
* @typeParam T - The type of method names to be replaced by queued versions.
|
|
38
36
|
*/
|
|
39
37
|
export declare class Queue<T = never> {
|
|
@@ -46,20 +44,17 @@ export declare class Queue<T = never> {
|
|
|
46
44
|
private _extended;
|
|
47
45
|
/**
|
|
48
46
|
* Construct a new Queue.
|
|
49
|
-
*
|
|
50
47
|
* @param options - Queue configuration.
|
|
51
48
|
*/
|
|
52
49
|
constructor(options?: QueueOptions);
|
|
53
50
|
/**
|
|
54
51
|
* Update the configuration of the queue.
|
|
55
|
-
*
|
|
56
52
|
* @param options - Queue configuration.
|
|
57
53
|
*/
|
|
58
54
|
setOptions(options?: QueueOptions): void;
|
|
59
55
|
/**
|
|
60
56
|
* Extend an object with queuing functionality.
|
|
61
57
|
* The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
|
|
62
|
-
*
|
|
63
58
|
* @param object - The object to be extended.
|
|
64
59
|
* @param options - Additional options.
|
|
65
60
|
* @returns The created queue.
|
|
@@ -73,14 +68,12 @@ export declare class Queue<T = never> {
|
|
|
73
68
|
destroy(): void;
|
|
74
69
|
/**
|
|
75
70
|
* Replace a method on an object with a queued version.
|
|
76
|
-
*
|
|
77
71
|
* @param object - Object having the method.
|
|
78
72
|
* @param method - The method name.
|
|
79
73
|
*/
|
|
80
74
|
replace<M extends string>(object: Record<M, () => void>, method: M): void;
|
|
81
75
|
/**
|
|
82
76
|
* Queue a call.
|
|
83
|
-
*
|
|
84
77
|
* @param entry - The function or entry to be queued.
|
|
85
78
|
*/
|
|
86
79
|
queue(entry: QueueCallEntry): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,qJAAqJ;IACrJ,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,mIAAmI;IACnI,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,qJAAqJ;IACrJ,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,mIAAmI;IACnI,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,6FAA6F;IAC7F,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,uIAAuI;IACvI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wIAAwI;IACxI,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD;;;;GAIG;AACH,KAAK,cAAc,GACf,QAAQ,GACR;IACE,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,GACD;IACE,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAUN;;;GAGG;AACH,qBAAa,KAAK,CAAC,CAAC,GAAG,KAAK;IAC1B,gFAAgF;IACzE,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,wEAAwE;IACjE,GAAG,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAId;IAET,OAAO,CAAC,QAAQ,CAA8C;IAC9D,OAAO,CAAC,SAAS,CAAiC;IAElD;;;OAGG;gBACgB,OAAO,CAAC,EAAE,YAAY;IAQzC;;;OAGG;IACI,UAAU,CAAC,OAA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