vis-data 7.1.0 → 7.1.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/declarations/data-interface.d.ts +1 -28
- package/declarations/data-interface.d.ts.map +1 -1
- package/declarations/data-pipe.d.ts +5 -9
- package/declarations/data-pipe.d.ts.map +1 -1
- package/declarations/data-set-check.d.ts +0 -1
- package/declarations/data-set-check.d.ts.map +1 -1
- package/declarations/data-set-part.d.ts +1 -1
- package/declarations/data-set-part.d.ts.map +1 -1
- package/declarations/data-set.d.ts +4 -17
- package/declarations/data-set.d.ts.map +1 -1
- package/declarations/data-stream.d.ts +1 -17
- package/declarations/data-stream.d.ts.map +1 -1
- package/declarations/data-view-check.d.ts +0 -1
- package/declarations/data-view-check.d.ts.map +1 -1
- package/declarations/data-view.d.ts +4 -2
- package/declarations/data-view.d.ts.map +1 -1
- package/declarations/queue.d.ts +3 -2
- package/declarations/queue.d.ts.map +1 -1
- package/dist/esm.js +7435 -3483
- package/dist/esm.js.map +1 -1
- package/dist/umd.js +11969 -8016
- package/dist/umd.js.map +1 -1
- package/esnext/esm/vis-data.js +162 -266
- package/esnext/esm/vis-data.js.map +1 -1
- package/esnext/esm/vis-data.min.js +3 -17
- package/esnext/esm/vis-data.min.js.map +1 -1
- package/esnext/umd/vis-data.js +2009 -2115
- package/esnext/umd/vis-data.js.map +1 -1
- package/esnext/umd/vis-data.min.js +3 -18
- package/esnext/umd/vis-data.min.js.map +1 -1
- package/package.json +75 -27
- package/peer/esm/vis-data.js +7428 -3475
- package/peer/esm/vis-data.js.map +1 -1
- package/peer/esm/vis-data.min.js +8 -41
- package/peer/esm/vis-data.min.js.map +1 -1
- package/peer/umd/vis-data.js +11928 -7975
- package/peer/umd/vis-data.js.map +1 -1
- package/peer/umd/vis-data.min.js +9 -42
- package/peer/umd/vis-data.min.js.map +1 -1
- package/standalone/esm/vis-data.js +7428 -3475
- package/standalone/esm/vis-data.js.map +1 -1
- package/standalone/esm/vis-data.min.js +8 -41
- package/standalone/esm/vis-data.min.js.map +1 -1
- package/standalone/umd/vis-data.js +11928 -7975
- package/standalone/umd/vis-data.js.map +1 -1
- package/standalone/umd/vis-data.min.js +9 -42
- package/standalone/umd/vis-data.min.js.map +1 -1
|
@@ -10,7 +10,6 @@ export declare type OptId = undefined | null | Id;
|
|
|
10
10
|
* Determine whether a value can be used as an id.
|
|
11
11
|
*
|
|
12
12
|
* @param value - Input value of unknown type.
|
|
13
|
-
*
|
|
14
13
|
* @returns True if the value is valid id, false otherwise.
|
|
15
14
|
*/
|
|
16
15
|
export declare function isId(value: unknown): value is Id;
|
|
@@ -45,10 +44,8 @@ export declare type UpdateItem<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
45
44
|
*
|
|
46
45
|
* @param item - The item to be tested.
|
|
47
46
|
* @param idProp - Name of the id property.
|
|
48
|
-
*
|
|
49
47
|
* @typeParam Item - Item type that may or may not have an id.
|
|
50
48
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
51
|
-
*
|
|
52
49
|
* @returns True if this value is a [[FullItem]], false otherwise.
|
|
53
50
|
*/
|
|
54
51
|
export declare function isFullItem<Item extends PartItem<IdProp>, IdProp extends string>(item: Item, idProp: IdProp): item is FullItem<Item, IdProp>;
|
|
@@ -159,7 +156,7 @@ export interface DataInterfaceGetOptionsBase<Item> {
|
|
|
159
156
|
* An array with field names, or an object with current field name and new field name that the field is returned as. By default, all properties of the items are emitted. When fields is defined, only the properties whose name is specified in fields will be included in the returned items.
|
|
160
157
|
*
|
|
161
158
|
* @remarks
|
|
162
|
-
*
|
|
159
|
+
* Warning**: There is no TypeScript support for this.
|
|
163
160
|
*/
|
|
164
161
|
fields?: string[] | Record<string, string>;
|
|
165
162
|
/** Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must return a boolean. All items for which the filter function returns true will be emitted. */
|
|
@@ -174,7 +171,6 @@ export interface DataInterfaceGetOptionsBase<Item> {
|
|
|
174
171
|
* Whether an item or and array of items is returned is determined by the type of the id(s) argument.
|
|
175
172
|
* If an array of ids is requested an array of items will be returned.
|
|
176
173
|
* If a single id is requested a single item (or null if the id doesn't correspond to any item) will be returned.
|
|
177
|
-
*
|
|
178
174
|
* @typeParam Item - Item type that may or may not have an id.
|
|
179
175
|
*/
|
|
180
176
|
export interface DataInterfaceGetOptionsArray<Item> extends DataInterfaceGetOptionsBase<Item> {
|
|
@@ -186,7 +182,6 @@ export interface DataInterfaceGetOptionsArray<Item> extends DataInterfaceGetOpti
|
|
|
186
182
|
*
|
|
187
183
|
* @remarks
|
|
188
184
|
* The returned object has ids as keys and items as values of corresponding ids.
|
|
189
|
-
*
|
|
190
185
|
* @typeParam Item - Item type that may or may not have an id.
|
|
191
186
|
*/
|
|
192
187
|
export interface DataInterfaceGetOptionsObject<Item> extends DataInterfaceGetOptionsBase<Item> {
|
|
@@ -252,7 +247,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
252
247
|
* Add a universal event listener.
|
|
253
248
|
*
|
|
254
249
|
* @remarks The `*` event is triggered when any of the events `add`, `update`, and `remove` occurs.
|
|
255
|
-
*
|
|
256
250
|
* @param event - Event name.
|
|
257
251
|
* @param callback - Callback function.
|
|
258
252
|
*/
|
|
@@ -261,7 +255,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
261
255
|
* Add an `add` event listener.
|
|
262
256
|
*
|
|
263
257
|
* @remarks The `add` event is triggered when an item or a set of items is added, or when an item is updated while not yet existing.
|
|
264
|
-
*
|
|
265
258
|
* @param event - Event name.
|
|
266
259
|
* @param callback - Callback function.
|
|
267
260
|
*/
|
|
@@ -270,7 +263,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
270
263
|
* Add a `remove` event listener.
|
|
271
264
|
*
|
|
272
265
|
* @remarks The `remove` event is triggered when an item or a set of items is removed.
|
|
273
|
-
*
|
|
274
266
|
* @param event - Event name.
|
|
275
267
|
* @param callback - Callback function.
|
|
276
268
|
*/
|
|
@@ -279,7 +271,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
279
271
|
* Add an `update` event listener.
|
|
280
272
|
*
|
|
281
273
|
* @remarks The `update` event is triggered when an existing item or a set of existing items is updated.
|
|
282
|
-
*
|
|
283
274
|
* @param event - Event name.
|
|
284
275
|
* @param callback - Callback function.
|
|
285
276
|
*/
|
|
@@ -322,7 +313,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
322
313
|
* Get all the items.
|
|
323
314
|
*
|
|
324
315
|
* @param options - Additional options.
|
|
325
|
-
*
|
|
326
316
|
* @returns An array containing requested items.
|
|
327
317
|
*/
|
|
328
318
|
get(options: DataInterfaceGetOptionsArray<Item>): FullItem<Item, IdProp>[];
|
|
@@ -330,7 +320,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
330
320
|
* Get all the items.
|
|
331
321
|
*
|
|
332
322
|
* @param options - Additional options.
|
|
333
|
-
*
|
|
334
323
|
* @returns An object map of items (may be an empty object if there are no items).
|
|
335
324
|
*/
|
|
336
325
|
get(options: DataInterfaceGetOptionsObject<Item>): Record<Id, FullItem<Item, IdProp>>;
|
|
@@ -338,7 +327,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
338
327
|
* Get all the items.
|
|
339
328
|
*
|
|
340
329
|
* @param options - Additional options.
|
|
341
|
-
*
|
|
342
330
|
* @returns An array containing requested items or if requested an object map of items (may be an empty object if there are no items).
|
|
343
331
|
*/
|
|
344
332
|
get(options: DataInterfaceGetOptions<Item>): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;
|
|
@@ -346,7 +334,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
346
334
|
* Get one item.
|
|
347
335
|
*
|
|
348
336
|
* @param id - The id of the item.
|
|
349
|
-
*
|
|
350
337
|
* @returns The item or null if the id doesn't correspond to any item.
|
|
351
338
|
*/
|
|
352
339
|
get(id: Id): null | FullItem<Item, IdProp>;
|
|
@@ -355,7 +342,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
355
342
|
*
|
|
356
343
|
* @param id - The id of the item.
|
|
357
344
|
* @param options - Additional options.
|
|
358
|
-
*
|
|
359
345
|
* @returns The item or null if the id doesn't correspond to any item.
|
|
360
346
|
*/
|
|
361
347
|
get(id: Id, options: DataInterfaceGetOptionsArray<Item>): null | FullItem<Item, IdProp>;
|
|
@@ -364,7 +350,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
364
350
|
*
|
|
365
351
|
* @param id - The id of the item.
|
|
366
352
|
* @param options - Additional options.
|
|
367
|
-
*
|
|
368
353
|
* @returns An object map of items (may be an empty object if no item was found).
|
|
369
354
|
*/
|
|
370
355
|
get(id: Id, options: DataInterfaceGetOptionsObject<Item>): Record<Id, FullItem<Item, IdProp>>;
|
|
@@ -373,7 +358,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
373
358
|
*
|
|
374
359
|
* @param id - The id of the item.
|
|
375
360
|
* @param options - Additional options.
|
|
376
|
-
*
|
|
377
361
|
* @returns The item if found or null otherwise. If requested an object map with 0 to 1 items.
|
|
378
362
|
*/
|
|
379
363
|
get(id: Id, options: DataInterfaceGetOptions<Item>): null | FullItem<Item, IdProp> | Record<Id, FullItem<Item, IdProp>>;
|
|
@@ -381,7 +365,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
381
365
|
* Get multiple items.
|
|
382
366
|
*
|
|
383
367
|
* @param ids - An array of requested ids.
|
|
384
|
-
*
|
|
385
368
|
* @returns An array of found items (ids that do not correspond to any item are omitted).
|
|
386
369
|
*/
|
|
387
370
|
get(ids: Id[]): FullItem<Item, IdProp>[];
|
|
@@ -390,7 +373,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
390
373
|
*
|
|
391
374
|
* @param ids - An array of requested ids.
|
|
392
375
|
* @param options - Additional options.
|
|
393
|
-
*
|
|
394
376
|
* @returns An array of found items (ids that do not correspond to any item are omitted).
|
|
395
377
|
*/
|
|
396
378
|
get(ids: Id[], options: DataInterfaceGetOptionsArray<Item>): FullItem<Item, IdProp>[];
|
|
@@ -399,7 +381,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
399
381
|
*
|
|
400
382
|
* @param ids - An array of requested ids.
|
|
401
383
|
* @param options - Additional options.
|
|
402
|
-
*
|
|
403
384
|
* @returns An object map of items (may be an empty object if no item was found).
|
|
404
385
|
*/
|
|
405
386
|
get(ids: Id[], options: DataInterfaceGetOptionsObject<Item>): Record<Id, FullItem<Item, IdProp>>;
|
|
@@ -408,7 +389,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
408
389
|
*
|
|
409
390
|
* @param ids - An array of requested ids.
|
|
410
391
|
* @param options - Additional options.
|
|
411
|
-
*
|
|
412
392
|
* @returns An array of found items (ids that do not correspond to any item are omitted).
|
|
413
393
|
* If requested an object map of items (may be an empty object if no item was found).
|
|
414
394
|
*/
|
|
@@ -418,7 +398,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
418
398
|
*
|
|
419
399
|
* @param ids - Id or ids to be returned.
|
|
420
400
|
* @param options - Options to specify iteration details.
|
|
421
|
-
*
|
|
422
401
|
* @returns The items (format is determined by ids (single or array) and the options.
|
|
423
402
|
*/
|
|
424
403
|
get(ids: Id | Id[], options?: DataInterfaceGetOptions<Item>): null | FullItem<Item, IdProp> | FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;
|
|
@@ -434,9 +413,7 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
434
413
|
*
|
|
435
414
|
* @remarks
|
|
436
415
|
* No guarantee is given about the order of returned ids unless an ordering function is supplied.
|
|
437
|
-
*
|
|
438
416
|
* @param options - Additional configuration.
|
|
439
|
-
*
|
|
440
417
|
* @returns An array of requested ids.
|
|
441
418
|
*/
|
|
442
419
|
getIds(options?: DataInterfaceGetIdsOptions<Item>): Id[];
|
|
@@ -445,7 +422,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
445
422
|
*
|
|
446
423
|
* @remarks
|
|
447
424
|
* No guarantee is given about the order of iteration unless an ordering function is supplied.
|
|
448
|
-
*
|
|
449
425
|
* @param callback - Executed in similar fashion to Array.forEach callback, but instead of item, index, array receives item, id.
|
|
450
426
|
* @param options - Options to specify iteration details.
|
|
451
427
|
*/
|
|
@@ -455,10 +431,8 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
455
431
|
*
|
|
456
432
|
* @remarks
|
|
457
433
|
* No guarantee is given about the order of iteration even if ordering function is supplied (the items are sorted after the mapping).
|
|
458
|
-
*
|
|
459
434
|
* @param callback - Array.map-like callback, but only with the first two params.
|
|
460
435
|
* @param options - Options to specify iteration details.
|
|
461
|
-
*
|
|
462
436
|
* @returns The mapped items.
|
|
463
437
|
*/
|
|
464
438
|
map<T>(callback: (item: Item, id: Id) => T, options?: DataInterfaceMapOptions<Item, T>): T[];
|
|
@@ -466,7 +440,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
466
440
|
* Stream.
|
|
467
441
|
*
|
|
468
442
|
* @param ids - Ids of the items to be included in this stream (missing are ignored), all if omitted.
|
|
469
|
-
*
|
|
470
443
|
* @returns The data stream for this data set.
|
|
471
444
|
*/
|
|
472
445
|
stream(ids?: Iterable<Id>): DataStream<Item>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-interface.d.ts","sourceRoot":"","sources":["../src/data-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,C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AAC,EAAE,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC,GACzC,CAAC,EAAE,CAAC;IAEP;;;;;OAKG;IACH,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;CAC9C"}
|
|
@@ -33,7 +33,6 @@ export declare type DataPipeFactory = InstanceType<typeof DataPipeUnderConstruct
|
|
|
33
33
|
* Create new data pipe.
|
|
34
34
|
*
|
|
35
35
|
* @param from - The source data set or data view.
|
|
36
|
-
*
|
|
37
36
|
* @remarks
|
|
38
37
|
* Example usage:
|
|
39
38
|
* ```typescript
|
|
@@ -60,7 +59,6 @@ export declare type DataPipeFactory = InstanceType<typeof DataPipeUnderConstruct
|
|
|
60
59
|
*
|
|
61
60
|
* pipe.start();
|
|
62
61
|
* ```
|
|
63
|
-
*
|
|
64
62
|
* @returns A factory whose methods can be used to configure the pipe.
|
|
65
63
|
*/
|
|
66
64
|
export declare function createNewDataPipeFrom<SI extends PartItem<SP>, SP extends string = "id">(from: DataInterface<SI, SP>): DataPipeUnderConstruction<SI, SP>;
|
|
@@ -72,8 +70,12 @@ export declare function createNewDataPipeFrom<SI extends PartItem<SP>, SP extend
|
|
|
72
70
|
* @typeParam TP - Target item type's id property name.
|
|
73
71
|
*/
|
|
74
72
|
declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends string = "id"> {
|
|
75
|
-
#private;
|
|
76
73
|
private readonly _source;
|
|
74
|
+
/**
|
|
75
|
+
* Array transformers used to transform items within the pipe. This is typed
|
|
76
|
+
* as any for the sake of simplicity.
|
|
77
|
+
*/
|
|
78
|
+
private readonly _transformers;
|
|
77
79
|
/**
|
|
78
80
|
* Create a new data pipe factory. This is an internal constructor that
|
|
79
81
|
* should never be called from outside of this file.
|
|
@@ -86,7 +88,6 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
86
88
|
*
|
|
87
89
|
* @param callback - A filtering function that returns true if given item
|
|
88
90
|
* should be piped and false if not.
|
|
89
|
-
*
|
|
90
91
|
* @returns This factory for further configuration.
|
|
91
92
|
*/
|
|
92
93
|
filter(callback: (item: SI) => boolean): DataPipeUnderConstruction<SI, SP>;
|
|
@@ -95,10 +96,8 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
95
96
|
*
|
|
96
97
|
* @param callback - A mapping function that takes a source item and returns
|
|
97
98
|
* corresponding mapped item.
|
|
98
|
-
*
|
|
99
99
|
* @typeParam TI - Target item type.
|
|
100
100
|
* @typeParam TP - Target item type's id property name.
|
|
101
|
-
*
|
|
102
101
|
* @returns This factory for further configuration.
|
|
103
102
|
*/
|
|
104
103
|
map<TI extends PartItem<TP>, TP extends string = "id">(callback: (item: SI) => TI): DataPipeUnderConstruction<TI, TP>;
|
|
@@ -107,10 +106,8 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
107
106
|
*
|
|
108
107
|
* @param callback - A mapping function that takes a source item and returns
|
|
109
108
|
* an array of corresponding mapped items.
|
|
110
|
-
*
|
|
111
109
|
* @typeParam TI - Target item type.
|
|
112
110
|
* @typeParam TP - Target item type's id property name.
|
|
113
|
-
*
|
|
114
111
|
* @returns This factory for further configuration.
|
|
115
112
|
*/
|
|
116
113
|
flatMap<TI extends PartItem<TP>, TP extends string = "id">(callback: (item: SI) => TI[]): DataPipeUnderConstruction<TI, TP>;
|
|
@@ -118,7 +115,6 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
118
115
|
* Connect this pipe to given data set.
|
|
119
116
|
*
|
|
120
117
|
* @param target - The data set that will receive the items from this pipe.
|
|
121
|
-
*
|
|
122
118
|
* @returns The pipe connected between given data sets and performing
|
|
123
119
|
* configured transformation on the processed items.
|
|
124
120
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-pipe.d.ts","sourceRoot":"","sources":["../src/data-pipe.ts"],"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AAQ,CAAC,OAAO;IAZ3C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0B;IAExD;;;;;OAKG;gBACiC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC;IAElE;;;;;;OAMG;IACI,MAAM,CACX,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,OAAO,GAC9B,yBAAyB,CAAC,EAAE,EAAE,EAAE,CAAC;IAKpC;;;;;;;;OAQG;IACI,GAAG,CAAC,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,EAC1D,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GACzB,yBAAyB,CAAC,EAAE,EAAE,EAAE,CAAC;IAKpC;;;;;;;;OAQG;IACI,OAAO,CAAC,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,EAC9D,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,GAC3B,yBAAyB,CAAC,EAAE,EAAE,EAAE,CAAC;IAKpC;;;;;;OAMG;IACI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ;CAG7C"}
|
|
@@ -5,7 +5,6 @@ import { DataSet } from "./data-set";
|
|
|
5
5
|
*
|
|
6
6
|
* @param idProp - The expected property to contain item id.
|
|
7
7
|
* @param v - The value to be tested.
|
|
8
|
-
*
|
|
9
8
|
* @returns True if all expected values and methods match, false otherwise.
|
|
10
9
|
*/
|
|
11
10
|
export declare function isDataSetLike<Item extends PartItem<IdProp>, IdProp extends string = "id">(idProp: IdProp, v: any): v is DataSet<Item, IdProp>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-set-check.d.ts","sourceRoot":"","sources":["../src/data-set-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"data-set-check.d.ts","sourceRoot":"","sources":["../src/data-set-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,SAAS,QAAQ,CAAC,MAAM,CAAC,EAC7B,MAAM,SAAS,MAAM,GAAG,IAAI,EAC5B,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAwBpD"}
|
|
@@ -6,7 +6,7 @@ import { DataInterface, EventCallbacksWithAny, EventPayloads, Id } from "./data-
|
|
|
6
6
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class DataSetPart<Item, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" | "off"> {
|
|
9
|
-
|
|
9
|
+
private readonly _subscribers;
|
|
10
10
|
protected _trigger(event: "add", payload: EventPayloads<Item, IdProp>["add"], senderId?: Id | null): void;
|
|
11
11
|
protected _trigger(event: "update", payload: EventPayloads<Item, IdProp>["update"], senderId?: Id | null): void;
|
|
12
12
|
protected _trigger(event: "remove", payload: EventPayloads<Item, IdProp>["remove"], senderId?: Id | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-set-part.d.ts","sourceRoot":"","sources":["../src/data-set-part.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,qBAAqB,EAGrB,aAAa,EACb,EAAE,EACH,MAAM,kBAAkB,CAAC;AAM1B;;;;;GAKG;AACH,8BAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,SAAS,MAAM,CAC3D,YAAW,IAAI,CA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K,CAAC,GACnD,IAAI;IACP,kBAAkB;IACX,EAAE,CACP,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GACtD,IAAI;IACP,kBAAkB;IACX,EAAE,CACP,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GACtD,IAAI;IAkBP,kBAAkB;IACX,GAAG,CACR,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GACjD,IAAI;IACP,kBAAkB;IACX,GAAG,CACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GACnD,IAAI;IACP,kBAAkB;IACX,GAAG,CACR,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GACtD,IAAI;IACP,kBAAkB;IACX,GAAG,CACR,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GACtD,IAAI;IAiBP;;OAEG;IACI,SAAS,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAA4B;IAC7E;;OAEG;IACI,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,CACxB;IAG5B,IAAW,mBAAmB,IAAI,GAAG,CAEpC;CAEF"}
|
|
@@ -89,13 +89,16 @@ export interface DataSetOptions {
|
|
|
89
89
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
90
90
|
*/
|
|
91
91
|
export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends string = "id"> extends DataSetPart<Item, IdProp> implements DataInterface<Item, IdProp> {
|
|
92
|
-
#private;
|
|
93
92
|
/** Flush all queued calls. */
|
|
94
93
|
flush?: () => void;
|
|
95
94
|
/** @inheritDoc */
|
|
96
95
|
length: number;
|
|
97
96
|
/** @inheritDoc */
|
|
98
97
|
get idProp(): IdProp;
|
|
98
|
+
private readonly _options;
|
|
99
|
+
private readonly _data;
|
|
100
|
+
private readonly _idProp;
|
|
101
|
+
private _queue;
|
|
99
102
|
/**
|
|
100
103
|
* @param options - DataSet configuration.
|
|
101
104
|
*/
|
|
@@ -134,9 +137,7 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
134
137
|
*
|
|
135
138
|
* @param data - Items to be added (ids will be generated if missing).
|
|
136
139
|
* @param senderId - Sender id.
|
|
137
|
-
*
|
|
138
140
|
* @returns addedIds - Array with the ids (generated if not present) of the added items.
|
|
139
|
-
*
|
|
140
141
|
* @throws When an item with the same id as any of the added items already exists.
|
|
141
142
|
*/
|
|
142
143
|
add(data: Item | Item[], senderId?: Id | null): (string | number)[];
|
|
@@ -169,12 +170,9 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
169
170
|
*
|
|
170
171
|
* ## Warning for TypeScript users
|
|
171
172
|
* This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.
|
|
172
|
-
*
|
|
173
173
|
* @param data - Items to be updated (if the id is already present) or added (if the id is missing).
|
|
174
174
|
* @param senderId - Sender id.
|
|
175
|
-
*
|
|
176
175
|
* @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items.
|
|
177
|
-
*
|
|
178
176
|
* @throws When the supplied data is neither an item nor an array of items.
|
|
179
177
|
*/
|
|
180
178
|
update(data: DeepPartial<Item> | DeepPartial<Item>[], senderId?: Id | null): Id[];
|
|
@@ -207,12 +205,9 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
207
205
|
*
|
|
208
206
|
* console.log(ids) // [2]
|
|
209
207
|
* ```
|
|
210
|
-
*
|
|
211
208
|
* @param data - Updates (the id and optionally other props) to the items in this data set.
|
|
212
209
|
* @param senderId - Sender id.
|
|
213
|
-
*
|
|
214
210
|
* @returns updatedIds - The ids of the updated items.
|
|
215
|
-
*
|
|
216
211
|
* @throws When the supplied data is neither an item nor an array of items, when the ids are missing.
|
|
217
212
|
*/
|
|
218
213
|
updateOnly(data: UpdateItem<Item, IdProp> | UpdateItem<Item, IdProp>[], senderId?: Id | null): Id[];
|
|
@@ -256,7 +251,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
256
251
|
*
|
|
257
252
|
* @param items - Items to be sorted in place.
|
|
258
253
|
* @param order - A field name or custom sort function.
|
|
259
|
-
*
|
|
260
254
|
* @typeParam T - The type of the items in the items array.
|
|
261
255
|
*/
|
|
262
256
|
private _sort;
|
|
@@ -284,7 +278,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
284
278
|
*
|
|
285
279
|
* @param id - One or more items or ids of items to be removed.
|
|
286
280
|
* @param senderId - Sender id.
|
|
287
|
-
*
|
|
288
281
|
* @returns The ids of the removed items.
|
|
289
282
|
*/
|
|
290
283
|
remove(id: Id | Item | (Id | Item)[], senderId?: Id | null): Id[];
|
|
@@ -292,7 +285,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
292
285
|
* Remove an item by its id or reference.
|
|
293
286
|
*
|
|
294
287
|
* @param id - Id of an item or the item itself.
|
|
295
|
-
*
|
|
296
288
|
* @returns The removed item if removed, null otherwise.
|
|
297
289
|
*/
|
|
298
290
|
private _remove;
|
|
@@ -302,7 +294,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
302
294
|
* After the items are removed, the [[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.
|
|
303
295
|
*
|
|
304
296
|
* @param senderId - Sender id.
|
|
305
|
-
*
|
|
306
297
|
* @returns removedIds - The ids of all removed items.
|
|
307
298
|
*/
|
|
308
299
|
clear(senderId?: Id | null): Id[];
|
|
@@ -310,7 +301,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
310
301
|
* Find the item with maximum value of a specified field.
|
|
311
302
|
*
|
|
312
303
|
* @param field - Name of the property that should be searched for max value.
|
|
313
|
-
*
|
|
314
304
|
* @returns Item containing max value, or null if no items.
|
|
315
305
|
*/
|
|
316
306
|
max(field: keyof Item): Item | null;
|
|
@@ -318,7 +308,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
318
308
|
* Find the item with minimum value of a specified field.
|
|
319
309
|
*
|
|
320
310
|
* @param field - Name of the property that should be searched for min value.
|
|
321
|
-
*
|
|
322
311
|
* @returns Item containing min value, or null if no items.
|
|
323
312
|
*/
|
|
324
313
|
min(field: keyof Item): Item | null;
|
|
@@ -328,7 +317,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
328
317
|
* Add a single item. Will fail when an item with the same id already exists.
|
|
329
318
|
*
|
|
330
319
|
* @param item - A new item to be added.
|
|
331
|
-
*
|
|
332
320
|
* @returns Added item's id. An id is generated when it is not present in the item.
|
|
333
321
|
*/
|
|
334
322
|
private _addItem;
|
|
@@ -337,7 +325,6 @@ export declare class DataSet<Item extends PartItem<IdProp>, IdProp extends strin
|
|
|
337
325
|
* Will fail when the item has no id, or when there does not exist an item with the same id.
|
|
338
326
|
*
|
|
339
327
|
* @param update - The new item
|
|
340
|
-
*
|
|
341
328
|
* @returns The id of the updated item.
|
|
342
329
|
*/
|
|
343
330
|
private _updateItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-set.d.ts","sourceRoot":"","sources":["../src/data-set.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,6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OAAO,CAAC,QAAQ;IAkBhB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAoBnB,kBAAkB;IACX,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;IAsBnD,IAAW,YAAY,IAAI,GAAG,CAAC,EAAE,EAAE,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"}
|
|
@@ -6,11 +6,10 @@ import { Id } from "./data-interface";
|
|
|
6
6
|
* [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].
|
|
7
7
|
* That means that the stream is evaluated at the time of iteration, conversion to another data type or when [[cache]] is called, not when the [[DataStream]] was created.
|
|
8
8
|
* Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).
|
|
9
|
-
*
|
|
10
9
|
* @typeParam Item - The item type this stream is going to work with.
|
|
11
10
|
*/
|
|
12
11
|
export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
13
|
-
|
|
12
|
+
private readonly _pairs;
|
|
14
13
|
/**
|
|
15
14
|
* Create a new data stream.
|
|
16
15
|
*
|
|
@@ -38,7 +37,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
38
37
|
*
|
|
39
38
|
* @remarks
|
|
40
39
|
* The array may contain duplicities.
|
|
41
|
-
*
|
|
42
40
|
* @returns The array with all ids from this stream.
|
|
43
41
|
*/
|
|
44
42
|
toIdArray(): Id[];
|
|
@@ -47,7 +45,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
47
45
|
*
|
|
48
46
|
* @remarks
|
|
49
47
|
* The array may contain duplicities.
|
|
50
|
-
*
|
|
51
48
|
* @returns The array with all items from this stream.
|
|
52
49
|
*/
|
|
53
50
|
toItemArray(): Item[];
|
|
@@ -56,7 +53,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
56
53
|
*
|
|
57
54
|
* @remarks
|
|
58
55
|
* The array may contain duplicities.
|
|
59
|
-
*
|
|
60
56
|
* @returns The array with all entries from this stream.
|
|
61
57
|
*/
|
|
62
58
|
toEntryArray(): [Id, Item][];
|
|
@@ -65,7 +61,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
65
61
|
*
|
|
66
62
|
* @remarks
|
|
67
63
|
* In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
|
|
68
|
-
*
|
|
69
64
|
* @returns The object map of all id → item pairs from this stream.
|
|
70
65
|
*/
|
|
71
66
|
toObjectMap(): Record<Id, Item>;
|
|
@@ -107,7 +102,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
107
102
|
* ds.clear()
|
|
108
103
|
* chachedStream // Still has all the items.
|
|
109
104
|
* ```
|
|
110
|
-
*
|
|
111
105
|
* @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).
|
|
112
106
|
*/
|
|
113
107
|
cache(): DataStream<Item>;
|
|
@@ -115,9 +109,7 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
115
109
|
* Get the distinct values of given property.
|
|
116
110
|
*
|
|
117
111
|
* @param callback - The function that picks and possibly converts the property.
|
|
118
|
-
*
|
|
119
112
|
* @typeParam T - The type of the distinct value.
|
|
120
|
-
*
|
|
121
113
|
* @returns A set of all distinct properties.
|
|
122
114
|
*/
|
|
123
115
|
distinct<T>(callback: (item: Item, id: Id) => T): Set<T>;
|
|
@@ -125,7 +117,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
125
117
|
* Filter the items of the stream.
|
|
126
118
|
*
|
|
127
119
|
* @param callback - The function that decides whether an item will be included.
|
|
128
|
-
*
|
|
129
120
|
* @returns A new data stream with the filtered items.
|
|
130
121
|
*/
|
|
131
122
|
filter(callback: (item: Item, id: Id) => boolean): DataStream<Item>;
|
|
@@ -139,9 +130,7 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
139
130
|
* Map the items into a different type.
|
|
140
131
|
*
|
|
141
132
|
* @param callback - The function that does the conversion.
|
|
142
|
-
*
|
|
143
133
|
* @typeParam Mapped - The type of the item after mapping.
|
|
144
|
-
*
|
|
145
134
|
* @returns A new data stream with the mapped items.
|
|
146
135
|
*/
|
|
147
136
|
map<Mapped>(callback: (item: Item, id: Id) => Mapped): DataStream<Mapped>;
|
|
@@ -149,7 +138,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
149
138
|
* Get the item with the maximum value of given property.
|
|
150
139
|
*
|
|
151
140
|
* @param callback - The function that picks and possibly converts the property.
|
|
152
|
-
*
|
|
153
141
|
* @returns The item with the maximum if found otherwise null.
|
|
154
142
|
*/
|
|
155
143
|
max(callback: (item: Item, id: Id) => number): Item | null;
|
|
@@ -157,7 +145,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
157
145
|
* Get the item with the minimum value of given property.
|
|
158
146
|
*
|
|
159
147
|
* @param callback - The function that picks and possibly converts the property.
|
|
160
|
-
*
|
|
161
148
|
* @returns The item with the minimum if found otherwise null.
|
|
162
149
|
*/
|
|
163
150
|
min(callback: (item: Item, id: Id) => number): Item | null;
|
|
@@ -166,9 +153,7 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
166
153
|
*
|
|
167
154
|
* @param callback - The function that does the reduction.
|
|
168
155
|
* @param accumulator - The initial value of the accumulator.
|
|
169
|
-
*
|
|
170
156
|
* @typeParam T - The type of the accumulated value.
|
|
171
|
-
*
|
|
172
157
|
* @returns The reduced value.
|
|
173
158
|
*/
|
|
174
159
|
reduce<T>(callback: (accumulator: T, item: Item, id: Id) => T, accumulator: T): T;
|
|
@@ -176,7 +161,6 @@ export declare class DataStream<Item> implements Iterable<[Id, Item]> {
|
|
|
176
161
|
* Sort the items.
|
|
177
162
|
*
|
|
178
163
|
* @param callback - Item comparator.
|
|
179
|
-
*
|
|
180
164
|
* @returns A new stream with sorted items.
|
|
181
165
|
*/
|
|
182
166
|
sort(callback: (itemA: Item, itemB: Item, idA: Id, idB: Id) => number): DataStream<Item>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../src/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../src/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC;;;;;;;;GAQG;AACH,qBAAa,UAAU,CAAC,IAAI,CAAE,YAAW,QAAQ,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAE9C;;;;OAIG;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,OAAO,IAAI,gBAAgB,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAM/C;;OAEG;IACK,IAAI,IAAI,gBAAgB,CAAC,EAAE,CAAC;IAMpC;;OAEG;IACK,MAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC;IAMxC;;;;;;OAMG;IACI,SAAS,IAAI,EAAE,EAAE;IAIxB;;;;;;OAM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AK,MAAM,GAAG,IAAI,GAAG,IAAI;IAqBjE;;;;;;;OAOG;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;;;;;OAKG;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"}
|
|
@@ -5,7 +5,6 @@ import { PartItem } from "./data-interface";
|
|
|
5
5
|
*
|
|
6
6
|
* @param idProp - The expected property to contain item id.
|
|
7
7
|
* @param v - The value to be tested.
|
|
8
|
-
*
|
|
9
8
|
* @returns True if all expected values and methods match, false otherwise.
|
|
10
9
|
*/
|
|
11
10
|
export declare function isDataViewLike<Item extends PartItem<IdProp>, IdProp extends string = "id">(idProp: IdProp, v: any): v is DataView<Item, IdProp>;
|
|
@@ -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,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C
|
|
1
|
+
{"version":3,"file":"data-view-check.d.ts","sourceRoot":"","sources":["../src/data-view-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C;;;;;;GAMG;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"}
|