@genesislcap/foundation-utils 14.167.2 → 14.167.3-alpha-b40d1e5.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.
@@ -106,7 +106,7 @@
106
106
  "name": "*",
107
107
  "declaration": {
108
108
  "name": "*",
109
- "package": "./resource"
109
+ "package": "./promise"
110
110
  }
111
111
  },
112
112
  {
@@ -114,7 +114,7 @@
114
114
  "name": "*",
115
115
  "declaration": {
116
116
  "name": "*",
117
- "package": "./serializers"
117
+ "package": "./resource"
118
118
  }
119
119
  },
120
120
  {
@@ -122,7 +122,7 @@
122
122
  "name": "*",
123
123
  "declaration": {
124
124
  "name": "*",
125
- "package": "./state"
125
+ "package": "./serializers"
126
126
  }
127
127
  },
128
128
  {
@@ -130,7 +130,7 @@
130
130
  "name": "*",
131
131
  "declaration": {
132
132
  "name": "*",
133
- "package": "./styles"
133
+ "package": "./state"
134
134
  }
135
135
  },
136
136
  {
@@ -138,7 +138,7 @@
138
138
  "name": "*",
139
139
  "declaration": {
140
140
  "name": "*",
141
- "package": "./uuid"
141
+ "package": "./styles"
142
142
  }
143
143
  },
144
144
  {
@@ -146,308 +146,38 @@
146
146
  "name": "*",
147
147
  "declaration": {
148
148
  "name": "*",
149
- "package": "./window"
150
- }
151
- }
152
- ]
153
- },
154
- {
155
- "kind": "javascript-module",
156
- "path": "src/data/inMemoryDatabase.ts",
157
- "declarations": [
158
- {
159
- "kind": "class",
160
- "description": "An in memory database of specific DatabaseRecord types.",
161
- "name": "InMemoryDatabase",
162
- "members": [
163
- {
164
- "kind": "field",
165
- "name": "isWorking",
166
- "type": {
167
- "text": "boolean"
168
- },
169
- "privacy": "public",
170
- "default": "false"
171
- },
172
- {
173
- "kind": "field",
174
- "name": "records",
175
- "type": {
176
- "text": "Record<string, T>"
177
- },
178
- "privacy": "private",
179
- "default": "{}"
180
- },
181
- {
182
- "kind": "field",
183
- "name": "beforeUpdateListeners",
184
- "privacy": "private"
185
- },
186
- {
187
- "kind": "field",
188
- "name": "afterUpdateListeners",
189
- "privacy": "private"
190
- },
191
- {
192
- "kind": "method",
193
- "name": "create",
194
- "privacy": "public",
195
- "return": {
196
- "type": {
197
- "text": "Promise<DatabaseAccessResult.Create<T>>"
198
- }
199
- },
200
- "parameters": [
201
- {
202
- "name": "newValue",
203
- "type": {
204
- "text": "Omit<T, 'id'>"
205
- }
206
- }
207
- ]
208
- },
209
- {
210
- "kind": "method",
211
- "name": "read",
212
- "privacy": "public",
213
- "return": {
214
- "type": {
215
- "text": "Promise<DatabaseAccessResult.Read<T>>"
216
- }
217
- },
218
- "parameters": [
219
- {
220
- "name": "id",
221
- "type": {
222
- "text": "string"
223
- }
224
- }
225
- ]
226
- },
227
- {
228
- "kind": "method",
229
- "name": "update",
230
- "privacy": "public",
231
- "return": {
232
- "type": {
233
- "text": "Promise<DatabaseAccessResult.Update<T>>"
234
- }
235
- },
236
- "parameters": [
237
- {
238
- "name": "id",
239
- "type": {
240
- "text": "string"
241
- }
242
- },
243
- {
244
- "name": "newValue",
245
- "type": {
246
- "text": "Omit<Partial<T>, 'id'>"
247
- }
248
- }
249
- ]
250
- },
251
- {
252
- "kind": "method",
253
- "name": "delete",
254
- "privacy": "public",
255
- "return": {
256
- "type": {
257
- "text": "Promise<DatabaseAccessResult.Delete>"
258
- }
259
- },
260
- "parameters": [
261
- {
262
- "name": "id",
263
- "type": {
264
- "text": "string"
265
- }
266
- }
267
- ]
268
- },
269
- {
270
- "kind": "method",
271
- "name": "visit",
272
- "privacy": "public",
273
- "return": {
274
- "type": {
275
- "text": "Promise<void>"
276
- }
277
- },
278
- "parameters": [
279
- {
280
- "name": "visitor",
281
- "type": {
282
- "text": "(record: T) => void"
283
- }
284
- }
285
- ]
286
- },
287
- {
288
- "kind": "method",
289
- "name": "onBeforeUpdate",
290
- "privacy": "public",
291
- "return": {
292
- "type": {
293
- "text": "() => void"
294
- }
295
- },
296
- "parameters": [
297
- {
298
- "name": "listener",
299
- "type": {
300
- "text": "Listener<DatabaseEvent.BeforeUpdate<T>>"
301
- }
302
- }
303
- ]
304
- },
305
- {
306
- "kind": "method",
307
- "name": "onAfterUpdate",
308
- "privacy": "public",
309
- "return": {
310
- "type": {
311
- "text": "() => void"
312
- }
313
- },
314
- "parameters": [
315
- {
316
- "name": "listener",
317
- "type": {
318
- "text": "Listener<DatabaseEvent.AfterUpdate<T>>"
319
- }
320
- }
321
- ]
322
- }
323
- ]
324
- }
325
- ],
326
- "exports": [
327
- {
328
- "kind": "js",
329
- "name": "InMemoryDatabase",
330
- "declaration": {
331
- "name": "InMemoryDatabase",
332
- "module": "src/data/inMemoryDatabase.ts"
149
+ "package": "./uuid"
333
150
  }
334
- }
335
- ]
336
- },
337
- {
338
- "kind": "javascript-module",
339
- "path": "src/data/index.ts",
340
- "declarations": [],
341
- "exports": [
151
+ },
342
152
  {
343
153
  "kind": "js",
344
154
  "name": "*",
345
155
  "declaration": {
346
156
  "name": "*",
347
- "package": "./inMemoryDatabase"
157
+ "package": "./window"
348
158
  }
349
159
  }
350
160
  ]
