native-document 1.0.91 → 1.0.93

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.
Files changed (68) hide show
  1. package/dist/native-document.components.min.js +1168 -138
  2. package/dist/native-document.dev.js +792 -217
  3. package/dist/native-document.dev.js.map +1 -1
  4. package/dist/native-document.devtools.min.js +1 -1
  5. package/dist/native-document.min.js +1 -1
  6. package/docs/advanced-components.md +814 -0
  7. package/docs/anchor.md +71 -11
  8. package/docs/cache.md +888 -0
  9. package/docs/conditional-rendering.md +91 -1
  10. package/docs/core-concepts.md +9 -2
  11. package/docs/elements.md +127 -2
  12. package/docs/extending-native-document-element.md +7 -1
  13. package/docs/filters.md +1216 -0
  14. package/docs/getting-started.md +12 -3
  15. package/docs/lifecycle-events.md +10 -2
  16. package/docs/list-rendering.md +453 -54
  17. package/docs/memory-management.md +9 -7
  18. package/docs/native-document-element.md +30 -9
  19. package/docs/native-fetch.md +744 -0
  20. package/docs/observables.md +135 -6
  21. package/docs/routing.md +7 -1
  22. package/docs/state-management.md +7 -1
  23. package/docs/validation.md +8 -1
  24. package/eslint.config.js +3 -3
  25. package/package.json +3 -2
  26. package/readme.md +53 -14
  27. package/src/components/$traits/HasItems.js +42 -1
  28. package/src/components/BaseComponent.js +4 -1
  29. package/src/components/accordion/Accordion.js +112 -8
  30. package/src/components/accordion/AccordionItem.js +93 -4
  31. package/src/components/alert/Alert.js +164 -4
  32. package/src/components/avatar/Avatar.js +236 -22
  33. package/src/components/menu/index.js +1 -2
  34. package/src/core/data/ObservableArray.js +120 -2
  35. package/src/core/data/ObservableChecker.js +50 -0
  36. package/src/core/data/ObservableItem.js +223 -80
  37. package/src/core/data/ObservableWhen.js +36 -6
  38. package/src/core/data/observable-helpers/array.js +12 -3
  39. package/src/core/data/observable-helpers/computed.js +17 -4
  40. package/src/core/data/observable-helpers/object.js +19 -3
  41. package/src/core/elements/control/for-each-array.js +21 -3
  42. package/src/core/elements/control/for-each.js +17 -5
  43. package/src/core/elements/control/show-if.js +31 -15
  44. package/src/core/elements/control/show-when.js +23 -0
  45. package/src/core/elements/control/switch.js +40 -10
  46. package/src/core/utils/cache.js +5 -0
  47. package/src/core/utils/memoize.js +25 -16
  48. package/src/core/utils/prototypes.js +3 -2
  49. package/src/core/wrappers/AttributesWrapper.js +1 -1
  50. package/src/core/wrappers/NDElement.js +41 -1
  51. package/src/core/wrappers/NdPrototype.js +4 -0
  52. package/src/core/wrappers/TemplateCloner.js +13 -10
  53. package/src/core/wrappers/prototypes/bind-class-extensions.js +1 -1
  54. package/src/core/wrappers/prototypes/nd-element-extensions.js +3 -0
  55. package/src/router/Route.js +9 -4
  56. package/src/router/Router.js +28 -9
  57. package/src/router/errors/RouterError.js +0 -1
  58. package/types/control-flow.d.ts +9 -6
  59. package/types/elements.d.ts +6 -3
  60. package/types/filters/index.d.ts +4 -0
  61. package/types/nd-element.d.ts +5 -238
  62. package/types/observable.d.ts +9 -3
  63. package/types/router.d.ts +5 -1
  64. package/types/template-cloner.ts +1 -0
  65. package/types/validator.ts +11 -1
  66. package/utils.d.ts +2 -1
  67. package/utils.js +4 -4
  68. package/src/core/utils/service.js +0 -6
