@genesislcap/foundation-utils 14.167.1 → 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,258 +146,15 @@
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"
333
- }
334
- }
335
- ]
336
- },
337
- {
338
- "kind": "javascript-module",
339
- "path": "src/data/index.ts",
340
- "declarations": [],
341
- "exports": [
342
- {
343
- "kind": "js",
344
- "name": "*",
345
- "declaration": {
346
- "name": "*",
347
- "package": "./inMemoryDatabase"
149
+ "package": "./uuid"
348
150
  }
349
- }
350
- ]
351
- },
352
- {
353
- "kind": "javascript-module",
354
- "path": "src/decorators/index.ts",
355
- "declarations": [],
356
- "exports": [
151
+ },
357
152
  {
358
153
  "kind": "js",
359
154
  "name": "*",
360
155
  "declaration": {
361
156
  "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"
157
+ "package": "./window"
401
158
  }
402
159
  }
403
160
  ]
@@ -408,69 +165,19 @@
408
165
  "declarations": [],
409
166
  "exports": [
410
167
  {
411
- "kind": "js",
412
- "name": "*",
413
- "declaration": {
414
- "name": "*",
415
- "package": "./sync"
416
- }
417
- },
418
- {
419
- "kind": "js",
420
- "name": "*",
421
- "declaration": {
422
- "name": "*",
423
- "package": "./when-else"
424
- }
425
- }
426
- ]
427
- },
428
- {
429
- "kind": "javascript-module",
430
- "path": "src/design-system/design-system.ts",
431
- "declarations": [
432
- {
433
- "kind": "function",
434
- "name": "assureDesignSystem",
435
- "return": {
436
- "type": {
437
- "text": "DesignSystemModule"
438
- }
439
- },
440
- "parameters": [
441
- {
442
- "name": "module",
443
- "type": {
444
- "text": "DesignSystemModule"
445
- }
446
- }
447
- ],
448
- "description": "assureDesignSystem.",
449
- "privacy": "public"
450
- }
451
- ],
452
- "exports": [
453
- {
454
- "kind": "js",
455
- "name": "assureDesignSystem",
456
- "declaration": {
457
- "name": "assureDesignSystem",
458
- "module": "src/design-system/design-system.ts"
459
- }
460
- }
461
- ]
462
- },
463
- {
464
- "kind": "javascript-module",
465
- "path": "src/design-system/index.ts",
466
- "declarations": [],
467
- "exports": [
168
+ "kind": "js",
169
+ "name": "*",
170
+ "declaration": {
171
+ "name": "*",
172
+ "package": "./sync"
173
+ }
174
+ },
468
175
  {
469
176
  "kind": "js",
470
177
  "name": "*",
471
178
  "declaration": {
472
179
  "name": "*",
473
- "package": "./design-system"
180
+ "package": "./when-else"
474
181
  }
475
182
  }
476
183
  ]
@@ -723,168 +430,469 @@
723
430
  },
724
431
  {
725
432
  "kind": "method",
726
- "name": "set",
433
+ "name": "set",
434
+ "return": {
435
+ "type": {
436
+ "text": "void"
437
+ }
438
+ },
439
+ "parameters": [
440
+ {
441
+ "name": "key",
442
+ "type": {
443
+ "text": "keyof TErrorDetailMap"
444
+ }
445
+ },
446
+ {
447
+ "name": "error",
448
+ "type": {
449
+ "text": "Error"
450
+ }
451
+ }
452
+ ],
453
+ "description": "{@inheritDoc ErrorMap.set}"
454
+ },
455
+ {
456
+ "kind": "method",
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",
727
684
  "return": {
728
685
  "type": {
729
- "text": "void"
686
+ "text": "Promise<DatabaseAccessResult.Update<T>>"
730
687
  }
731
688
  },
732
689
  "parameters": [
733
690
  {
734
- "name": "key",
691
+ "name": "id",
735
692
  "type": {
736
- "text": "keyof TErrorDetailMap"
693
+ "text": "string"
737
694
  }
738
695
  },
739
696
  {
740
- "name": "error",
697
+ "name": "newValue",
741
698
  "type": {
742
- "text": "Error"
699
+ "text": "Omit<Partial<T>, 'id'>"
743
700
  }
744
701
  }
745
- ],
746
- "description": "{@inheritDoc ErrorMap.set}"
702
+ ]
747
703
  },