351
161
  },
352
162
  {
353
163
  "kind": "javascript-module",
354
- "path": "src/decorators/index.ts",
164
+ "path": "src/directives/index.ts",
355
165
  "declarations": [],
356
166
  "exports": [
357
167
  {
358
168
  "kind": "js",
359
- "name": "*",
360
- "declaration": {
361
- "name": "*",
362
- "package": "./renderOnChange"
363
- }
364
- }
365
- ]
366
- },
367
- {
368
- "kind": "javascript-module",
369
- "path": "src/decorators/renderOnChange.ts",
370
- "declarations": [
371
- {
372
- "kind": "function",
373
- "name": "renderOnChange",
374
- "parameters": [
375
- {
376
- "name": "target",
377
- "type": {
378
- "text": "FASTElement & { render(): void }"
379
- },
380
- "description": "The target to define the property change handler on."
381
- },
382
- {
383
- "name": "name",
384
- "type": {
385
- "text": "string"
386
- },
387
- "description": "The property name."
388
- }
389
- ],
390
- "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
391
- "privacy": "public"
392
- }
393
- ],
394
- "exports": [
395
- {
396
- "kind": "js",
397
- "name": "renderOnChange",
398
- "declaration": {
399
- "name": "renderOnChange",
400
- "module": "src/decorators/renderOnChange.ts"
401
- }
402
- }
403
- ]
404
- },
405
- {
406
- "kind": "javascript-module",
407
- "path": "src/design-system/design-system.ts",
408
- "declarations": [
409
- {
410
- "kind": "function",
411
- "name": "assureDesignSystem",
412
- "return": {
413
- "type": {
414
- "text": "DesignSystemModule"
415
- }
416
- },
417
- "parameters": [
418
- {
419
- "name": "module",
420
- "type": {
421
- "text": "DesignSystemModule"
422
- }
423
- }
424
- ],
425
- "description": "assureDesignSystem.",
426
- "privacy": "public"
427
- }
428
- ],
429
- "exports": [
430
- {
431
- "kind": "js",
432
- "name": "assureDesignSystem",
433
- "declaration": {
434
- "name": "assureDesignSystem",
435
- "module": "src/design-system/design-system.ts"
436
- }
437
- }
438
- ]
439
- },
440
- {
441
- "kind": "javascript-module",
442
- "path": "src/design-system/index.ts",
443
- "declarations": [],
444
- "exports": [
169
+ "name": "*",
170
+ "declaration": {
171
+ "name": "*",
172
+ "package": "./sync"
173
+ }
174
+ },
445
175
  {
446
176
  "kind": "js",
447
177
  "name": "*",
448
178
  "declaration": {
449
179
  "name": "*",
450
- "package": "./design-system"
180
+ "package": "./when-else"
451
181
  }
452
182
  }
453
183
  ]
