@appsemble/types 0.20.16 → 0.20.17
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/README.md +4 -4
- package/index.d.ts +48 -0
- package/index.ts +53 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#  Appsemble Types
|
|
2
2
|
|
|
3
3
|
> Reusable TypeScript types
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/types)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.20.17)
|
|
7
|
+
[](https://codecov.io/gl/appsemble/appsemble)
|
|
8
8
|
[](https://prettier.io)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
@@ -21,5 +21,5 @@ not guaranteed.
|
|
|
21
21
|
|
|
22
22
|
## License
|
|
23
23
|
|
|
24
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.
|
|
24
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.17/LICENSE.md) ©
|
|
25
25
|
[Appsemble](https://appsemble.com)
|
package/index.d.ts
CHANGED
|
@@ -380,6 +380,54 @@ export interface Remappers {
|
|
|
380
380
|
* Get the input data as it was initially passed to the remap function.
|
|
381
381
|
*/
|
|
382
382
|
root: null;
|
|
383
|
+
/**
|
|
384
|
+
* Get the data at a certain index from the history stack prior to an action.
|
|
385
|
+
*
|
|
386
|
+
* 0 is the index of the first item in the history stack.
|
|
387
|
+
*/
|
|
388
|
+
history: number;
|
|
389
|
+
/**
|
|
390
|
+
* Assign properties from the history stack at a certain index to an existing object.
|
|
391
|
+
*/
|
|
392
|
+
'assign.history': {
|
|
393
|
+
/**
|
|
394
|
+
* The index of the history stack item to assign.
|
|
395
|
+
*
|
|
396
|
+
* 0 is the index of the first item in the history stack.
|
|
397
|
+
*/
|
|
398
|
+
index: number;
|
|
399
|
+
/**
|
|
400
|
+
* Predefined mapper keys to choose what properties to assign.
|
|
401
|
+
*/
|
|
402
|
+
props: Record<string, Remapper>;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Assign properties from the history stack at a certain index and exclude the unwanted.
|
|
406
|
+
*/
|
|
407
|
+
'omit.history': {
|
|
408
|
+
/**
|
|
409
|
+
* The index of the history stack item to assign.
|
|
410
|
+
*
|
|
411
|
+
* 0 is the index of the first item in the history stack.
|
|
412
|
+
*/
|
|
413
|
+
index: number;
|
|
414
|
+
/**
|
|
415
|
+
* Exclude properties from the history stack item, based on the given object keys.
|
|
416
|
+
*
|
|
417
|
+
* Nested properties can be excluded using arrays of keys.
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* ```yaml
|
|
421
|
+
* omit.history:
|
|
422
|
+
* index: 0
|
|
423
|
+
* keys:
|
|
424
|
+
* - foo # Excludes the property foo
|
|
425
|
+
* - - bar # Excludes the property baz inside of bar
|
|
426
|
+
* - baz
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
keys: (string[] | string)[];
|
|
430
|
+
};
|
|
383
431
|
/**
|
|
384
432
|
* Convert an input to lower or upper case.
|
|
385
433
|
*/
|
package/index.ts
CHANGED
|
@@ -441,6 +441,59 @@ export interface Remappers {
|
|
|
441
441
|
*/
|
|
442
442
|
root: null;
|
|
443
443
|
|
|
444
|
+
/**
|
|
445
|
+
* Get the data at a certain index from the history stack prior to an action.
|
|
446
|
+
*
|
|
447
|
+
* 0 is the index of the first item in the history stack.
|
|
448
|
+
*/
|
|
449
|
+
history: number;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Assign properties from the history stack at a certain index to an existing object.
|
|
453
|
+
*/
|
|
454
|
+
'assign.history': {
|
|
455
|
+
/**
|
|
456
|
+
* The index of the history stack item to assign.
|
|
457
|
+
*
|
|
458
|
+
* 0 is the index of the first item in the history stack.
|
|
459
|
+
*/
|
|
460
|
+
index: number;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Predefined mapper keys to choose what properties to assign.
|
|
464
|
+
*/
|
|
465
|
+
props: Record<string, Remapper>;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Assign properties from the history stack at a certain index and exclude the unwanted.
|
|
470
|
+
*/
|
|
471
|
+
'omit.history': {
|
|
472
|
+
/**
|
|
473
|
+
* The index of the history stack item to assign.
|
|
474
|
+
*
|
|
475
|
+
* 0 is the index of the first item in the history stack.
|
|
476
|
+
*/
|
|
477
|
+
index: number;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Exclude properties from the history stack item, based on the given object keys.
|
|
481
|
+
*
|
|
482
|
+
* Nested properties can be excluded using arrays of keys.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ```yaml
|
|
486
|
+
* omit.history:
|
|
487
|
+
* index: 0
|
|
488
|
+
* keys:
|
|
489
|
+
* - foo # Excludes the property foo
|
|
490
|
+
* - - bar # Excludes the property baz inside of bar
|
|
491
|
+
* - baz
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
keys: (string[] | string)[];
|
|
495
|
+
};
|
|
496
|
+
|
|
444
497
|
/**
|
|
445
498
|
* Convert an input to lower or upper case.
|
|
446
499
|
*/
|