vevet 5.2.0 → 5.2.1

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 (138) hide show
  1. package/lib/cdn/vevet.iife.min.js +29 -29
  2. package/lib/cjs/base/Callbacks/index.js +6 -3
  3. package/lib/cjs/base/Callbacks/index.js.map +1 -1
  4. package/lib/cjs/base/Module/index.js +12 -10
  5. package/lib/cjs/base/Module/index.js.map +1 -1
  6. package/lib/cjs/components/Canvas/index.js +2 -2
  7. package/lib/cjs/components/Canvas/index.js.map +1 -1
  8. package/lib/cjs/components/CanvasMedia/index.js +2 -2
  9. package/lib/cjs/components/CanvasMedia/index.js.map +1 -1
  10. package/lib/cjs/components/Cursor/index.js +2 -2
  11. package/lib/cjs/components/Cursor/index.js.map +1 -1
  12. package/lib/cjs/components/InView/index.js +2 -2
  13. package/lib/cjs/components/InView/index.js.map +1 -1
  14. package/lib/cjs/components/Marquee/index.js +2 -2
  15. package/lib/cjs/components/Marquee/index.js.map +1 -1
  16. package/lib/cjs/components/Pointers/index.js +2 -2
  17. package/lib/cjs/components/Pointers/index.js.map +1 -1
  18. package/lib/cjs/components/Preloader/index.js +2 -2
  19. package/lib/cjs/components/Preloader/index.js.map +1 -1
  20. package/lib/cjs/components/ProgressPreloader/index.js +2 -2
  21. package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
  22. package/lib/cjs/components/Raf/index.js +2 -2
  23. package/lib/cjs/components/Raf/index.js.map +1 -1
  24. package/lib/cjs/components/ScrollProgress/index.js +2 -2
  25. package/lib/cjs/components/ScrollProgress/index.js.map +1 -1
  26. package/lib/cjs/components/Scrollbar/index.js +2 -2
  27. package/lib/cjs/components/Scrollbar/index.js.map +1 -1
  28. package/lib/cjs/components/Snap/index.js +2 -2
  29. package/lib/cjs/components/Snap/index.js.map +1 -1
  30. package/lib/cjs/components/SplitText/index.js +2 -2
  31. package/lib/cjs/components/SplitText/index.js.map +1 -1
  32. package/lib/cjs/components/Swipe/index.js +5 -5
  33. package/lib/cjs/components/Swipe/index.js.map +1 -1
  34. package/lib/cjs/components/Timeline/index.js +2 -2
  35. package/lib/cjs/components/Timeline/index.js.map +1 -1
  36. package/lib/cjs/manifest.json +1 -1
  37. package/lib/esm/base/Callbacks/index.js +5 -3
  38. package/lib/esm/base/Callbacks/index.js.map +1 -1
  39. package/lib/esm/base/Module/index.js +10 -8
  40. package/lib/esm/base/Module/index.js.map +1 -1
  41. package/lib/esm/components/Canvas/index.js +2 -2
  42. package/lib/esm/components/Canvas/index.js.map +1 -1
  43. package/lib/esm/components/CanvasMedia/index.js +2 -2
  44. package/lib/esm/components/CanvasMedia/index.js.map +1 -1
  45. package/lib/esm/components/Cursor/index.js +2 -2
  46. package/lib/esm/components/Cursor/index.js.map +1 -1
  47. package/lib/esm/components/InView/index.js +2 -2
  48. package/lib/esm/components/InView/index.js.map +1 -1
  49. package/lib/esm/components/Marquee/index.js +2 -2
  50. package/lib/esm/components/Marquee/index.js.map +1 -1
  51. package/lib/esm/components/Pointers/index.js +2 -2
  52. package/lib/esm/components/Pointers/index.js.map +1 -1
  53. package/lib/esm/components/Preloader/index.js +2 -2
  54. package/lib/esm/components/Preloader/index.js.map +1 -1
  55. package/lib/esm/components/ProgressPreloader/index.js +2 -2
  56. package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
  57. package/lib/esm/components/Raf/index.js +2 -2
  58. package/lib/esm/components/Raf/index.js.map +1 -1
  59. package/lib/esm/components/ScrollProgress/index.js +2 -2
  60. package/lib/esm/components/ScrollProgress/index.js.map +1 -1
  61. package/lib/esm/components/Scrollbar/index.js +2 -2
  62. package/lib/esm/components/Scrollbar/index.js.map +1 -1
  63. package/lib/esm/components/Snap/index.js +2 -2
  64. package/lib/esm/components/Snap/index.js.map +1 -1
  65. package/lib/esm/components/SplitText/index.js +2 -2
  66. package/lib/esm/components/SplitText/index.js.map +1 -1
  67. package/lib/esm/components/Swipe/index.js +5 -5
  68. package/lib/esm/components/Swipe/index.js.map +1 -1
  69. package/lib/esm/components/Timeline/index.js +2 -2
  70. package/lib/esm/components/Timeline/index.js.map +1 -1
  71. package/lib/esm/manifest.json +1 -1
  72. package/lib/types/base/Callbacks/index.d.ts +7 -5
  73. package/lib/types/base/Callbacks/index.d.ts.map +1 -1
  74. package/lib/types/base/Callbacks/types.d.ts +9 -5
  75. package/lib/types/base/Callbacks/types.d.ts.map +1 -1
  76. package/lib/types/base/Module/index.d.ts +5 -5
  77. package/lib/types/base/Module/index.d.ts.map +1 -1
  78. package/lib/types/base/Module/types.d.ts +3 -3
  79. package/lib/types/base/Module/types.d.ts.map +1 -1
  80. package/lib/types/base/Responsive/types.d.ts +2 -2
  81. package/lib/types/base/Responsive/types.d.ts.map +1 -1
  82. package/lib/types/components/Canvas/index.d.ts +5 -5
  83. package/lib/types/components/Canvas/index.d.ts.map +1 -1
  84. package/lib/types/components/CanvasMedia/index.d.ts +5 -5
  85. package/lib/types/components/CanvasMedia/index.d.ts.map +1 -1
  86. package/lib/types/components/Cursor/index.d.ts +5 -5
  87. package/lib/types/components/Cursor/index.d.ts.map +1 -1
  88. package/lib/types/components/InView/index.d.ts +5 -5
  89. package/lib/types/components/InView/index.d.ts.map +1 -1
  90. package/lib/types/components/InView/types.d.ts.map +1 -1
  91. package/lib/types/components/Marquee/index.d.ts +5 -5
  92. package/lib/types/components/Marquee/index.d.ts.map +1 -1
  93. package/lib/types/components/Pointers/index.d.ts +5 -5
  94. package/lib/types/components/Pointers/index.d.ts.map +1 -1
  95. package/lib/types/components/Preloader/index.d.ts +5 -5
  96. package/lib/types/components/Preloader/index.d.ts.map +1 -1
  97. package/lib/types/components/ProgressPreloader/index.d.ts +5 -5
  98. package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
  99. package/lib/types/components/Raf/index.d.ts +5 -5
  100. package/lib/types/components/Raf/index.d.ts.map +1 -1
  101. package/lib/types/components/ScrollProgress/index.d.ts +5 -5
  102. package/lib/types/components/ScrollProgress/index.d.ts.map +1 -1
  103. package/lib/types/components/Scrollbar/index.d.ts +5 -5
  104. package/lib/types/components/Scrollbar/index.d.ts.map +1 -1
  105. package/lib/types/components/Snap/index.d.ts +5 -5
  106. package/lib/types/components/Snap/index.d.ts.map +1 -1
  107. package/lib/types/components/SplitText/index.d.ts +5 -5
  108. package/lib/types/components/SplitText/index.d.ts.map +1 -1
  109. package/lib/types/components/Swipe/index.d.ts +5 -5
  110. package/lib/types/components/Swipe/index.d.ts.map +1 -1
  111. package/lib/types/components/Swipe/types.d.ts +5 -0
  112. package/lib/types/components/Swipe/types.d.ts.map +1 -1
  113. package/lib/types/components/Timeline/index.d.ts +5 -5
  114. package/lib/types/components/Timeline/index.d.ts.map +1 -1
  115. package/package.json +1 -1
  116. package/src/base/Callbacks/index.ts +15 -7
  117. package/src/base/Callbacks/types.ts +12 -7
  118. package/src/base/Module/index.ts +24 -15
  119. package/src/base/Module/types.ts +3 -3
  120. package/src/base/Responsive/types.ts +4 -5
  121. package/src/components/Canvas/index.ts +12 -11
  122. package/src/components/CanvasMedia/index.ts +12 -11
  123. package/src/components/Cursor/index.ts +12 -11
  124. package/src/components/InView/index.ts +12 -11
  125. package/src/components/InView/types.ts +2 -6
  126. package/src/components/Marquee/index.ts +12 -11
  127. package/src/components/Pointers/index.ts +12 -11
  128. package/src/components/Preloader/index.ts +12 -11
  129. package/src/components/ProgressPreloader/index.ts +12 -14
  130. package/src/components/Raf/index.ts +14 -13
  131. package/src/components/ScrollProgress/index.ts +12 -13
  132. package/src/components/Scrollbar/index.ts +12 -11
  133. package/src/components/Snap/index.ts +12 -11
  134. package/src/components/SplitText/index.ts +12 -11
  135. package/src/components/Swipe/index.ts +15 -13
  136. package/src/components/Swipe/types.ts +6 -0
  137. package/src/components/Timeline/index.ts +12 -11
  138. package/src/manifest.json +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  IScrollProgressMutableProps,