@@ -724,144 +454,357 @@
724
454
  },
725
455
  {
726
456
  "kind": "method",
727
- "name": "get",
457
+ "name": "get",
458
+ "return": {
459
+ "type": {
460
+ "text": ""
461
+ }
462
+ },
463
+ "parameters": [
464
+ {
465
+ "name": "key",
466
+ "type": {
467
+ "text": "keyof TErrorDetailMap"
468
+ },
469
+ "description": "The key."
470
+ }
471
+ ],
472
+ "description": "Get an error by key.",
473
+ "privacy": "public"
474
+ },
475
+ {
476
+ "kind": "method",
477
+ "name": "has",
478
+ "return": {
479
+ "type": {
480
+ "text": ""
481
+ }
482
+ },
483
+ "parameters": [
484
+ {
485
+ "name": "key",
486
+ "type": {
487
+ "text": "keyof TErrorDetailMap"
488
+ },
489
+ "description": "The key."
490
+ }
491
+ ],
492
+ "description": "Has an error for key.",
493
+ "privacy": "public"
494
+ },
495
+ {
496
+ "kind": "method",
497
+ "name": "delete",
498
+ "return": {
499
+ "type": {
500
+ "text": ""
501
+ }
502
+ },
503
+ "parameters": [
504
+ {
505
+ "name": "key",
506
+ "type": {
507
+ "text": "keyof TErrorDetailMap"
508
+ },
509
+ "description": "The key."
510
+ }
511
+ ],
512
+ "description": "Delete an error.",
513
+ "privacy": "public"
514
+ },
515
+ {
516
+ "kind": "method",
517
+ "name": "clear",
518
+ "description": "Clear errors.",
519
+ "privacy": "public"
520
+ },
521
+ {
522
+ "kind": "field",
523
+ "name": "size",
524
+ "type": {
525
+ "text": "number"
526
+ },
527
+ "description": "The size of the error map.",
528
+ "return": {
529
+ "type": {
530
+ "text": ""
531
+ }
532
+ },
533
+ "privacy": "public",
534
+ "readonly": true
535
+ },
536
+ {
537
+ "kind": "method",
538
+ "name": "values",
539
+ "privacy": "public"
540
+ },
541
+ {
542
+ "kind": "field",
543
+ "name": "messages",
544
+ "type": {
545
+ "text": "string"
546
+ },
547
+ "description": "{@inheritDoc ErrorMap.messages}",
548
+ "readonly": true
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ "kind": "function",
554
+ "name": "createErrorMap",
555
+ "return": {
556
+ "type": {
557
+ "text": ""
558
+ }
559
+ },
560
+ "parameters": [
561
+ {
562
+ "name": "logger",
563
+ "type": {
564
+ "text": "ErrorMapLogger"
565
+ },
566
+ "description": "A logger error method reference."
567
+ }
568
+ ],
569
+ "description": "A factory to create the error map.",
570
+ "privacy": "public"
571
+ }
572
+ ],
573
+ "exports": [
574
+ {
575
+ "kind": "js",
576
+ "name": "DefaultErrorMap",
577
+ "declaration": {
578
+ "name": "DefaultErrorMap",
579
+ "module": "src/error/errorMap.ts"
580
+ }
581
+ },
582
+ {
583
+ "kind": "js",
584
+ "name": "createErrorMap",
585
+ "declaration": {
586
+ "name": "createErrorMap",
587
+ "module": "src/error/errorMap.ts"
588
+ }
589
+ }
590
+ ]
591
+ },
592
+ {
593
+ "kind": "javascript-module",
594
+ "path": "src/error/index.ts",
595
+ "declarations": [],
596
+ "exports": [
597
+ {
598
+ "kind": "js",
599
+ "name": "*",
600
+ "declaration": {
601
+ "name": "*",
602
+ "package": "./errorMap"
603
+ }
604
+ }
605
+ ]
606
+ },
607
+ {
608
+ "kind": "javascript-module",
609
+ "path": "src/data/inMemoryDatabase.ts",
610
+ "declarations": [
611
+ {
612
+ "kind": "class",
613
+ "description": "An in memory database of specific DatabaseRecord types.",
614
+ "name": "InMemoryDatabase",
615
+ "members": [
616
+ {
617
+ "kind": "field",
618
+ "name": "isWorking",
619
+ "type": {
620
+ "text": "boolean"
621
+ },
622
+ "privacy": "public",
623
+ "default": "false"
624
+ },
625
+ {
626
+ "kind": "field",
627
+ "name": "records",
628
+ "type": {
629
+ "text": "Record<string, T>"
630
+ },
631
+ "privacy": "private",
632
+ "default": "{}"
633
+ },
634
+ {
635
+ "kind": "field",
636
+ "name": "beforeUpdateListeners",
637
+ "privacy": "private"
638
+ },
639
+ {
640
+ "kind": "field",
641
+ "name": "afterUpdateListeners",
642
+ "privacy": "private"
643
+ },
644
+ {
645
+ "kind": "method",
646
+ "name": "create",
647
+ "privacy": "public",
648
+ "return": {
649
+ "type": {
650
+ "text": "Promise<DatabaseAccessResult.Create<T>>"
651
+ }
652
+ },
653
+ "parameters": [
654
+ {
655
+ "name": "newValue",
656
+ "type": {
657
+ "text": "Omit<T, 'id'>"
658
+ }
659
+ }
660
+ ]
661
+ },
662
+ {
663
+ "kind": "method",
664
+ "name": "read",
665
+ "privacy": "public",
666
+ "return": {
667
+ "type": {
668
+ "text": "Promise<DatabaseAccessResult.Read<T>>"
669
+ }
670
+ },
671
+ "parameters": [
672
+ {
673
+ "name": "id",
674
+ "type": {
675
+ "text": "string"
676
+ }
677
+ }
678
+ ]
679
+ },
680
+ {
681
+ "kind": "method",
682
+ "name": "update",
683
+ "privacy": "public",
684
+ "return": {
685
+ "type": {
686
+ "text": "Promise<DatabaseAccessResult.Update<T>>"
687
+ }
688
+ },
689
+ "parameters": [
690
+ {
691
+ "name": "id",
692
+ "type": {
693
+ "text": "string"
694
+ }
695
+ },
696
+ {
697
+ "name": "newValue",
698
+ "type": {
699
+ "text": "Omit<Partial<T>, 'id'>"
700
+ }
701
+ }
702
+ ]
703
+ },
704
+ {
705
+ "kind": "method",
706
+ "name": "delete",
707
+ "privacy": "public",
728
708
  "return": {
729
709
  "type": {
730
- "text": ""
710
+ "text": "Promise<DatabaseAccessResult.Delete>"
731
711
  }
732
712
  },
733
713
  "parameters": [
734
714
  {
735
- "name": "key",
715
+ "name": "id",
736
716
  "type": {
737
- "text": "keyof TErrorDetailMap"
738
- },
739
- "description": "The key."
717
+ "text": "string"
718
+ }
740
719
  }
741
- ],
742
- "description": "Get an error by key.",
743
- "privacy": "public"
720
+ ]
744
721
  },
745
722
  {
746
723
  "kind": "method",
747
- "name": "has",
724
+ "name": "visit",
725
+ "privacy": "public",
748
726
  "return": {
749
727
  "type": {
750
- "text": ""
728
+ "text": "Promise<void>"
751
729
  }
752
730
  },
753
731
  "parameters": [
754
732
  {
755
- "name": "key",
733
+ "name": "visitor",
756
734
  "type": {
757
- "text": "keyof TErrorDetailMap"
758
- },
759
- "description": "The key."
735
+ "text": "(record: T) => void"
736
+ }
760
737
  }
761
- ],
762
- "description": "Has an error for key.",
763
- "privacy": "public"
738
+ ]
764
739
  },