748
704
  {
749
705
  "kind": "method",
750
- "name": "get",
706
+ "name": "delete",
707
+ "privacy": "public",
751
708
  "return": {
752
709
  "type": {
753
- "text": ""
710
+ "text": "Promise<DatabaseAccessResult.Delete>"
754
711
  }
755
712
  },
756
713
  "parameters": [
757
714
  {
758
- "name": "key",
715
+ "name": "id",
759
716
  "type": {
760
- "text": "keyof TErrorDetailMap"
761
- },
762
- "description": "The key."
717
+ "text": "string"
718
+ }
763
719
  }
764
- ],
765
- "description": "Get an error by key.",
766
- "privacy": "public"
720
+ ]
767
721
  },
768
722
  {
769
723
  "kind": "method",
770
- "name": "has",
724
+ "name": "visit",
725
+ "privacy": "public",
771
726
  "return": {
772
727
  "type": {
773
- "text": ""
728
+ "text": "Promise<void>"
774
729
  }
775
730
  },
776
731
  "parameters": [
777
732
  {
778
- "name": "key",
733
+ "name": "visitor",
779
734
  "type": {
780
- "text": "keyof TErrorDetailMap"
781
- },
782
- "description": "The key."
735
+ "text": "(record: T) => void"
736
+ }
783
737
  }
784
- ],
785
- "description": "Has an error for key.",
786
- "privacy": "public"
738
+ ]
787
739
  },
788
740
  {
789
741
  "kind": "method",
790
- "name": "delete",
742
+ "name": "onBeforeUpdate",
743
+ "privacy": "public",
791
744
  "return": {
792
745
  "type": {
793
- "text": ""
746
+ "text": "() => void"
794
747
  }
795
748
  },
796
749
  "parameters": [
797
750
  {
798
- "name": "key",
751
+ "name": "listener",
799
752
  "type": {
800
- "text": "keyof TErrorDetailMap"
801
- },
802
- "description": "The key."
753
+ "text": "Listener<DatabaseEvent.BeforeUpdate<T>>"
754
+ }
803
755
  }
804
- ],
805
- "description": "Delete an error.",
806
- "privacy": "public"
756
+ ]
807
757
  },
