vis-data 7.1.8 → 7.1.10
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 +0 -46
- package/declarations/data-interface.d.ts.map +1 -1
- package/declarations/data-pipe.d.ts +0 -8
- 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 +0 -1
- package/declarations/data-set-part.d.ts.map +1 -1
- package/declarations/data-set.d.ts +14 -28
- package/declarations/data-set.d.ts.map +1 -1
- package/declarations/data-stream.d.ts +0 -18
- 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 +9 -15
- package/declarations/data-view.d.ts.map +1 -1
- package/declarations/queue.d.ts +0 -7
- package/declarations/queue.d.ts.map +1 -1
- package/dist/esm.js +133 -266
- package/dist/esm.js.map +1 -1
- package/dist/umd.js +133 -266
- package/dist/umd.js.map +1 -1
- package/esnext/esm/vis-data.js +25 -91
- package/esnext/esm/vis-data.js.map +1 -1
- package/esnext/esm/vis-data.min.js +2 -2
- package/esnext/esm/vis-data.min.js.map +1 -1
- package/esnext/umd/vis-data.js +25 -91
- package/esnext/umd/vis-data.js.map +1 -1
- package/esnext/umd/vis-data.min.js +2 -2
- package/esnext/umd/vis-data.min.js.map +1 -1
- package/package.json +19 -14
- package/peer/esm/vis-data.js +131 -264
- package/peer/esm/vis-data.js.map +1 -1
- package/peer/esm/vis-data.min.js +4 -4
- package/peer/esm/vis-data.min.js.map +1 -1
- package/peer/umd/vis-data.js +131 -264
- package/peer/umd/vis-data.js.map +1 -1
- package/peer/umd/vis-data.min.js +4 -4
- package/peer/umd/vis-data.min.js.map +1 -1
- package/standalone/esm/vis-data.js +131 -264
- package/standalone/esm/vis-data.js.map +1 -1
- package/standalone/esm/vis-data.min.js +4 -4
- package/standalone/esm/vis-data.min.js.map +1 -1
- package/standalone/umd/vis-data.js +131 -264
- package/standalone/umd/vis-data.js.map +1 -1
- package/standalone/umd/vis-data.min.js +4 -4
- package/standalone/umd/vis-data.min.js.map +1 -1
|
@@ -8,7 +8,6 @@ export declare type Id = number | string;
|
|
|
8
8
|
export declare type OptId = undefined | null | Id;
|
|
9
9
|
/**
|
|
10
10
|
* Determine whether a value can be used as an id.
|
|
11
|
-
*
|
|
12
11
|
* @param value - Input value of unknown type.
|
|
13
12
|
* @returns True if the value is valid id, false otherwise.
|
|
14
13
|
*/
|
|
@@ -21,27 +20,23 @@ export declare type DeepPartial<T> = T extends any[] | Function | Node ? T : T e
|
|
|
21
20
|
} : T;
|
|
22
21
|
/**
|
|
23
22
|
* An item that may ({@link Id}) or may not (absent, undefined or null) have an id property.
|
|
24
|
-
*
|
|
25
23
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
26
24
|
*/
|
|
27
25
|
export declare type PartItem<IdProp extends string> = Partial<Record<IdProp, OptId>>;
|
|
28
26
|
/**
|
|
29
27
|
* An item that has a property containing an id and all other required properties of given item type.
|
|
30
|
-
*
|
|
31
28
|
* @typeParam Item - Item type that may or may not have an id.
|
|
32
29
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
33
30
|
*/
|
|
34
31
|
export declare type FullItem<Item extends PartItem<IdProp>, IdProp extends string> = Item & Record<IdProp, Id>;
|
|
35
32
|
/**
|
|
36
33
|
* An item that has a property containing an id and optionally other properties of given item type.
|
|
37
|
-
*
|
|
38
34
|
* @typeParam Item - Item type that may or may not have an id.
|
|
39
35
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
40
36
|
*/
|
|
41
37
|
export declare type UpdateItem<Item extends PartItem<IdProp>, IdProp extends string> = Assignable<FullItem<Item, IdProp>> & Record<IdProp, Id>;
|
|
42
38
|
/**
|
|
43
39
|
* Test whether an item has an id (is a {@link FullItem}).
|
|
44
|
-
*
|
|
45
40
|
* @param item - The item to be tested.
|
|
46
41
|
* @param idProp - Name of the id property.
|
|
47
42
|
* @typeParam Item - Item type that may or may not have an id.
|
|
@@ -62,7 +57,6 @@ export interface UpdateEventPayload<Item extends PartItem<IdProp>, IdProp extend
|
|
|
62
57
|
oldData: FullItem<Item, IdProp>[];
|
|
63
58
|
/**
|
|
64
59
|
* Items as they are now.
|
|
65
|
-
*
|
|
66
60
|
* @deprecated Just get the data from the data set or data view.
|
|
67
61
|
*/
|
|
68
62
|
data: FullItem<Item, IdProp>[];
|
|
@@ -76,7 +70,6 @@ export interface RemoveEventPayload<Item extends PartItem<IdProp>, IdProp extend
|
|
|
76
70
|
}
|
|
77
71
|
/**
|
|
78
72
|
* Map of event payload types (event name → payload).
|
|
79
|
-
*
|
|
80
73
|
* @typeParam Item - Item type that may or may not have an id.
|
|
81
74
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
82
75
|
*/
|
|
@@ -87,7 +80,6 @@ export interface EventPayloads<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
87
80
|
}
|
|
88
81
|
/**
|
|
89
82
|
* Map of event payload types including any event (event name → payload).
|
|
90
|
-
*
|
|
91
83
|
* @typeParam Item - Item type that may or may not have an id.
|
|
92
84
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
93
85
|
*/
|
|
@@ -96,7 +88,6 @@ export interface EventPayloadsWithAny<Item extends PartItem<IdProp>, IdProp exte
|
|
|
96
88
|
}
|
|
97
89
|
/**
|
|
98
90
|
* Map of event callback types (event name → callback).
|
|
99
|
-
*
|
|
100
91
|
* @typeParam Item - Item type that may or may not have an id.
|
|
101
92
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
102
93
|
*/
|
|
@@ -122,7 +113,6 @@ export interface EventCallbacks<Item extends PartItem<IdProp>, IdProp extends st
|
|
|
122
113
|
}
|
|
123
114
|
/**
|
|
124
115
|
* Map of event callback types including any event (event name → callback).
|
|
125
|
-
*
|
|
126
116
|
* @typeParam Item - Item type that may or may not have an id.
|
|
127
117
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
128
118
|
*/
|
|
@@ -142,19 +132,16 @@ export declare type EventNameWithAny = keyof EventPayloadsWithAny<never, "">;
|
|
|
142
132
|
* Data interface order parameter.
|
|
143
133
|
* - A string value determines which property will be used for sorting (using < and > operators for numeric comparison).
|
|
144
134
|
* - A function will be used the same way as in Array.sort.
|
|
145
|
-
*
|
|
146
135
|
* @typeParam Item - Item type that may or may not have an id.
|
|
147
136
|
*/
|
|
148
137
|
export declare type DataInterfaceOrder<Item> = keyof Item | ((a: Item, b: Item) => number);
|
|
149
138
|
/**
|
|
150
139
|
* Data interface get options (return type independent).
|
|
151
|
-
*
|
|
152
140
|
* @typeParam Item - Item type that may or may not have an id.
|
|
153
141
|
*/
|
|
154
142
|
export interface DataInterfaceGetOptionsBase<Item> {
|
|
155
143
|
/**
|
|
156
144
|
* 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.
|
|
157
|
-
*
|
|
158
145
|
* @remarks
|
|
159
146
|
* Warning**: There is no TypeScript support for this.
|
|
160
147
|
*/
|
|
@@ -166,7 +153,6 @@ export interface DataInterfaceGetOptionsBase<Item> {
|
|
|
166
153
|
}
|
|
167
154
|
/**
|
|
168
155
|
* Data interface get options (returns a single item or an array).
|
|
169
|
-
*
|
|
170
156
|
* @remarks
|
|
171
157
|
* Whether an item or and array of items is returned is determined by the type of the id(s) argument.
|
|
172
158
|
* If an array of ids is requested an array of items will be returned.
|
|
@@ -179,7 +165,6 @@ export interface DataInterfaceGetOptionsArray<Item> extends DataInterfaceGetOpti
|
|
|
179
165
|
}
|
|
180
166
|
/**
|
|
181
167
|
* Data interface get options (returns an object).
|
|
182
|
-
*
|
|
183
168
|
* @remarks
|
|
184
169
|
* The returned object has ids as keys and items as values of corresponding ids.
|
|
185
170
|
* @typeParam Item - Item type that may or may not have an id.
|
|
@@ -190,13 +175,11 @@ export interface DataInterfaceGetOptionsObject<Item> extends DataInterfaceGetOpt
|
|
|
190
175
|
}
|
|
191
176
|
/**
|
|
192
177
|
* Data interface get options (returns single item, an array or object).
|
|
193
|
-
*
|
|
194
178
|
* @typeParam Item - Item type that may or may not have an id.
|
|
195
179
|
*/
|
|
196
180
|
export declare type DataInterfaceGetOptions<Item> = DataInterfaceGetOptionsArray<Item> | DataInterfaceGetOptionsObject<Item>;
|
|
197
181
|
/**
|
|
198
182
|
* Data interface get ids options.
|
|
199
|
-
*
|
|
200
183
|
* @typeParam Item - Item type that may or may not have an id.
|
|
201
184
|
*/
|
|
202
185
|
export interface DataInterfaceGetIdsOptions<Item> {
|
|
@@ -207,7 +190,6 @@ export interface DataInterfaceGetIdsOptions<Item> {
|
|
|
207
190
|
}
|
|
208
191
|
/**
|
|
209
192
|
* Data interface for each options.
|
|
210
|
-
*
|
|
211
193
|
* @typeParam Item - Item type that may or may not have an id.
|
|
212
194
|
*/
|
|
213
195
|
export interface DataInterfaceForEachOptions<Item> {
|
|
@@ -220,7 +202,6 @@ export interface DataInterfaceForEachOptions<Item> {
|
|
|
220
202
|
}
|
|
221
203
|
/**
|
|
222
204
|
* Data interface map oprions.
|
|
223
|
-
*
|
|
224
205
|
* @typeParam Original - The original item type in the data.
|
|
225
206
|
* @typeParam Mapped - The type after mapping.
|
|
226
207
|
*/
|
|
@@ -234,7 +215,6 @@ export interface DataInterfaceMapOptions<Original, Mapped> {
|
|
|
234
215
|
}
|
|
235
216
|
/**
|
|
236
217
|
* Common interface for data sets and data view.
|
|
237
|
-
*
|
|
238
218
|
* @typeParam Item - Item type that may or may not have an id (missing ids will be generated upon insertion).
|
|
239
219
|
* @typeParam IdProp - Name of the property on the Item type that contains the id.
|
|
240
220
|
*/
|
|
@@ -245,7 +225,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
245
225
|
idProp: IdProp;
|
|
246
226
|
/**
|
|
247
227
|
* Add a universal event listener.
|
|
248
|
-
*
|
|
249
228
|
* @remarks The `*` event is triggered when any of the events `add`, `update`, and `remove` occurs.
|
|
250
229
|
* @param event - Event name.
|
|
251
230
|
* @param callback - Callback function.
|
|
@@ -253,7 +232,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
253
232
|
on(event: "*", callback: EventCallbacksWithAny<Item, IdProp>["*"]): void;
|
|
254
233
|
/**
|
|
255
234
|
* Add an `add` event listener.
|
|
256
|
-
*
|
|
257
235
|
* @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.
|
|
258
236
|
* @param event - Event name.
|
|
259
237
|
* @param callback - Callback function.
|
|
@@ -261,7 +239,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
261
239
|
on(event: "add", callback: EventCallbacksWithAny<Item, IdProp>["add"]): void;
|
|
262
240
|
/**
|
|
263
241
|
* Add a `remove` event listener.
|
|
264
|
-
*
|
|
265
242
|
* @remarks The `remove` event is triggered when an item or a set of items is removed.
|
|
266
243
|
* @param event - Event name.
|
|
267
244
|
* @param callback - Callback function.
|
|
@@ -269,7 +246,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
269
246
|
on(event: "remove", callback: EventCallbacksWithAny<Item, IdProp>["remove"]): void;
|
|
270
247
|
/**
|
|
271
248
|
* Add an `update` event listener.
|
|
272
|
-
*
|
|
273
249
|
* @remarks The `update` event is triggered when an existing item or a set of existing items is updated.
|
|
274
250
|
* @param event - Event name.
|
|
275
251
|
* @param callback - Callback function.
|
|
@@ -277,69 +253,59 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
277
253
|
on(event: "update", callback: EventCallbacksWithAny<Item, IdProp>["update"]): void;
|
|
278
254
|
/**
|
|
279
255
|
* Remove a universal event listener.
|
|
280
|
-
*
|
|
281
256
|
* @param event - Event name.
|
|
282
257
|
* @param callback - Callback function.
|
|
283
258
|
*/
|
|
284
259
|
off(event: "*", callback: EventCallbacksWithAny<Item, IdProp>["*"]): void;
|
|
285
260
|
/**
|
|
286
261
|
* Remove an `add` event listener.
|
|
287
|
-
*
|
|
288
262
|
* @param event - Event name.
|
|
289
263
|
* @param callback - Callback function.
|
|
290
264
|
*/
|
|
291
265
|
off(event: "add", callback: EventCallbacksWithAny<Item, IdProp>["add"]): void;
|
|
292
266
|
/**
|
|
293
267
|
* Remove a `remove` event listener.
|
|
294
|
-
*
|
|
295
268
|
* @param event - Event name.
|
|
296
269
|
* @param callback - Callback function.
|
|
297
270
|
*/
|
|
298
271
|
off(event: "remove", callback: EventCallbacksWithAny<Item, IdProp>["remove"]): void;
|
|
299
272
|
/**
|
|
300
273
|
* Remove an `update` event listener.
|
|
301
|
-
*
|
|
302
274
|
* @param event - Event name.
|
|
303
275
|
* @param callback - Callback function.
|
|
304
276
|
*/
|
|
305
277
|
off(event: "update", callback: EventCallbacksWithAny<Item, IdProp>["update"]): void;
|
|
306
278
|
/**
|
|
307
279
|
* Get all the items.
|
|
308
|
-
*
|
|
309
280
|
* @returns An array containing all the items.
|
|
310
281
|
*/
|
|
311
282
|
get(): FullItem<Item, IdProp>[];
|
|
312
283
|
/**
|
|
313
284
|
* Get all the items.
|
|
314
|
-
*
|
|
315
285
|
* @param options - Additional options.
|
|
316
286
|
* @returns An array containing requested items.
|
|
317
287
|
*/
|
|
318
288
|
get(options: DataInterfaceGetOptionsArray<Item>): FullItem<Item, IdProp>[];
|
|
319
289
|
/**
|
|
320
290
|
* Get all the items.
|
|
321
|
-
*
|
|
322
291
|
* @param options - Additional options.
|
|
323
292
|
* @returns An object map of items (may be an empty object if there are no items).
|
|
324
293
|
*/
|
|
325
294
|
get(options: DataInterfaceGetOptionsObject<Item>): Record<Id, FullItem<Item, IdProp>>;
|
|
326
295
|
/**
|
|
327
296
|
* Get all the items.
|
|
328
|
-
*
|
|
329
297
|
* @param options - Additional options.
|
|
330
298
|
* @returns An array containing requested items or if requested an object map of items (may be an empty object if there are no items).
|
|
331
299
|
*/
|
|
332
300
|
get(options: DataInterfaceGetOptions<Item>): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;
|
|
333
301
|
/**
|
|
334
302
|
* Get one item.
|
|
335
|
-
*
|
|
336
303
|
* @param id - The id of the item.
|
|
337
304
|
* @returns The item or null if the id doesn't correspond to any item.
|
|
338
305
|
*/
|
|
339
306
|
get(id: Id): null | FullItem<Item, IdProp>;
|
|
340
307
|
/**
|
|
341
308
|
* Get one item.
|
|
342
|
-
*
|
|
343
309
|
* @param id - The id of the item.
|
|
344
310
|
* @param options - Additional options.
|
|
345
311
|
* @returns The item or null if the id doesn't correspond to any item.
|
|
@@ -347,7 +313,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
347
313
|
get(id: Id, options: DataInterfaceGetOptionsArray<Item>): null | FullItem<Item, IdProp>;
|
|
348
314
|
/**
|
|
349
315
|
* Get one item.
|
|
350
|
-
*
|
|
351
316
|
* @param id - The id of the item.
|
|
352
317
|
* @param options - Additional options.
|
|
353
318
|
* @returns An object map of items (may be an empty object if no item was found).
|
|
@@ -355,7 +320,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
355
320
|
get(id: Id, options: DataInterfaceGetOptionsObject<Item>): Record<Id, FullItem<Item, IdProp>>;
|
|
356
321
|
/**
|
|
357
322
|
* Get one item.
|
|
358
|
-
*
|
|
359
323
|
* @param id - The id of the item.
|
|
360
324
|
* @param options - Additional options.
|
|
361
325
|
* @returns The item if found or null otherwise. If requested an object map with 0 to 1 items.
|
|
@@ -363,14 +327,12 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
363
327
|
get(id: Id, options: DataInterfaceGetOptions<Item>): null | FullItem<Item, IdProp> | Record<Id, FullItem<Item, IdProp>>;
|
|
364
328
|
/**
|
|
365
329
|
* Get multiple items.
|
|
366
|
-
*
|
|
367
330
|
* @param ids - An array of requested ids.
|
|
368
331
|
* @returns An array of found items (ids that do not correspond to any item are omitted).
|
|
369
332
|
*/
|
|
370
333
|
get(ids: Id[]): FullItem<Item, IdProp>[];
|
|
371
334
|
/**
|
|
372
335
|
* Get multiple items.
|
|
373
|
-
*
|
|
374
336
|
* @param ids - An array of requested ids.
|
|
375
337
|
* @param options - Additional options.
|
|
376
338
|
* @returns An array of found items (ids that do not correspond to any item are omitted).
|
|
@@ -378,7 +340,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
378
340
|
get(ids: Id[], options: DataInterfaceGetOptionsArray<Item>): FullItem<Item, IdProp>[];
|
|
379
341
|
/**
|
|
380
342
|
* Get multiple items.
|
|
381
|
-
*
|
|
382
343
|
* @param ids - An array of requested ids.
|
|
383
344
|
* @param options - Additional options.
|
|
384
345
|
* @returns An object map of items (may be an empty object if no item was found).
|
|
@@ -386,7 +347,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
386
347
|
get(ids: Id[], options: DataInterfaceGetOptionsObject<Item>): Record<Id, FullItem<Item, IdProp>>;
|
|
387
348
|
/**
|
|
388
349
|
* Get multiple items.
|
|
389
|
-
*
|
|
390
350
|
* @param ids - An array of requested ids.
|
|
391
351
|
* @param options - Additional options.
|
|
392
352
|
* @returns An array of found items (ids that do not correspond to any item are omitted).
|
|
@@ -395,7 +355,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
395
355
|
get(ids: Id[], options: DataInterfaceGetOptions<Item>): FullItem<Item, IdProp>[] | Record<Id, FullItem<Item, IdProp>>;
|
|
396
356
|
/**
|
|
397
357
|
* Get items.
|
|
398
|
-
*
|
|
399
358
|
* @param ids - Id or ids to be returned.
|
|
400
359
|
* @param options - Options to specify iteration details.
|
|
401
360
|
* @returns The items (format is determined by ids (single or array) and the options.
|
|
@@ -404,13 +363,11 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
404
363
|
/**
|
|
405
364
|
* Get the DataSet to which the instance implementing this interface is connected.
|
|
406
365
|
* In case there is a chain of multiple DataViews, the root DataSet of this chain is returned.
|
|
407
|
-
*
|
|
408
366
|
* @returns The data set that actually contains the data.
|
|
409
367
|
*/
|
|
410
368
|
getDataSet(): DataSet<Item, IdProp>;
|
|
411
369
|
/**
|
|
412
370
|
* Get ids of items.
|
|
413
|
-
*
|
|
414
371
|
* @remarks
|
|
415
372
|
* No guarantee is given about the order of returned ids unless an ordering function is supplied.
|
|
416
373
|
* @param options - Additional configuration.
|
|
@@ -419,7 +376,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
419
376
|
getIds(options?: DataInterfaceGetIdsOptions<Item>): Id[];
|
|
420
377
|
/**
|
|
421
378
|
* Execute a callback function for each item.
|
|
422
|
-
*
|
|
423
379
|
* @remarks
|
|
424
380
|
* No guarantee is given about the order of iteration unless an ordering function is supplied.
|
|
425
381
|
* @param callback - Executed in similar fashion to Array.forEach callback, but instead of item, index, array receives item, id.
|
|
@@ -428,7 +384,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
428
384
|
forEach(callback: (item: Item, id: Id) => void, options?: DataInterfaceForEachOptions<Item>): void;
|
|
429
385
|
/**
|
|
430
386
|
* Map each item into different item and return them as an array.
|
|
431
|
-
*
|
|
432
387
|
* @remarks
|
|
433
388
|
* No guarantee is given about the order of iteration even if ordering function is supplied (the items are sorted after the mapping).
|
|
434
389
|
* @param callback - Array.map-like callback, but only with the first two params.
|
|
@@ -438,7 +393,6 @@ export interface DataInterface<Item extends PartItem<IdProp>, IdProp extends str
|
|
|
438
393
|
map<T>(callback: (item: Item, id: Id) => T, options?: DataInterfaceMapOptions<Item, T>): T[];
|
|
439
394
|
/**
|
|
440
395
|
* Stream.
|
|
441
|
-
*
|
|
442
396
|
* @param ids - Ids of the items to be included in this stream (missing are ignored), all if omitted.
|
|
443
397
|
* @returns The data stream for this data set.
|
|
444
398
|
*/
|
|
@@ -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,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,aAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7B,qBAAqB;AACrB,oBAAY,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC;AACjC,wBAAwB;AACxB,oBAAY,KAAK,GAAG,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;AAC1C
|
|
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,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,aAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7B,qBAAqB;AACrB,oBAAY,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC;AACjC,wBAAwB;AACxB,oBAAY,KAAK,GAAG,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;AAC1C;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,EAAE,CAEhD;AAED;;GAEG;AACH,oBAAY,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,GAAG,QAAQ,GAAG,IAAI,GAC1D,CAAC,GACD,CAAC,SAAS,MAAM,GAChB;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GAC1C,CAAC,CAAC;AAEN;;;GAGG;AACH,oBAAY,QAAQ,CAAC,MAAM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E,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,IAAI,EACtC,OAAO,CAAC,EAAE,2BAA2B,CAAC,IAAI,CAAC,GAC1C,IAAI,CAAC;IAER;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EACH,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EACnC,OAAO,CAAC,EAAE,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC,GACzC,CAAC,EAAE,CAAC;IAEP;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;CAC9C"}
|
|
@@ -12,7 +12,6 @@ export interface DataPipe {
|
|
|
12
12
|
/**
|
|
13
13
|
* Start observing the source data set or data view, transforming the items
|
|
14
14
|
* and updating the target data set.
|
|
15
|
-
*
|
|
16
15
|
* @remarks
|
|
17
16
|
* The current content of the source data set will be ignored. If you for
|
|
18
17
|
* example want to process all the items that are already there use:
|
|
@@ -31,7 +30,6 @@ export interface DataPipe {
|
|
|
31
30
|
export declare type DataPipeFactory = InstanceType<typeof DataPipeUnderConstruction>;
|
|
32
31
|
/**
|
|
33
32
|
* Create new data pipe.
|
|
34
|
-
*
|
|
35
33
|
* @param from - The source data set or data view.
|
|
36
34
|
* @remarks
|
|
37
35
|
* Example usage:
|
|
@@ -65,7 +63,6 @@ export declare function createNewDataPipeFrom<SI extends PartItem<SP>, SP extend
|
|
|
65
63
|
/**
|
|
66
64
|
* Internal implementation of the pipe factory. This should be accessible
|
|
67
65
|
* only through `createNewDataPipeFrom` from the outside.
|
|
68
|
-
*
|
|
69
66
|
* @typeParam TI - Target item type.
|
|
70
67
|
* @typeParam TP - Target item type's id property name.
|
|
71
68
|
*/
|
|
@@ -79,13 +76,11 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
79
76
|
/**
|
|
80
77
|
* Create a new data pipe factory. This is an internal constructor that
|
|
81
78
|
* should never be called from outside of this file.
|
|
82
|
-
*
|
|
83
79
|
* @param _source - The source data set or data view for this pipe.
|
|
84
80
|
*/
|
|
85
81
|
constructor(_source: DataInterface<SI, SP>);
|
|
86
82
|
/**
|
|
87
83
|
* Filter the items.
|
|
88
|
-
*
|
|
89
84
|
* @param callback - A filtering function that returns true if given item
|
|
90
85
|
* should be piped and false if not.
|
|
91
86
|
* @returns This factory for further configuration.
|
|
@@ -93,7 +88,6 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
93
88
|
filter(callback: (item: SI) => boolean): DataPipeUnderConstruction<SI, SP>;
|
|
94
89
|
/**
|
|
95
90
|
* Map each source item to a new type.
|
|
96
|
-
*
|
|
97
91
|
* @param callback - A mapping function that takes a source item and returns
|
|
98
92
|
* corresponding mapped item.
|
|
99
93
|
* @typeParam TI - Target item type.
|
|
@@ -103,7 +97,6 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
103
97
|
map<TI extends PartItem<TP>, TP extends string = "id">(callback: (item: SI) => TI): DataPipeUnderConstruction<TI, TP>;
|
|
104
98
|
/**
|
|
105
99
|
* Map each source item to zero or more items of a new type.
|
|
106
|
-
*
|
|
107
100
|
* @param callback - A mapping function that takes a source item and returns
|
|
108
101
|
* an array of corresponding mapped items.
|
|
109
102
|
* @typeParam TI - Target item type.
|
|
@@ -113,7 +106,6 @@ declare class DataPipeUnderConstruction<SI extends PartItem<SP>, SP extends stri
|
|
|
113
106
|
flatMap<TI extends PartItem<TP>, TP extends string = "id">(callback: (item: SI) => TI[]): DataPipeUnderConstruction<TI, TP>;
|
|
114
107
|
/**
|
|
115
108
|
* Connect this pipe to given data set.
|
|
116
|
-
*
|
|
117
109
|
* @param target - The data set that will receive the items from this pipe.
|
|
118
110
|
* @returns The pipe connected between given data sets and performing
|
|
119
111
|
* configured transformation on the processed items.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-pipe.d.ts","sourceRoot":"","sources":["../src/data-pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,GAAG,IAAI,IAAI,CAAC;IAEZ
|
|
1
|
+
{"version":3,"file":"data-pipe.d.ts","sourceRoot":"","sources":["../src/data-pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,GAAG,IAAI,IAAI,CAAC;IAEZ;;;;;;;OAOG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;GAEG;AACH,oBAAY,eAAe,GAAG,YAAY,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,EACvB,EAAE,SAAS,MAAM,GAAG,IAAI,EACxB,IAAI,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,yBAAyB,CAAC,EAAE,EAAE,EAAE,CAAC,CAEhE;AA6HD;;;;;GAKG;AACH,cAAM,yBAAyB,CAC7B,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,EACvB,EAAE,SAAS,MAAM,GAAG,IAAI;IAaL,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX3C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0B;IAExD;;;;OAIG;gBACiC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC;IAElE;;;;;OAKG;IACI,MAAM,CACX,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,OAAO,GAC9B,yBAAyB,CAAC,EAAE,EAAE,EAAE,CAAC;IAKpC;;;;;;;OAOG;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;;;;;;;OAOG;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;;;;;OAKG;IACI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ;CAG7C"}
|
|
@@ -2,7 +2,6 @@ import { PartItem } from "./data-interface";
|
|
|
2
2
|
import { DataSet } from "./data-set";
|
|
3
3
|
/**
|
|
4
4
|
* Check that given value is compatible with Vis Data Set 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-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;;;;;GAKG;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"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataInterface, EventCallbacksWithAny, EventPayloads, Id, PartItem } from "./data-interface";
|
|
2
2
|
/**
|
|
3
3
|
* {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.
|
|
4
|
-
*
|
|
5
4
|
* @typeParam Item - Item type that may or may not have an id.
|
|
6
5
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
7
6
|
*/
|
|
@@ -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,EACF,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAM1B
|
|
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,EACF,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAM1B;;;;GAIG;AACH,8BAAsB,WAAW,CAC/B,IAAI,SAAS,QAAQ,CAAC,MAAM,CAAC,EAC7B,MAAM,SAAS,MAAM,CACrB,YAAW,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAE1D,OAAO,CAAC,QA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AAI;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;IAgBP;;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"}
|
|
@@ -4,7 +4,6 @@ import { DataSetPart } from "./data-set-part";
|
|
|
4
4
|
import { DataStream } from "./data-stream";
|
|
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
|
*/
|