765
740
  {
766
741
  "kind": "method",
767
- "name": "delete",
742
+ "name": "onBeforeUpdate",
743
+ "privacy": "public",
768
744
  "return": {
769
745
  "type": {
770
- "text": ""
746
+ "text": "() => void"
771
747
  }
772
748
  },
773
749
  "parameters": [
774
750
  {
775
- "name": "key",
751
+ "name": "listener",
776
752
  "type": {
777
- "text": "keyof TErrorDetailMap"
778
- },
779
- "description": "The key."
753
+ "text": "Listener<DatabaseEvent.BeforeUpdate<T>>"
754
+ }
780
755
  }
781
- ],
782
- "description": "Delete an error.",
783
- "privacy": "public"
756
+ ]
784
757
  },
785
758
  {
786
759
  "kind": "method",
787
- "name": "clear",
788
- "description": "Clear errors.",
789
- "privacy": "public"
790
- },
791
- {
792
- "kind": "field",
793
- "name": "size",
794
- "type": {
795
- "text": "number"
796
- },
797
- "description": "The size of the error map.",
760
+ "name": "onAfterUpdate",
761
+ "privacy": "public",
798
762
  "return": {
799
763
  "type": {
800
- "text": ""
764
+ "text": "() => void"
801
765
  }
802
766
  },
803
- "privacy": "public",
804
- "readonly": true
805
- },
806
- {
807
- "kind": "method",
808
- "name": "values",
809
- "privacy": "public"
810
- },
811
- {
812
- "kind": "field",
813
- "name": "messages",
814
- "type": {
815
- "text": "string"
816
- },
817
- "description": "{@inheritDoc ErrorMap.messages}",
818
- "readonly": true
767
+ "parameters": [
768
+ {
769
+ "name": "listener",
770
+ "type": {
771
+ "text": "Listener<DatabaseEvent.AfterUpdate<T>>"
772
+ }
773
+ }
774
+ ]
819
775
  }