@@ -38,7 +38,9 @@ export interface NDElement {
38
38
  shadow(mode: ShadowMode, style?: string | null): this;
39
39
  openShadow(style?: string | null): this;
40
40
  closedShadow(style?: string | null): this;
41
- attach(bindingHydrator: BindingHydrator): HTMLElement;
41
+ attach(methodName: string, bindingHydrator: BindingHydrator): HTMLElement;
42
+
43
+ on(name: string, callback: EventListener, options?: boolean | AddEventListenerOptions): this;
42
44
 
43
45
  // Mouse Events
44
46
  onClick(callback: (event: MouseEvent) => void): this;
@@ -341,8 +343,6 @@ export interface NDElement {
341
343
  onPreventStopClick(callback?: (event: MouseEvent) => void): this;
342
344
  onPreventStopDblClick(callback?: (event: MouseEvent) => void): this;
343
345
  onPreventStopMouseDown(callback?: (event: MouseEvent) => void): this;
344
- onPreventStopMouseEnter(callback?: (event: MouseEvent) => void): this;
345
- onPreventStopMouseLeave(callback?: (event: MouseEvent) => void): this;
346
346
  onPreventStopMouseMove(callback?: (event: MouseEvent) => void): this;
347
347
  onPreventStopMouseOut(callback?: (event: MouseEvent) => void): this;
348
348
  onPreventStopMouseOver(callback?: (event: MouseEvent) => void): this;
@@ -356,17 +356,15 @@ export interface NDElement {
356
356
  onPreventStopKeyUp(callback?: (event: KeyboardEvent) => void): this;
357
357
 
358
358
  // Prevent + Stop versions for Form Events
359
- onPreventStopBlur(callback?: (event: FocusEvent) => void): this;
360
359
  onPreventStopChange(callback?: (event: Event) => void): this;
361
- onPreventStopFocus(callback?: (event: FocusEvent) => void): this;
362
- onPreventStopFocusIn(callback?: (event: FocusEvent) => void): this;
363
- onPreventStopFocusOut(callback?: (event: FocusEvent) => void): this;
364
360
  onPreventStopInput(callback?: (event: Event) => void): this;
365
361
  onPreventStopInvalid(callback?: (event: Event) => void): this;
366
362
  onPreventStopReset(callback?: (event: Event) => void): this;
367
363
  onPreventStopSearch(callback?: (event: Event) => void): this;
368
364
  onPreventStopSelect(callback?: (event: Event) => void): this;
369
365
  onPreventStopSubmit(callback?: (event: Event) => void): this;
366
+ onPreventStopFocusIn(callback?: (event: FocusEvent) => void): this;
367
+ onPreventStopFocusOut(callback?: (event: FocusEvent) => void): this;
370
368
 
371
369
  // Prevent + Stop versions for Drag Events
372
370
  onPreventStopDrag(callback?: (event: DragEvent) => void): this;
@@ -378,42 +376,8 @@ export interface NDElement {
378
376
  onPreventStopDrop(callback?: (event: DragEvent) => void): this;
379
377
 
380
378
  // Prevent + Stop versions for Window/Page Events
381
- onPreventStopAfterPrint(callback?: (event: Event) => void): this;
382
- onPreventStopBeforePrint(callback?: (event: Event) => void): this;
383
379
  onPreventStopBeforeUnload(callback?: (event: BeforeUnloadEvent) => void): this;
384
- onPreventStopError(callback?: (event: Event) => void): this;
385
380
  onPreventStopHashChange(callback?: (event: HashChangeEvent) => void): this;
386
- onPreventStopLoad(callback?: (event: Event) => void): this;
387
- onPreventStopOffline(callback?: (event: Event) => void): this;
388
- onPreventStopOnline(callback?: (event: Event) => void): this;
389
- onPreventStopPageHide(callback?: (event: PageTransitionEvent) => void): this;
390
- onPreventStopPageShow(callback?: (event: PageTransitionEvent) => void): this;
391
- onPreventStopResize(callback?: (event: UIEvent) => void): this;
392
- onPreventStopScroll(callback?: (event: Event) => void): this;
393
- onPreventStopUnload(callback?: (event: Event) => void): this;
394
-
395
- // Prevent + Stop versions for Media Events
396
- onPreventStopAbort(callback?: (event: Event) => void): this;
397
- onPreventStopCanPlay(callback?: (event: Event) => void): this;
398
- onPreventStopCanPlayThrough(callback?: (event: Event) => void): this;
399
- onPreventStopDurationChange(callback?: (event: Event) => void): this;
400
- onPreventStopEmptied(callback?: (event: Event) => void): this;
401
- onPreventStopEnded(callback?: (event: Event) => void): this;
402
- onPreventStopLoadedData(callback?: (event: Event) => void): this;
403
- onPreventStopLoadedMetadata(callback?: (event: Event) => void): this;
404
- onPreventStopLoadStart(callback?: (event: Event) => void): this;
405
- onPreventStopPause(callback?: (event: Event) => void): this;
406
- onPreventStopPlay(callback?: (event: Event) => void): this;
407
- onPreventStopPlaying(callback?: (event: Event) => void): this;
408
- onPreventStopProgress(callback?: (event: ProgressEvent) => void): this;
409
- onPreventStopRateChange(callback?: (event: Event) => void): this;
410
- onPreventStopSeeked(callback?: (event: Event) => void): this;
411
- onPreventStopSeeking(callback?: (event: Event) => void): this;
412
- onPreventStopStalled(callback?: (event: Event) => void): this;
413
- onPreventStopSuspend(callback?: (event: Event) => void): this;
414
- onPreventStopTimeUpdate(callback?: (event: Event) => void): this;
415
- onPreventStopVolumeChange(callback?: (event: Event) => void): this;
416
- onPreventStopWaiting(callback?: (event: Event) => void): this;
417
381
 
418
382
  // Prevent + Stop versions for Touch Events
419
383
  onPreventStopTouchCancel(callback?: (event: TouchEvent) => void): this;
@@ -434,201 +398,4 @@ export interface NDElement {
434
398
  onPreventStopCut(callback?: (event: ClipboardEvent) => void): this;
435
399
  onPreventStopPaste(callback?: (event: ClipboardEvent) => void): this;
436
400
 
437
- // DELEGATION METHODS - WHEN (for children)
438
-
439
- // When versions for Mouse Events
440
- whenClick(callback: (event: MouseEvent) => void): this;
441
- whenDblClick(callback: (event: MouseEvent) => void): this;
442
- whenMouseDown(callback: (event: MouseEvent) => void): this;
443
- whenMouseEnter(callback: (event: MouseEvent) => void): this;
444
- whenMouseLeave(callback: (event: MouseEvent) => void): this;
445
- whenMouseMove(callback: (event: MouseEvent) => void): this;
446
- whenMouseOut(callback: (event: MouseEvent) => void): this;
447
- whenMouseOver(callback: (event: MouseEvent) => void): this;
448
- whenMouseUp(callback: (event: MouseEvent) => void): this;
449
- whenWheel(callback: (event: WheelEvent) => void): this;
450
- whenContextMenu(callback: (event: MouseEvent) => void): this;
451
-
452
- // When versions for Keyboard Events
453
- whenKeyDown(callback: (event: KeyboardEvent) => void): this;
454
- whenKeyPress(callback: (event: KeyboardEvent) => void): this;
455
- whenKeyUp(callback: (event: KeyboardEvent) => void): this;
456
-
457
- // When versions for Form Events
458
- whenBlur(callback: (event: FocusEvent) => void): this;
459
- whenChange(callback: (event: Event) => void): this;
460
- whenFocus(callback: (event: FocusEvent) => void): this;
461
- whenFocusIn(callback: (event: FocusEvent) => void): this;
462
- whenFocusOut(callback: (event: FocusEvent) => void): this;
463
- whenInput(callback: (event: Event) => void): this;
464
- whenInvalid(callback: (event: Event) => void): this;
465
- whenReset(callback: (event: Event) => void): this;
466
- whenSearch(callback: (event: Event) => void): this;
467
- whenSelect(callback: (event: Event) => void): this;
468
- whenSubmit(callback: (event: Event) => void): this;
469
-
470
- // When versions for Drag Events
471
- whenDrag(callback: (event: DragEvent) => void): this;
472
- whenDragEnd(callback: (event: DragEvent) => void): this;
473
- whenDragEnter(callback: (event: DragEvent) => void): this;
474
- whenDragLeave(callback: (event: DragEvent) => void): this;
475
- whenDragOver(callback: (event: DragEvent) => void): this;
476
- whenDragStart(callback: (event: DragEvent) => void): this;
477
- whenDrop(callback: (event: DragEvent) => void): this;
478
-
479
- // When versions for Window/Page Events
480
- whenAfterPrint(callback: (event: Event) => void): this;
481
- whenBeforePrint(callback: (event: Event) => void): this;
482
- whenBeforeUnload(callback: (event: BeforeUnloadEvent) => void): this;
483
- whenError(callback: (event: Event) => void): this;
484
- whenHashChange(callback: (event: HashChangeEvent) => void): this;
485
- whenLoad(callback: (event: Event) => void): this;
486
- whenOffline(callback: (event: Event) => void): this;
487
- whenOnline(callback: (event: Event) => void): this;
488
- whenPageHide(callback: (event: PageTransitionEvent) => void): this;
489
- whenPageShow(callback: (event: PageTransitionEvent) => void): this;
490
- whenResize(callback: (event: UIEvent) => void): this;
491
- whenScroll(callback: (event: Event) => void): this;
492
- whenUnload(callback: (event: Event) => void): this;
493
-
494
- // When versions for Media Events
495
- whenAbort(callback: (event: Event) => void): this;
496
- whenCanPlay(callback: (event: Event) => void): this;
497
- whenCanPlayThrough(callback: (event: Event) => void): this;
498
- whenDurationChange(callback: (event: Event) => void): this;
499
- whenEmptied(callback: (event: Event) => void): this;
500
- whenEnded(callback: (event: Event) => void): this;
501
- whenLoadedData(callback: (event: Event) => void): this;
502
- whenLoadedMetadata(callback: (event: Event) => void): this;
503
- whenLoadStart(callback: (event: Event) => void): this;
504
- whenPause(callback: (event: Event) => void): this;
505
- whenPlay(callback: (event: Event) => void): this;
506
- whenPlaying(callback: (event: Event) => void): this;
507
- whenProgress(callback: (event: ProgressEvent) => void): this;
508
- whenRateChange(callback: (event: Event) => void): this;
509
- whenSeeked(callback: (event: Event) => void): this;
510
- whenSeeking(callback: (event: Event) => void): this;
511
- whenStalled(callback: (event: Event) => void): this;
512
- whenSuspend(callback: (event: Event) => void): this;
513
- whenTimeUpdate(callback: (event: Event) => void): this;
514
- whenVolumeChange(callback: (event: Event) => void): this;
515
- whenWaiting(callback: (event: Event) => void): this;
516
-
517
- // When versions for Touch Events
518
- whenTouchCancel(callback: (event: TouchEvent) => void): this;
519
- whenTouchEnd(callback: (event: TouchEvent) => void): this;
520
- whenTouchMove(callback: (event: TouchEvent) => void): this;
521
- whenTouchStart(callback: (event: TouchEvent) => void): this;
522
-
523
- // When versions for Animation Events
524
- whenAnimationEnd(callback: (event: AnimationEvent) => void): this;
525
- whenAnimationIteration(callback: (event: AnimationEvent) => void): this;
526
- whenAnimationStart(callback: (event: AnimationEvent) => void): this;
527
-
528
- // When versions for Transition Events
529
- whenTransitionEnd(callback: (event: TransitionEvent) => void): this;
530
-
531
- // When versions for Clipboard Events
532
- whenCopy(callback: (event: ClipboardEvent) => void): this;
533
- whenCut(callback: (event: ClipboardEvent) => void): this;
534
- whenPaste(callback: (event: ClipboardEvent) => void): this;
535
-
536
- // CAPTURE METHODS (for parents)
537
-
538
- // Capture versions for Mouse Events
539
- captureClick(directHandler?: (event: MouseEvent) => void): this;
540
- captureDblClick(directHandler?: (event: MouseEvent) => void): this;
541
- captureMouseDown(directHandler?: (event: MouseEvent) => void): this;
542
- captureMouseEnter(directHandler?: (event: MouseEvent) => void): this;
543
- captureMouseLeave(directHandler?: (event: MouseEvent) => void): this;
544
- captureMouseMove(directHandler?: (event: MouseEvent) => void): this;
545
- captureMouseOut(directHandler?: (event: MouseEvent) => void): this;
546
- captureMouseOver(directHandler?: (event: MouseEvent) => void): this;
547
- captureMouseUp(directHandler?: (event: MouseEvent) => void): this;
548
- captureWheel(directHandler?: (event: WheelEvent) => void): this;
549
- captureContextMenu(directHandler?: (event: MouseEvent) => void): this;
550
-
551
- // Capture versions for Keyboard Events
552
- captureKeyDown(directHandler?: (event: KeyboardEvent) => void): this;
553
- captureKeyPress(directHandler?: (event: KeyboardEvent) => void): this;
554
- captureKeyUp(directHandler?: (event: KeyboardEvent) => void): this;
555
-
556
- // Capture versions for Form Events
557
- captureBlur(directHandler?: (event: FocusEvent) => void): this;
558
- captureChange(directHandler?: (event: Event) => void): this;
559
- captureFocus(directHandler?: (event: FocusEvent) => void): this;
560
- captureFocusIn(directHandler?: (event: FocusEvent) => void): this;
561
- captureFocusOut(directHandler?: (event: FocusEvent) => void): this;
562
- captureInput(directHandler?: (event: Event) => void): this;
563
- captureInvalid(directHandler?: (event: Event) => void): this;
564
- captureReset(directHandler?: (event: Event) => void): this;
565
- captureSearch(directHandler?: (event: Event) => void): this;
566
- captureSelect(directHandler?: (event: Event) => void): this;
567
- captureSubmit(directHandler?: (event: Event) => void): this;
568
-
569
- // Capture versions for Drag Events
570
- captureDrag(directHandler?: (event: DragEvent) => void): this;
571
- captureDragEnd(directHandler?: (event: DragEvent) => void): this;
572
- captureDragEnter(directHandler?: (event: DragEvent) => void): this;
573
- captureDragLeave(directHandler?: (event: DragEvent) => void): this;
574
- captureDragOver(directHandler?: (event: DragEvent) => void): this;
575
- captureDragStart(directHandler?: (event: DragEvent) => void): this;
576
- captureDrop(directHandler?: (event: DragEvent) => void): this;
577
-
578
- // Capture versions for Window/Page Events
579
- captureAfterPrint(directHandler?: (event: Event) => void): this;
580
- captureBeforePrint(directHandler?: (event: Event) => void): this;
581
- captureBeforeUnload(directHandler?: (event: BeforeUnloadEvent) => void): this;
582
- captureError(directHandler?: (event: Event) => void): this;
583
- captureHashChange(directHandler?: (event: HashChangeEvent) => void): this;
584
- captureLoad(directHandler?: (event: Event) => void): this;
585
- captureOffline(directHandler?: (event: Event) => void): this;
586
- captureOnline(directHandler?: (event: Event) => void): this;
587
- capturePageHide(directHandler?: (event: PageTransitionEvent) => void): this;
588
- capturePageShow(directHandler?: (event: PageTransitionEvent) => void): this;
589
- captureResize(directHandler?: (event: UIEvent) => void): this;
590
- captureScroll(directHandler?: (event: Event) => void): this;
591
- captureUnload(directHandler?: (event: Event) => void): this;
592
-
593
- // Capture versions for Media Events
594
- captureAbort(directHandler?: (event: Event) => void): this;
595
- captureCanPlay(directHandler?: (event: Event) => void): this;
596
- captureCanPlayThrough(directHandler?: (event: Event) => void): this;
597
- captureDurationChange(directHandler?: (event: Event) => void): this;
598
- captureEmptied(directHandler?: (event: Event) => void): this;
599
- captureEnded(directHandler?: (event: Event) => void): this;
600
- captureLoadedData(directHandler?: (event: Event) => void): this;
601
- captureLoadedMetadata(directHandler?: (event: Event) => void): this;
602
- captureLoadStart(directHandler?: (event: Event) => void): this;
603
- capturePause(directHandler?: (event: Event) => void): this;
604
- capturePlay(directHandler?: (event: Event) => void): this;
605
- capturePlaying(directHandler?: (event: Event) => void): this;
606
- captureProgress(directHandler?: (event: ProgressEvent) => void): this;
607
- captureRateChange(directHandler?: (event: Event) => void): this;
608
- captureSeeked(directHandler?: (event: Event) => void): this;
609
- captureSeeking(directHandler?: (event: Event) => void): this;
610
- captureStalled(directHandler?: (event: Event) => void): this;
611
- captureSuspend(directHandler?: (event: Event) => void): this;
612
- captureTimeUpdate(directHandler?: (event: Event) => void): this;
613
- captureVolumeChange(directHandler?: (event: Event) => void): this;
614
- captureWaiting(directHandler?: (event: Event) => void): this;
615
-
616
- // Capture versions for Touch Events
617
- captureTouchCancel(directHandler?: (event: TouchEvent) => void): this;
618
- captureTouchEnd(directHandler?: (event: TouchEvent) => void): this;
619
- captureTouchMove(directHandler?: (event: TouchEvent) => void): this;
620
- captureTouchStart(directHandler?: (event: TouchEvent) => void): this;
621
-
622
- // Capture versions for Animation Events
623
- captureAnimationEnd(directHandler?: (event: AnimationEvent) => void): this;
624
- captureAnimationIteration(directHandler?: (event: AnimationEvent) => void): this;
625
- captureAnimationStart(directHandler?: (event: AnimationEvent) => void): this;
626
-
627
- // Capture versions for Transition Events
628
- captureTransitionEnd(directHandler?: (event: TransitionEvent) => void): this;
629
-
630
- // Capture versions for Clipboard Events
631
- captureCopy(directHandler?: (event: ClipboardEvent) => void): this;
632
- captureCut(directHandler?: (event: ClipboardEvent) => void): this;
633
- capturePaste(directHandler?: (event: ClipboardEvent) => void): this;
634
401
  }
@@ -23,7 +23,12 @@ export interface ObservableItem<T = any> {
23
23
 
24
24
  check<U>(callback: (value: T) => U): ObservableChecker<U>;
25
25
  get<U>(callback: (value: T) => U): ObservableChecker<U>;
26
- when(value: T): { $target: T; $observer: ObservableItem<T> };
26
+ when(value: T): ObservableWhen<T>;
27
+ off(value: T, callback?: Function): void;
28
+ once(predicate: T | ((value: T) => boolean), callback: (value: T) => void): void;
29
+ onCleanup(callback: () => void): void;
30
+ intercept(callback: (newValue: T, currentValue: T) => T | undefined): this;
31
+ disconnectAll(): void;
27
32
 
28
33
  toString(): string;
29
34
  equals(value: any): boolean;
@@ -41,7 +46,7 @@ export class ObservableWhen<T = any> {
41
46
 
42
47
  subscribe(callback: (value: boolean) => void): Unsubscribe;
43
48
  val(): boolean;
44
- isMath(): boolean;
49
+ isMatch(): boolean;
45
50
  isActive(): boolean;
46
51
  }
47
52
 
@@ -64,6 +69,8 @@ export interface ObservableChecker<T = any> {
64
69
  }
65
70
 
66
71
  export interface ObservableArray<T> extends ObservableItem<T[]> {
72
+ readonly length: number;
73
+
67
74
  push(...items: T[]): number;
68
75
  pop(): T | undefined;
69
76
  shift(): T | undefined;
@@ -78,7 +85,6 @@ export interface ObservableArray<T> extends ObservableItem<T[]> {
78
85
  removeItem(item: T): T[];
79
86
  remove(index: number): T[];
80
87
  swap(indexA: number, indexB: number): boolean;
81
- length(): number;
82
88
  count(condition: (item:T, index?:number) => boolean): number;
83
89
  populateAndRender(iteration: number, callback: (index: number) => T): void;
84
90
 
package/types/router.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // Router system type definitions
2
2
  import { ValidChild } from './elements';
3
3
  import { NDElement } from './nd-element';
4
+ import {ValidChildren} from "./validator";
4
5
 
5
6
  export interface RouteParams {
6
7
  [key: string]: string;
@@ -21,6 +22,7 @@ export interface Route {
21
22
  middlewares(): Function[];
22
23
  shouldRebuild(): boolean;
23
24
  path(): string;
25
+ layout(): Function | null;
24
26
  match(path: string): RouteParams | false;
25
27
  url(configs: { params?: RouteParams; query?: QueryParams; basePath?: string }): string;
26
28
  }
@@ -30,6 +32,7 @@ export interface RouterState {
30
32
  params: RouteParams | null;
31
33
  query: QueryParams | null;
32
34
  path: string | null;
35
+ hash: string | null;
33
36
  }
34
37
 
35
38
  export interface Router {
@@ -41,9 +44,10 @@ export interface Router {
41
44
  middlewares?: Function[];
42
45
  shouldRebuild?: boolean;
43
46
  with?: Record<string, string>;
47
+ layout?: (children: ValidChild) => ValidChild ;
44
48
  }): this;
45
49
 
46
- group(suffix: string, options: { middlewares?: Function[]; name?: string, layout?: Function }, callback: () => void): this;
50
+ group(suffix: string, options: { middlewares?: Function[]; name?: string; layout?: Function }, callback: () => void): this;
47
51
 
48
52
  generateUrl(name: string, params?: RouteParams, query?: QueryParams): string;
49
53
  resolve(target: string | { name: string; params?: RouteParams; query?: QueryParams }): {
@@ -29,6 +29,7 @@ export declare class TemplateCloner {
29
29
  style(fn: (...data: any[]) => any): BindingHydrator;
30
30
  class(fn: (...data: any[]) => any): BindingHydrator;
31
31
  value(callbackOrProperty: string | ((...data: any[]) => any)): BindingHydrator;
32
+ text(callbackOrProperty: string | ((...data: any[]) => any)): BindingHydrator;
32
33
  attr(fn: (...data: any[]) => any): BindingHydrator;
33
34
  event(fn: (event: Event, ...data: any[]) => void): BindingHydrator;
34
35
 
@@ -1,4 +1,4 @@
1
- import {ObservableChecker, ObservableItem, ObservableProxy} from "./observable";
1
+ import {ObservableArray, ObservableChecker, ObservableItem, ObservableProxy} from "./observable";
2
2
  import { ValidChild } from "./elements";
3
3
  import { NDElement } from "./nd-element";
4
4
 
@@ -14,6 +14,16 @@ declare const Validator: {
14
14
 
15
15
  isObservableChecker(value: any): value is ObservableChecker;
16
16
 
17
+ isTemplateBinding(value: any): boolean;
18
+
19
+ isObservableWhenResult(value: any): boolean;
20
+
21
+ isArrayObservable(value: any): value is ObservableArray<any>;
22
+
23
+ isObservableOrProxy(value: any): value is ObservableItem | ObservableProxy<any>;
24
+
25
+ isAnchor(value: any): boolean;
26
+
17
27
  isArray(value: any): value is Array<any>;
18
28
 
19
29
  isString(value: any): value is string;
package/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
 
2
2
  export * from './types/native-fetch';
3
- export * from './types/service';
3
+ export * from './types/service';
4
+ export * as filters from './types/filters/index';
package/utils.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import NativeFetch from "./src/fetch/NativeFetch";
2
- import { Service } from "./src/core/utils/service";
3
- import * as Filters from "./src/core/utils/filters/index";
2
+ import * as Cache from "./src/core/utils/cache";
3
+ import * as filters from "./src/core/utils/filters/index";
4
4
 
5
5
 
6
6
  export {
7
7
  NativeFetch,
8
- Service,
9
- Filters,
8
+ Cache,
9
+ filters,
10
10
  };
@@ -1,6 +0,0 @@
1
- import { autoMemoize, autoOnce } from "./memoize.js";
2
-
3
- export const Service = {
4
- once: fn => autoOnce(fn),
5
- memoize: fn => autoMemoize(fn)
6
- };