808
758
  {
809
759
  "kind": "method",
810
- "name": "clear",
811
- "description": "Clear errors.",
812
- "privacy": "public"
813
- },
814
- {
815
- "kind": "field",
816
- "name": "size",
817
- "type": {
818
- "text": "number"
819
- },
820
- "description": "The size of the error map.",
760
+ "name": "onAfterUpdate",
761
+ "privacy": "public",
821
762
  "return": {
822
763
  "type": {
823
- "text": ""
764
+ "text": "() => void"
824
765
  }
825
766
  },
826
- "privacy": "public",
827
- "readonly": true
828
- },
767
+ "parameters": [
768
+ {
769
+ "name": "listener",
770
+ "type": {
771
+ "text": "Listener<DatabaseEvent.AfterUpdate<T>>"
772
+ }
773
+ }
774
+ ]
775
+ }
776
+ ]
777
+ }
778
+ ],
779
+ "exports": [
780
+ {
781
+ "kind": "js",
782
+ "name": "InMemoryDatabase",
783
+ "declaration": {
784
+ "name": "InMemoryDatabase",
785
+ "module": "src/data/inMemoryDatabase.ts"
786
+ }
787
+ }
788
+ ]
789
+ },
790
+ {
791
+ "kind": "javascript-module",
792
+ "path": "src/data/index.ts",
793
+ "declarations": [],
794
+ "exports": [
795
+ {
796
+ "kind": "js",
797
+ "name": "*",
798
+ "declaration": {
799
+ "name": "*",
800
+ "package": "./inMemoryDatabase"
801
+ }
802
+ }
803
+ ]
804
+ },
805
+ {
806
+ "kind": "javascript-module",
807
+ "path": "src/decorators/index.ts",
808
+ "declarations": [],
809
+ "exports": [
810
+ {
811
+ "kind": "js",
812
+ "name": "*",
813
+ "declaration": {
814
+ "name": "*",
815
+ "package": "./renderOnChange"
816
+ }
817
+ }
818
+ ]
819
+ },
820
+ {
821
+ "kind": "javascript-module",
822
+ "path": "src/decorators/renderOnChange.ts",
823
+ "declarations": [
824
+ {
825
+ "kind": "function",
826
+ "name": "renderOnChange",
827
+ "parameters": [
829
828
  {
830
- "kind": "method",
831
- "name": "values",
832
- "privacy": "public"
829
+ "name": "target",
830
+ "type": {
831
+ "text": "FASTElement & { render(): void }"
832
+ },
833
+ "description": "The target to define the property change handler on."
833
834
  },
834
835
  {
835
- "kind": "field",
836
- "name": "messages",
836
+ "name": "name",
837
837
  "type": {
838
838
  "text": "string"
839
839
  },
840
- "description": "{@inheritDoc ErrorMap.messages}",
841
- "readonly": true
840
+ "description": "The property name."
842
841
  }
843
- ]
844
- },
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
+ ],
847
+ "exports": [
848
+ {
849
+ "kind": "js",
850
+ "name": "renderOnChange",
851
+ "declaration": {
852
+ "name": "renderOnChange",
853
+ "module": "src/decorators/renderOnChange.ts"
854
+ }
855
+ }
856
+ ]
857
+ },
858
+ {
859
+ "kind": "javascript-module",
860
+ "path": "src/design-system/design-system.ts",
861
+ "declarations": [
845
862
  {
846
863
  "kind": "function",
847
- "name": "createErrorMap",
864
+ "name": "assureDesignSystem",
848
865
  "return": {
849
866
  "type": {
850
- "text": ""
867
+ "text": "DesignSystemModule"
851
868
  }
852
869
  },
853
870
  "parameters": [
854
871
  {
855
- "name": "logger",
872
+ "name": "module",
856
873
  "type": {
857
- "text": "ErrorMapLogger"
858
- },
859
- "description": "A logger error method reference."
874
+ "text": "DesignSystemModule"
875
+ }
860
876
  }
861
877
  ],
862
- "description": "A factory to create the error map.",
878
+ "description": "assureDesignSystem.",
863
879
  "privacy": "public"
864
880
  }
865
881
  ],
866
882
  "exports": [
867
883
  {
868
884
  "kind": "js",
869
- "name": "DefaultErrorMap",
870
- "declaration": {
871
- "name": "DefaultErrorMap",
872
- "module": "src/error/errorMap.ts"
873
- }
874
- },
875
- {
876
- "kind": "js",
877
- "name": "createErrorMap",
885
+ "name": "assureDesignSystem",
878
886
  "declaration": {
879
- "name": "createErrorMap",
880
- "module": "src/error/errorMap.ts"
887
+ "name": "assureDesignSystem",
888
+ "module": "src/design-system/design-system.ts"
881
889
  }
882
890
  }
883
891
  ]
884
892
  },
885
893
  {
886
894
  "kind": "javascript-module",
887
- "path": "src/error/index.ts",
895
+ "path": "src/design-system/index.ts",
888
896
  "declarations": [],
889
897
  "exports": [
890
898
  {
@@ -892,7 +900,7 @@
892
900
  "name": "*",
893
901
  "declaration": {
894
902
  "name": "*",
895
- "package": "./errorMap"
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.1",
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.1",
23
- "@genesislcap/genx": "14.167.1",
24
- "@genesislcap/rollup-builder": "14.167.1",
25
- "@genesislcap/ts-builder": "14.167.1",
26
- "@genesislcap/uvu-playwright-builder": "14.167.1",
27
- "@genesislcap/vite-builder": "14.167.1",
28
- "@genesislcap/webpack-builder": "14.167.1",
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.1",
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": "37f5c8b576a21785bcc87526aa9cba0d1bcd72b8"
50
+ "gitHead": "806560f0199c3a212a734ecf090d18484b7627bf"
51
51
  }