820
776
  ]
821
- },
822
- {
823
- "kind": "function",
824
- "name": "createErrorMap",
825
- "return": {
826
- "type": {
827
- "text": ""
828
- }
829
- },
830
- "parameters": [
831
- {
832
- "name": "logger",
833
- "type": {
834
- "text": "ErrorMapLogger"
835
- },
836
- "description": "A logger error method reference."
837
- }
838
- ],
839
- "description": "A factory to create the error map.",
840
- "privacy": "public"
841
777
  }
842
778
  ],
843
779
  "exports": [
844
780
  {
845
781
  "kind": "js",
846
- "name": "DefaultErrorMap",
782
+ "name": "InMemoryDatabase",
847
783
  "declaration": {
848
- "name": "DefaultErrorMap",
849
- "module": "src/error/errorMap.ts"
784
+ "name": "InMemoryDatabase",
785
+ "module": "src/data/inMemoryDatabase.ts"
850
786
  }
851
- },
787
+ }
788
+ ]
789
+ },
790
+ {
791
+ "kind": "javascript-module",
792
+ "path": "src/data/index.ts",
793
+ "declarations": [],
794
+ "exports": [
852
795
  {
853
796
  "kind": "js",
854
- "name": "createErrorMap",
797
+ "name": "*",
855
798
  "declaration": {
856
- "name": "createErrorMap",
857
- "module": "src/error/errorMap.ts"
799
+ "name": "*",
800
+ "package": "./inMemoryDatabase"
858
801
  }
859
802
  }
860
803
  ]
861
804
  },
862
805
  {
863
806
  "kind": "javascript-module",
864
- "path": "src/error/index.ts",
807
+ "path": "src/decorators/index.ts",
865
808
  "declarations": [],
866
809
  "exports": [
867
810
  {
@@ -869,30 +812,95 @@
869
812
  "name": "*",
870
813
  "declaration": {
871
814
  "name": "*",
872
- "package": "./errorMap"
815
+ "package": "./renderOnChange"
873
816
  }
874
817
  }
875
818
  ]
876
819
  },