5
5
  IScrollProgressStaticProps,
6
6
  } from './types';
7
- import { Module, TModuleCallbacksProps } from '@/base';
7
+ import { Module, TModuleOnCallbacksProps } from '@/base';
8
8
  import { TRequiredProps } from '@/internal/requiredProps';
9
9
  import { initVevet } from '@/global/initVevet';
10
10
  import { addEventListener, clampScope } from '@/utils';
@@ -22,25 +22,23 @@ export * from './types';
22
22
  * @group Components
23
23
  */
24
24
  export class ScrollProgress<
25
- CallbacksMap extends
26
- IScrollProgressCallbacksMap = IScrollProgressCallbacksMap,
27
- StaticProps extends IScrollProgressStaticProps = IScrollProgressStaticProps,
28
- MutableProps extends
29
- IScrollProgressMutableProps = IScrollProgressMutableProps,
30
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
25
+ C extends IScrollProgressCallbacksMap = IScrollProgressCallbacksMap,
26
+ S extends IScrollProgressStaticProps = IScrollProgressStaticProps,
27
+ M extends IScrollProgressMutableProps = IScrollProgressMutableProps,
28
+ > extends Module<C, S, M> {
31
29
  /** Retrieves the default static properties. */
32
- public _getStatic(): TRequiredProps<StaticProps> {
30
+ public _getStatic(): TRequiredProps<S> {
33
31
  return {
34
32
  ...super._getStatic(),
35
33
  root: null,
36
34
  optimized: true,
37
35
  useSvh: false,
38
- } as TRequiredProps<StaticProps>;
36
+ } as TRequiredProps<S>;
39
37
  }
40
38
 
41
39
  /** Retrieves the default mutable properties. */
42
- public _getMutable(): TRequiredProps<MutableProps> {
43
- return { ...super._getMutable() } as TRequiredProps<MutableProps>;
40
+ public _getMutable(): TRequiredProps<M> {
41
+ return { ...super._getMutable() } as TRequiredProps<M>;
44
42
  }
45
43
 
46
44
  /**
@@ -85,9 +83,10 @@ export class ScrollProgress<
85
83
  }
86
84
 
87
85
  constructor(
88
- props?: StaticProps & MutableProps & TModuleCallbacksProps<CallbacksMap>,
86
+ props?: S & M,
87
+ onCallbacks?: TModuleOnCallbacksProps<C, ScrollProgress<C, S, M>>,
89
88
  ) {
90
- super(props);
89
+ super(props, onCallbacks as any);
91
90
 
92
91
  this._isVisible = !this.props.optimized;
93
92
 
@@ -1,5 +1,5 @@
1
1
  import { TRequiredProps } from '@/internal/requiredProps';
2
- import { Module, TModuleCallbacksProps } from '@/base';
2
+ import { Module, TModuleOnCallbacksProps } from '@/base';
3
3
  import {
4
4
  IScrollbarCallbacksMap,
5
5
  IScrollbarMutableProps,
@@ -24,12 +24,12 @@ export * from './types';
24
24
  * @group Components
25
25
  */
26
26
  export class Scrollbar<
27
- CallbacksMap extends IScrollbarCallbacksMap = IScrollbarCallbacksMap,
28
- StaticProps extends IScrollbarStaticProps = IScrollbarStaticProps,
29
- MutableProps extends IScrollbarMutableProps = IScrollbarMutableProps,
30
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
27
+ C extends IScrollbarCallbacksMap = IScrollbarCallbacksMap,
28
+ S extends IScrollbarStaticProps = IScrollbarStaticProps,
29
+ M extends IScrollbarMutableProps = IScrollbarMutableProps,
30
+ > extends Module<C, S, M> {
31
31
  /** Get default static properties. */
32
- public _getStatic(): TRequiredProps<StaticProps> {
32
+ public _getStatic(): TRequiredProps<S> {
33
33
  return {
34
34
  ...super._getStatic(),
35
35
  container: window,
@@ -39,16 +39,16 @@ export class Scrollbar<
39
39
  draggable: true,
40
40
  autoHide: true,
41
41
  resizeDebounce: 10,
42
- } as TRequiredProps<StaticProps>;
42
+ } as TRequiredProps<S>;
43
43
  }
44
44
 
45
45
  /** Get default mutable properties. */
46
- public _getMutable(): TRequiredProps<MutableProps> {
46
+ public _getMutable(): TRequiredProps<M> {
47
47
  return {
48
48
  ...super._getMutable(),
49
49
  minSize: 50,
50
50
  autoSize: true,
51
- } as TRequiredProps<MutableProps>;
51
+ } as TRequiredProps<M>;
52
52
  }
53
53
 
54
54
  get prefix() {
@@ -114,9 +114,10 @@ export class Scrollbar<
114
114
  protected _isRtl = false;
115
115
 
116
116
  constructor(
117
- props?: StaticProps & MutableProps & TModuleCallbacksProps<CallbacksMap>,
117
+ props?: S & M,
118
+ onCallbacks?: TModuleOnCallbacksProps<C, Scrollbar<C, S, M>>,
118
119
  ) {
119
- super(props);
120
+ super(props, onCallbacks as any);
120
121
 
121
122
  // detect features
122
123
  this._isRtl = getTextDirection(this.parent) === 'rtl';
@@ -1,4 +1,4 @@
1
- import { Module, TModuleCallbacksProps } from '@/base';
1
+ import { Module, TModuleOnCallbacksProps } from '@/base';
2
2
  import { Timeline } from '../Timeline';
3
3
  import {
4
4
  ISnapCallbacksMap,
@@ -50,21 +50,21 @@ export * from './Slide';
50
50
  * @group Components
51
51
  */
52
52
  export class Snap<
53
- CallbacksMap extends ISnapCallbacksMap = ISnapCallbacksMap,
54
- StaticProps extends ISnapStaticProps = ISnapStaticProps,
55
- MutableProps extends ISnapMutableProps = ISnapMutableProps,
56
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
53
+ C extends ISnapCallbacksMap = ISnapCallbacksMap,
54
+ S extends ISnapStaticProps = ISnapStaticProps,
55
+ M extends ISnapMutableProps = ISnapMutableProps,
56
+ > extends Module<C, S, M> {
57
57
  /** Retrieves the default static properties. */
58
- public _getStatic(): TRequiredProps<StaticProps> {
58
+ public _getStatic(): TRequiredProps<S> {
59
59
  return {
60
60
  ...super._getStatic(),
61
61
  eventsEmitter: null,
62
62
  activeIndex: 0,
63
- } as TRequiredProps<StaticProps>;
63
+ } as TRequiredProps<S>;
64
64
  }
65
65
 
66
66
  /** Retrieves the default mutable properties. */
67
- public _getMutable(): TRequiredProps<MutableProps> {
67
+ public _getMutable(): TRequiredProps<M> {
68
68
  return {
69
69
  ...super._getMutable(),
70
70
  slides: false,
@@ -100,7 +100,7 @@ export class Snap<
100
100
  stickOnWheelEnd: true,
101
101
  stickOnWheelEndThreshold: 30,
102
102
  slideSize: 'auto',
103
- } as TRequiredProps<MutableProps>;
103
+ } as TRequiredProps<M>;
104
104
  }
105
105
 
106
106
  /** Animation frame for smooth animations */
@@ -140,9 +140,10 @@ export class Snap<
140
140
  protected _targetIndex?: number;
141
141
 
142
142
  constructor(
143
- props?: StaticProps & MutableProps & TModuleCallbacksProps<CallbacksMap>,
143
+ props?: S & M,
144
+ onCallbacks?: TModuleOnCallbacksProps<C, Snap<C, S, M>>,
144
145
  ) {
145
- super(props);
146
+ super(props, onCallbacks as any);
146
147
 
147
148
  const { container, activeIndex } = this.props;
148
149
 
@@ -9,7 +9,7 @@ import {
9
9
  ISplitTextStaticProps,
10
10
  ISplitTextWordMeta,
11
11
  } from './types';
12
- import { Module, TModuleCallbacksProps } from '@/base';
12
+ import { Module, TModuleOnCallbacksProps } from '@/base';
13
13
  import { TRequiredProps } from '@/internal/requiredProps';
14
14
  import { initVevet } from '@/global/initVevet';
15
15
  import { saveInitialNodes } from './utils/saveInitialNodes';
@@ -33,14 +33,14 @@ export * from './types';
33
33
  * @group Components
34
34
  */
35
35
  export class SplitText<
36
- CallbacksMap extends ISplitTextCallbacksMap = ISplitTextCallbacksMap,
37
- StaticProps extends ISplitTextStaticProps = ISplitTextStaticProps,
38
- MutableProps extends ISplitTextMutableProps = ISplitTextMutableProps,
39
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
36
+ C extends ISplitTextCallbacksMap = ISplitTextCallbacksMap,
37
+ S extends ISplitTextStaticProps = ISplitTextStaticProps,
38
+ M extends ISplitTextMutableProps = ISplitTextMutableProps,
39
+ > extends Module<C, S, M> {
40
40
  /**
41
41
  * Retrieves the default static properties.
42
42
  */
43
- public _getStatic(): TRequiredProps<StaticProps> {
43
+ public _getStatic(): TRequiredProps<S> {
44
44
  return {
45
45
  ...super._getStatic(),
46
46
  letters: false,
@@ -58,14 +58,14 @@ export class SplitText<
58
58
  prepareText: (text) => text,
59
59
  wordDelimiter: String.fromCharCode(32),
60
60
  wordDelimiterOutput: null,
61
- } as TRequiredProps<StaticProps>;
61
+ } as TRequiredProps<S>;
62
62
  }
63
63
 
64
64
  /**
65
65
  * Retrieves the default mutable properties.
66
66
  */
67
- public _getMutable(): TRequiredProps<MutableProps> {
68
- return { ...super._getMutable() } as TRequiredProps<MutableProps>;
67
+ public _getMutable(): TRequiredProps<M> {
68
+ return { ...super._getMutable() } as TRequiredProps<M>;
69
69
  }
70
70
 
71
71
  /**
@@ -151,9 +151,10 @@ export class SplitText<
151
151
  * Initializes the SplitText instance and saves the initial state.
152
152
  */
153
153
  constructor(
154
- props?: StaticProps & MutableProps & TModuleCallbacksProps<CallbacksMap>,
154
+ props?: S & M,
155
+ onCallbacks?: TModuleOnCallbacksProps<C, SplitText<C, S, M>>,
155
156
  ) {
156
- super(props);
157
+ super(props, onCallbacks as any);
157
158
 
158
159
  const { container } = this.props;
159
160
  const { style } = container;
@@ -1,4 +1,4 @@
1
- import { Module, TModuleCallbacksProps } from '@/base';
1
+ import { Module, TModuleOnCallbacksProps } from '@/base';
2
2
  import { TRequiredProps } from '@/internal/requiredProps';
3
3
  import {
4
4
  ISwipeCallbacksMap,
@@ -35,26 +35,27 @@ const VELOCITIES_COUNT = 4;
35
35
  * @group Components
36
36
  */
37
37
  export class Swipe<
38
- CallbacksMap extends ISwipeCallbacksMap = ISwipeCallbacksMap,
39
- StaticProps extends ISwipeStaticProps = ISwipeStaticProps,
40
- MutableProps extends ISwipeMutableProps = ISwipeMutableProps,
41
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
38
+ C extends ISwipeCallbacksMap = ISwipeCallbacksMap,
39
+ S extends ISwipeStaticProps = ISwipeStaticProps,
40
+ M extends ISwipeMutableProps = ISwipeMutableProps,
41
+ > extends Module<C, S, M> {
42
42
  /**
43
43
  * Returns default static properties.
44
44
  */
45
- public _getStatic(): TRequiredProps<StaticProps> {
45
+ public _getStatic(): TRequiredProps<S> {
46
46
  return {
47
47
  ...super._getStatic(),
48
+ thumb: null,
48
49
  buttons: [0],
49
50
  pointers: 1,
50
51
  disableUserSelect: true,
51
- } as TRequiredProps<StaticProps>;
52
+ } as TRequiredProps<S>;
52
53
  }
53
54
 
54
55
  /**
55
56
  * Returns default mutable properties.
56
57
  */
57
- public _getMutable(): TRequiredProps<MutableProps> {
58
+ public _getMutable(): TRequiredProps<M> {
58
59
  return {
59
60
  ...super._getMutable(),
60
61
  enabled: true,
@@ -77,7 +78,7 @@ export class Swipe<
77
78
  distanceModifier: false,
78
79
  inertiaRatio: 1,
79
80
  inertiaDistanceThreshold: 50,
80
- } as TRequiredProps<MutableProps>;
81
+ } as TRequiredProps<M>;
81
82
  }
82
83
 
83
84
  /** Pointer event manager */
@@ -128,11 +129,12 @@ export class Swipe<
128
129
  protected _cursorStyles: HTMLStyleElement;
129
130
 
130
131
  constructor(
131
- props?: StaticProps & MutableProps & TModuleCallbacksProps<CallbacksMap>,
132
+ props?: S & M,
133
+ onCallbacks?: TModuleOnCallbacksProps<C, Swipe<C, S, M>>,
132
134
  ) {
133
- super(props);
135
+ super(props, onCallbacks as any);
134
136
 
135
- const { container, buttons, pointers } = this.props;
137
+ const { container, thumb, buttons, pointers } = this.props;
136
138
 
137
139
  // set default data
138
140
  this._coords = {
@@ -151,7 +153,7 @@ export class Swipe<
151
153
 
152
154
  // create pointers
153
155
  this._pointers = new Pointers({
154
- container,
156
+ container: thumb || container,
155
157
  buttons,
156
158
  minPointers: pointers,
157
159
  maxPointers: pointers,
@@ -9,6 +9,12 @@ export interface ISwipeStaticProps extends IModuleStaticProps {
9
9
  /** Event listener container. */
10
10
  container: HTMLElement | SVGElement;
11
11
 
12
+ /**
13
+ * An element that triggers the swipe start.
14
+ * Calculations remain relative to the container regardless of this element.
15
+ */
16
+ thumb?: HTMLElement | SVGElement | null;
17
+
12
18
  /**
13
19
  * Determines which mouse buttons trigger events.
14
20
  * - 0: Main button pressed, usually the left button or the un-initialized state
@@ -1,5 +1,5 @@
1
1
  import { TRequiredProps } from '@/internal/requiredProps';
2
- import { Module, TModuleCallbacksProps } from '@/base/Module';
2
+ import { Module, TModuleOnCallbacksProps } from '@/base/Module';
3
3
  import { clamp, easing } from '@/utils/math';
4
4
  import {
5
5
  ITimelineCallbacksMap,
@@ -21,22 +21,22 @@ export * from './types';
21
21
  * @group Components
22
22
  */
23
23
  export class Timeline<
24
- CallbacksMap extends ITimelineCallbacksMap = ITimelineCallbacksMap,
25
- StaticProps extends ITimelineStaticProps = ITimelineStaticProps,
26
- MutableProps extends ITimelineMutableProps = ITimelineMutableProps,
27
- > extends Module<CallbacksMap, StaticProps, MutableProps> {
24
+ C extends ITimelineCallbacksMap = ITimelineCallbacksMap,
25
+ S extends ITimelineStaticProps = ITimelineStaticProps,
26
+ M extends ITimelineMutableProps = ITimelineMutableProps,
27
+ > extends Module<C, S, M> {
28
28
  /** Get default static properties. */
29
- public _getStatic(): TRequiredProps<StaticProps> {
30
- return { ...super._getStatic() } as TRequiredProps<StaticProps>;
29
+ public _getStatic(): TRequiredProps<S> {
30
+ return { ...super._getStatic() } as TRequiredProps<S>;
31
31
  }
32
32
 
33
33
  /** Get default mutable properties. */
34
- public _getMutable(): TRequiredProps<MutableProps> {
34
+ public _getMutable(): TRequiredProps<M> {
35
35
  return {
36
36
  ...super._getMutable(),
37
37
  easing: initVevet().props.easing,
38
38
  duration: 1000,
39
- } as TRequiredProps<MutableProps>;
39
+ } as TRequiredProps<M>;
40
40
  }
41
41
 
42
42
  /** Current linear progress of the timeline (0 to 1). */
@@ -113,9 +113,10 @@ export class Timeline<
113
113
  }
114
114
 
115
115
  constructor(
116
- props?: StaticProps & MutableProps & TModuleCallbacksProps<CallbacksMap>,
116
+ props?: S & M,
117
+ onCallbacks?: TModuleOnCallbacksProps<C, Timeline<C, S, M>>,
117
118
  ) {
118
- super(props);
119
+ super(props, onCallbacks as any);
119
120
 
120
121
  // Initialize default values
121
122
  this._progress = 0;
package/src/manifest.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.2.0"
2
+ "version": "5.2.1"
3
3
  }