877
820
  {
878
821
  "kind": "javascript-module",
879
- "path": "src/directives/index.ts",
880
- "declarations": [],
822
+ "path": "src/decorators/renderOnChange.ts",
823
+ "declarations": [
824
+ {
825
+ "kind": "function",
826
+ "name": "renderOnChange",
827
+ "parameters": [
828
+ {
829
+ "name": "target",
830
+ "type": {
831
+ "text": "FASTElement & { render(): void }"
832
+ },
833
+ "description": "The target to define the property change handler on."
834
+ },
835
+ {
836
+ "name": "name",
837
+ "type": {
838
+ "text": "string"
839
+ },
840
+ "description": "The property name."
841
+ }
842
+ ],
843
+ "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
844
+ "privacy": "public"
845
+ }
846
+ ],
881
847
  "exports": [
882
848
  {
883
849
  "kind": "js",
884
- "name": "*",
850
+ "name": "renderOnChange",
885
851
  "declaration": {
886
- "name": "*",
887
- "package": "./sync"
852
+ "name": "renderOnChange",
853
+ "module": "src/decorators/renderOnChange.ts"
888
854
  }
889
- },
855
+ }
856
+ ]
857
+ },
858
+ {
859
+ "kind": "javascript-module",
860
+ "path": "src/design-system/design-system.ts",
861
+ "declarations": [
862
+ {
863
+ "kind": "function",
864
+ "name": "assureDesignSystem",
865
+ "return": {
866
+ "type": {
867
+ "text": "DesignSystemModule"
868
+ }
869
+ },
870
+ "parameters": [
871
+ {
872
+ "name": "module",
873
+ "type": {
874
+ "text": "DesignSystemModule"
875
+ }
876
+ }
877
+ ],
878
+ "description": "assureDesignSystem.",
879
+ "privacy": "public"
880
+ }
881
+ ],
882
+ "exports": [
883
+ {
884
+ "kind": "js",
885
+ "name": "assureDesignSystem",
886
+ "declaration": {
887
+ "name": "assureDesignSystem",
888
+ "module": "src/design-system/design-system.ts"
889
+ }
890
+ }
891
+ ]
892
+ },
893
+ {
894
+ "kind": "javascript-module",
895
+ "path": "src/design-system/index.ts",
896
+ "declarations": [],
897
+ "exports": [
890
898
  {
891
899
  "kind": "js",
892
900
  "name": "*",
893
901
  "declaration": {
894
902
  "name": "*",
895
- "package": "./when-else"
903
+ "package": "./design-system"
896
904
  }
897
905
  }
898
906
  ]
@@ -1305,6 +1313,62 @@
1305
1313
  }
1306
1314
  ]
1307
1315
  },
1316
+ {
1317
+ "kind": "javascript-module",
1318
+ "path": "src/promise/index.ts",
1319
+ "declarations": [],
1320
+ "exports": [
1321
+ {
1322
+ "kind": "js",
1323
+ "name": "*",
1324
+ "declaration": {
1325
+ "name": "*",
1326
+ "package": "./resolveAfter"
1327
+ }
1328
+ }
1329
+ ]
1330
+ },
1331
+ {
1332
+ "kind": "javascript-module",
1333
+ "path": "src/promise/resolveAfter.ts",
1334
+ "declarations": [
1335
+ {
1336
+ "kind": "function",
1337
+ "name": "resolveAfter",
1338
+ "return": {
1339
+ "type": {
1340
+ "text": "Promise<T>"
1341
+ }
1342
+ },
1343
+ "parameters": [
1344
+ {
1345
+ "name": "ms",
1346
+ "type": {
1347
+ "text": "number"
1348
+ }
1349
+ },
1350
+ {
1351
+ "name": "valueCreator",
1352
+ "type": {
1353
+ "text": "() => T"
1354
+ }
1355
+ }
1356
+ ],
1357
+ "description": "Resolve a promise after a timeout.",
1358
+ "privacy": "public"
1359
+ }
1360
+ ],
1361
+ "exports": [
1362
+ {
1363
+ "kind": "js",
1364
+ "name": "resolveAfter",
1365
+ "declaration": {
1366
+ "name": "resolveAfter",
1367
+ "module": "src/promise/resolveAfter.ts"
1368
+ }
1369
+ }
1370
+ ]
1371
+ },
1308
1372
  {
1309
1373
  "kind": "javascript-module",
1310
1374
  "path": "src/resource/index.ts",
@@ -9,6 +9,7 @@ export * from './logger';
9
9
  export * from './mappers';
10
10
  export * from './mixins';
11
11
  export * from './observer';
12
+ export * from './promise';
12
13
  export * from './resource';
13
14
  export * from './serializers';
14
15
  export * from './state';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './resolveAfter';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/promise/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Resolve a promise after a timeout.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const result = await Promise.race([
7
+ * resourceChecks(sourceRef, resource),
8
+ * resolveAfter<MonitoredResourceChecksResult>(this.config.checkTimeout, () => ({
9
+ * isConnected: false,
10
+ * lastUpdated: Date.now(),
11
+ * })),
12
+ * ]);
13
+ * ```
14
+ *
15
+ * @public
16
+ */
17
+ export declare const resolveAfter: <T = any>(ms: number, valueCreator: () => T) => Promise<T>;
18
+ //# sourceMappingURL=resolveAfter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAfter.d.ts","sourceRoot":"","sources":["../../../src/promise/resolveAfter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,gBAAiB,MAAM,sCAM/C,CAAC"}
package/dist/esm/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './logger';
9
9
  export * from './mappers';
10
10
  export * from './mixins';
11
11
  export * from './observer';
12
+ export * from './promise';
12
13
  export * from './resource';
13
14
  export * from './serializers';
14
15
  export * from './state';
@@ -0,0 +1 @@
1
+ export * from './resolveAfter';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Resolve a promise after a timeout.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const result = await Promise.race([
7
+ * resourceChecks(sourceRef, resource),
8
+ * resolveAfter<MonitoredResourceChecksResult>(this.config.checkTimeout, () => ({
9
+ * isConnected: false,
10
+ * lastUpdated: Date.now(),
11
+ * })),
12
+ * ]);
13
+ * ```
14
+ *
15
+ * @public
16
+ */
17
+ export const resolveAfter = (ms, valueCreator) => {
18
+ return new Promise((resolve) => {
19
+ setTimeout(() => {
20
+ resolve(valueCreator());
21
+ }, ms);
22
+ });
23
+ };
@@ -11811,6 +11811,38 @@
11811
11811
  ],
11812
11812
  "name": "renderOnChange"
11813
11813
  },
11814
+ {
11815
+ "kind": "Variable",
11816
+ "canonicalReference": "@genesislcap/foundation-utils!resolveAfter:var",
11817
+ "docComment": "/**\n * Resolve a promise after a timeout.\n *\n * @example\n * ```ts\n * const result = await Promise.race([\n * resourceChecks(sourceRef, resource),\n * resolveAfter<MonitoredResourceChecksResult>(this.config.checkTimeout, () => ({\n * isConnected: false,\n * lastUpdated: Date.now(),\n * })),\n * ]);\n * ```\n *\n * @public\n */\n",
11818
+ "excerptTokens": [
11819
+ {
11820
+ "kind": "Content",
11821
+ "text": "resolveAfter: "
11822
+ },
11823
+ {
11824
+ "kind": "Content",
11825
+ "text": "<T = any>(ms: number, valueCreator: () => T) => "
11826
+ },
11827
+ {
11828
+ "kind": "Reference",
11829
+ "text": "Promise",
11830
+ "canonicalReference": "!Promise:interface"
11831
+ },
11832
+ {
11833
+ "kind": "Content",
11834
+ "text": "<T>"
11835
+ }
11836
+ ],
11837
+ "fileUrlPath": "src/promise/resolveAfter.ts",
11838
+ "isReadonly": true,
11839
+ "releaseTag": "Public",
11840
+ "name": "resolveAfter",
11841
+ "variableTypeTokenRange": {
11842
+ "startIndex": 1,
11843
+ "endIndex": 4
11844
+ }
11845
+ },
11814
11846
  {
11815
11847
  "kind": "TypeAlias",
11816
11848
  "canonicalReference": "@genesislcap/foundation-utils!ResourceType:type",
@@ -1616,6 +1616,24 @@ export declare function renderOnChange(target: FASTElement & {
1616
1616
  render(): void;
1617
1617
  }, name: string): void;
1618
1618
 
1619
+ /**
1620
+ * Resolve a promise after a timeout.
1621
+ *
1622
+ * @example
1623
+ * ```ts
1624
+ * const result = await Promise.race([
1625
+ * resourceChecks(sourceRef, resource),
1626
+ * resolveAfter<MonitoredResourceChecksResult>(this.config.checkTimeout, () => ({
1627
+ * isConnected: false,
1628
+ * lastUpdated: Date.now(),
1629
+ * })),
1630
+ * ]);
1631
+ * ```
1632
+ *
1633
+ * @public
1634
+ */
1635
+ export declare const resolveAfter: <T = any>(ms: number, valueCreator: () => T) => Promise<T>;
1636
+
1619
1637
  /**
1620
1638
  * An object that defines two resource types: "local" and "remote".
1621
1639
  * @public
@@ -97,6 +97,7 @@
97
97
  | [PendingState](./foundation-utils.pendingstate.md) | The <code>PendingState</code> mixin. |
98
98
  | [POPUP\_DEFAULT\_HEIGHT](./foundation-utils.popup_default_height.md) | The default height (in pixels) for pop-up windows. |
99
99
  | [POPUP\_DEFAULT\_WIDTH](./foundation-utils.popup_default_width.md) | The default width (in pixels) for pop-up windows. |
100
+ | [resolveAfter](./foundation-utils.resolveafter.md) | Resolve a promise after a timeout. |
100
101
  | [ResourceType](./foundation-utils.resourcetype.md) | An object that defines two resource types: "local" and "remote". |
101
102
  | [respondToVisibility](./foundation-utils.respondtovisibility.md) | Setup an <code>IntersectionObserver</code> which will activate a callback function when an element becomes visible on screen |
102
103
  | [ServerRowDTOMapper](./foundation-utils.serverrowdtomapper.md) | A DI token used to obtain a <code>ServerRowDTOMapper</code> instance. |
@@ -0,0 +1,27 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-utils](./foundation-utils.md) &gt; [resolveAfter](./foundation-utils.resolveafter.md)
4
+
5
+ ## resolveAfter variable
6
+
7
+ Resolve a promise after a timeout.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ resolveAfter: <T = any>(ms: number, valueCreator: () => T) => Promise<T>
13
+ ```
14
+
15
+ ## Example
16
+
17
+
18
+ ```ts
19
+ const result = await Promise.race([
20
+ resourceChecks(sourceRef, resource),
21
+ resolveAfter<MonitoredResourceChecksResult>(this.config.checkTimeout, () => ({
22
+ isConnected: false,
23
+ lastUpdated: Date.now(),
24
+ })),
25
+ ]);
26
+ ```
27
+
@@ -1078,6 +1078,9 @@ export function renderOnChange(target: FASTElement & {
1078
1078
  render(): void;
1079
1079
  }, name: string): void;
1080
1080
 
1081
+ // @public
1082
+ export const resolveAfter: <T = any>(ms: number, valueCreator: () => T) => Promise<T>;
1083
+
1081
1084
  // @public
1082
1085
  export const ResourceType: {
1083
1086
  readonly local: "local";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-utils",
3
3
  "description": "Genesis Foundation Utils",
4
- "version": "14.167.2",
4
+ "version": "14.167.3-alpha-b40d1e5.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -19,17 +19,17 @@
19
19
  "test": "genx test"
20
20
  },
21
21
  "devDependencies": {
22
- "@genesislcap/foundation-testing": "14.167.2",
23
- "@genesislcap/genx": "14.167.2",
24
- "@genesislcap/rollup-builder": "14.167.2",
25
- "@genesislcap/ts-builder": "14.167.2",
26
- "@genesislcap/uvu-playwright-builder": "14.167.2",
27
- "@genesislcap/vite-builder": "14.167.2",
28
- "@genesislcap/webpack-builder": "14.167.2",
22
+ "@genesislcap/foundation-testing": "14.167.3-alpha-b40d1e5.0",
23
+ "@genesislcap/genx": "14.167.3-alpha-b40d1e5.0",
24
+ "@genesislcap/rollup-builder": "14.167.3-alpha-b40d1e5.0",
25
+ "@genesislcap/ts-builder": "14.167.3-alpha-b40d1e5.0",
26
+ "@genesislcap/uvu-playwright-builder": "14.167.3-alpha-b40d1e5.0",
27
+ "@genesislcap/vite-builder": "14.167.3-alpha-b40d1e5.0",
28
+ "@genesislcap/webpack-builder": "14.167.3-alpha-b40d1e5.0",
29
29
  "rimraf": "^3.0.2"
30
30
  },
31
31
  "dependencies": {
32
- "@genesislcap/foundation-logger": "14.167.2",
32
+ "@genesislcap/foundation-logger": "14.167.3-alpha-b40d1e5.0",
33
33
  "@microsoft/fast-components": "^2.30.6",
34
34
  "@microsoft/fast-element": "^1.12.0",
35
35
  "@microsoft/fast-foundation": "^2.49.4",
@@ -47,5 +47,5 @@
47
47
  "access": "public"
48
48
  },
49
49
  "customElements": "dist/custom-elements.json",
50
- "gitHead": "2a8195a275ed18e314669107b77cbf70b6285b97"
50
+ "gitHead": "806560f0199c3a212a734ecf090d18484b7627bf"
51
51
  }