@studiometa/js-toolkit 2.0.0-rc.1 → 2.0.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 (109) hide show
  1. package/Base/index.cjs +1 -2
  2. package/Base/index.d.ts +25 -26
  3. package/Base/index.js +1 -2
  4. package/Base/managers/ChildrenManager.d.ts +2 -2
  5. package/Base/managers/EventsManager.d.ts +13 -20
  6. package/Base/managers/OptionsManager.cjs +0 -1
  7. package/Base/managers/OptionsManager.d.ts +13 -10
  8. package/Base/managers/OptionsManager.js +0 -1
  9. package/Base/managers/RefsManager.d.ts +4 -4
  10. package/Base/managers/ServicesManager.cjs +3 -0
  11. package/Base/managers/ServicesManager.d.ts +14 -8
  12. package/Base/managers/ServicesManager.js +3 -0
  13. package/Base/utils.d.ts +4 -4
  14. package/decorators/withBreakpointManager.cjs +0 -1
  15. package/decorators/withBreakpointManager.d.ts +2 -2
  16. package/decorators/withBreakpointManager.js +0 -1
  17. package/decorators/withBreakpointObserver.cjs +1 -2
  18. package/decorators/withBreakpointObserver.d.ts +1 -1
  19. package/decorators/withBreakpointObserver.js +1 -2
  20. package/decorators/withDrag.d.ts +1 -1
  21. package/decorators/withExtraConfig.d.ts +1 -1
  22. package/decorators/withFreezedOptions.cjs +13 -3
  23. package/decorators/withFreezedOptions.d.ts +1 -1
  24. package/decorators/withFreezedOptions.js +14 -3
  25. package/decorators/withIntersectionObserver.cjs +0 -1
  26. package/decorators/withIntersectionObserver.d.ts +1 -1
  27. package/decorators/withIntersectionObserver.js +0 -1
  28. package/decorators/withMountWhenInView.cjs +0 -1
  29. package/decorators/withMountWhenInView.d.ts +1 -1
  30. package/decorators/withMountWhenInView.js +0 -1
  31. package/decorators/withScrolledInView.d.ts +1 -1
  32. package/decorators/withVue2.cjs +2 -1
  33. package/decorators/withVue2.js +2 -1
  34. package/helpers/createApp.d.ts +3 -26
  35. package/helpers/getInstanceFromElement.cjs +32 -0
  36. package/helpers/getInstanceFromElement.d.ts +14 -0
  37. package/helpers/getInstanceFromElement.js +10 -0
  38. package/helpers/importOnInteraction.d.ts +3 -5
  39. package/helpers/importWhenIdle.d.ts +3 -5
  40. package/helpers/importWhenVisible.d.ts +4 -6
  41. package/helpers/index.cjs +2 -0
  42. package/helpers/index.d.ts +1 -0
  43. package/helpers/index.js +8 -6
  44. package/helpers/utils.d.ts +3 -4
  45. package/package.json +1 -1
  46. package/services/Service.d.ts +9 -9
  47. package/services/drag.cjs +0 -1
  48. package/services/drag.d.ts +3 -3
  49. package/services/drag.js +0 -1
  50. package/services/key.d.ts +1 -1
  51. package/services/load.d.ts +1 -1
  52. package/services/pointer.d.ts +1 -1
  53. package/services/raf.d.ts +1 -1
  54. package/services/resize.cjs +2 -2
  55. package/services/resize.d.ts +1 -1
  56. package/services/resize.js +2 -2
  57. package/services/scroll.cjs +3 -1
  58. package/services/scroll.d.ts +1 -1
  59. package/services/scroll.js +3 -1
  60. package/utils/collide/boundingRectToCircle.d.ts +5 -5
  61. package/utils/collide/collideCircleCircle.d.ts +4 -4
  62. package/utils/collide/collideCircleRect.d.ts +8 -8
  63. package/utils/collide/collidePointCircle.d.ts +6 -6
  64. package/utils/collide/collidePointRect.d.ts +7 -7
  65. package/utils/collide/collideRectRect.d.ts +5 -5
  66. package/utils/css/classes.cjs +3 -3
  67. package/utils/css/classes.d.ts +10 -10
  68. package/utils/css/classes.js +3 -3
  69. package/utils/css/matrix.d.ts +14 -15
  70. package/utils/css/styles.d.ts +2 -2
  71. package/utils/css/transition.cjs +2 -0
  72. package/utils/css/transition.d.ts +2 -2
  73. package/utils/css/transition.js +2 -0
  74. package/utils/debounce.d.ts +4 -4
  75. package/utils/focusTrap.cjs +1 -1
  76. package/utils/focusTrap.d.ts +1 -0
  77. package/utils/focusTrap.js +1 -1
  78. package/utils/history.d.ts +13 -11
  79. package/utils/math/clamp.d.ts +1 -1
  80. package/utils/math/clamp01.d.ts +1 -1
  81. package/utils/math/damp.d.ts +6 -6
  82. package/utils/math/ease.d.ts +7 -7
  83. package/utils/math/inertiaFinalValue.d.ts +5 -5
  84. package/utils/math/lerp.d.ts +4 -4
  85. package/utils/math/map.d.ts +6 -6
  86. package/utils/math/round.d.ts +4 -4
  87. package/utils/memoize.d.ts +1 -1
  88. package/utils/nextFrame.d.ts +3 -4
  89. package/utils/nextMicrotask.d.ts +1 -1
  90. package/utils/nextTick.d.ts +1 -1
  91. package/utils/object/autoBind.d.ts +3 -3
  92. package/utils/object/getAllProperties.d.ts +3 -3
  93. package/utils/object/isObject.d.ts +1 -1
  94. package/utils/scrollTo.cjs +1 -1
  95. package/utils/scrollTo.d.ts +1 -1
  96. package/utils/scrollTo.js +1 -1
  97. package/utils/string/withLeadingCharacters.d.ts +3 -2
  98. package/utils/string/withLeadingSlash.d.ts +1 -1
  99. package/utils/string/withTrailingCharacters.d.ts +3 -2
  100. package/utils/string/withTrailingSlash.d.ts +1 -1
  101. package/utils/string/withoutLeadingCharacters.d.ts +3 -2
  102. package/utils/string/withoutLeadingCharactersRecursive.d.ts +3 -2
  103. package/utils/string/withoutLeadingSlash.d.ts +1 -1
  104. package/utils/string/withoutTrailingCharacters.d.ts +3 -2
  105. package/utils/string/withoutTrailingCharactersRecursive.d.ts +3 -2
  106. package/utils/string/withoutTrailingSlash.d.ts +1 -1
  107. package/utils/throttle.cjs +1 -1
  108. package/utils/throttle.d.ts +3 -3
  109. package/utils/throttle.js +1 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @typedef {Object} Circle
3
- * @property {Number} x Circle's x position
4
- * @property {Number} y Circle's y position
5
- * @property {Number} radius Circle's radius
3
+ * @property {number} x Circle's x position
4
+ * @property {number} y Circle's y position
5
+ * @property {number} radius Circle's radius
6
6
  */
7
7
  /**
8
8
  * Test if a circle collides with another.
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * @param {Circle} circle1 Circle 1
12
12
  * @param {Circle} circle2 Circle 2
13
- * @return {boolean} Are the sides of one circle touching the other ?
13
+ * @returns {boolean} Are the sides of one circle touching the other ?
14
14
  */
15
15
  export default function collideCircleCircle(circle1: Circle, circle2: Circle): boolean;
16
16
  export type Circle = {
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * @typedef {Object} Rect
3
- * @property {Number} x Rectangle's x position
4
- * @property {Number} y Rectangle's y position
5
- * @property {Number} width Rectangle's width
6
- * @property {Number} height Rectangle's height
3
+ * @property {number} x Rectangle's x position
4
+ * @property {number} y Rectangle's y position
5
+ * @property {number} width Rectangle's width
6
+ * @property {number} height Rectangle's height
7
7
  */
8
8
  /**
9
9
  * @typedef {Object} Circle
10
- * @property {Number} x Circle's x position
11
- * @property {Number} y Circle's y position
12
- * @property {Number} radius Circle's radius
10
+ * @property {number} x Circle's x position
11
+ * @property {number} y Circle's y position
12
+ * @property {number} radius Circle's radius
13
13
  */
14
14
  /**
15
15
  * Test if a circle collides with a rectangle.
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * @param {Circle} circle Circle
19
19
  * @param {Rect} rect Rectangle
20
- * @return {boolean} Are the sides of the circle touching the rectangle ?
20
+ * @returns {boolean} Are the sides of the circle touching the rectangle ?
21
21
  */
22
22
  export default function collideCircleRect(circle: Circle, rect: Rect): boolean;
23
23
  export type Rect = {
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @typedef {Object} Point
3
- * @property {Number} x Point's x position
4
- * @property {Number} y Point's y position
3
+ * @property {number} x Point's x position
4
+ * @property {number} y Point's y position
5
5
  */
6
6
  /**
7
7
  * @typedef {Object} Circle
8
- * @property {Number} x Circle's x position
9
- * @property {Number} y Circle's y position
10
- * @property {Number} radius Circle's radius
8
+ * @property {number} x Circle's x position
9
+ * @property {number} y Circle's y position
10
+ * @property {number} radius Circle's radius
11
11
  */
12
12
  /**
13
13
  * Test if a point is inside a circle.
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * @param {Point} point Point
17
17
  * @param {Circle} circle Circle
18
- * @return {boolean} Is the point inside the circle's bounds ?
18
+ * @returns {boolean} Is the point inside the circle's bounds ?
19
19
  */
20
20
  export default function collidePointCircle(point: Point, circle: Circle): boolean;
21
21
  export type Point = {
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * @typedef {Object} Point
3
- * @property {Number} x Point's x position
4
- * @property {Number} y Point's y position
3
+ * @property {number} x Point's x position
4
+ * @property {number} y Point's y position
5
5
  */
6
6
  /**
7
7
  * @typedef {Object} Rect
8
- * @property {Number} x Rectangle's x position
9
- * @property {Number} y Rectangle's y position
10
- * @property {Number} width Rectangle's width
11
- * @property {Number} height Rectangle's height
8
+ * @property {number} x Rectangle's x position
9
+ * @property {number} y Rectangle's y position
10
+ * @property {number} width Rectangle's width
11
+ * @property {number} height Rectangle's height
12
12
  */
13
13
  /**
14
14
  * Test if a point collides with a rectangle.
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * @param {Point} point Point
18
18
  * @param {Rect} rect Rectangle
19
- * @return {boolean} Is the point inside the rectangle's bounds ?
19
+ * @returns {boolean} Is the point inside the rectangle's bounds ?
20
20
  */
21
21
  export default function collidePointRect(point: Point, rect: Rect): boolean;
22
22
  export type Point = {
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @typedef {Object} Rect
3
- * @property {Number} x Rectangle's x position
4
- * @property {Number} y Rectangle's y position
5
- * @property {Number} width Rectangle's width
6
- * @property {Number} height Rectangle's height
3
+ * @property {number} x Rectangle's x position
4
+ * @property {number} y Rectangle's y position
5
+ * @property {number} width Rectangle's width
6
+ * @property {number} height Rectangle's height
7
7
  */
8
8
  /**
9
9
  * Test if a rectangle collides with another rectangle.
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * @param {Rect} rect1 Rectangle 1
13
13
  * @param {Rect} rect2 Rectangle 2
14
- * @return {boolean} Are the sides of one rectangle touching the other ?
14
+ * @returns {boolean} Are the sides of one rectangle touching the other ?
15
15
  */
16
16
  export default function collideRectRect(rect1: Rect, rect2: Rect): boolean;
17
17
  export type Rect = {
@@ -24,7 +24,7 @@ __export(classes_exports, {
24
24
  toggle: () => toggle
25
25
  });
26
26
  module.exports = __toCommonJS(classes_exports);
27
- function setClasses(element, classNames, method = "add", forceToggle = void 0) {
27
+ function setClasses(element, classNames, method, forceToggle) {
28
28
  if (!element || !classNames) {
29
29
  return;
30
30
  }
@@ -36,12 +36,12 @@ function setClasses(element, classNames, method = "add", forceToggle = void 0) {
36
36
  }
37
37
  }
38
38
  function add(element, classNames) {
39
- setClasses(element, classNames);
39
+ setClasses(element, classNames, "add");
40
40
  }
41
41
  function remove(element, classNames) {
42
42
  setClasses(element, classNames, "remove");
43
43
  }
44
- function toggle(element, classNames, force = void 0) {
44
+ function toggle(element, classNames, force) {
45
45
  setClasses(element, classNames, "toggle", force);
46
46
  }
47
47
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,25 +1,25 @@
1
1
  /**
2
2
  * Add class names to an element.
3
3
  *
4
- * @param {HTMLElement} element The element to update.
5
- * @param {string|string[]} classNames A string of class names.
6
- * @return {void}
4
+ * @param {HTMLElement} element The element to update.
5
+ * @param {string|string[]} classNames A string of class names.
6
+ * @returns {void}
7
7
  */
8
8
  export function add(element: HTMLElement, classNames: string | string[]): void;
9
9
  /**
10
10
  * Remove class names from an element.
11
11
  *
12
- * @param {HTMLElement} element The element to update.
13
- * @param {string|string[]} classNames A string of class names.
14
- * @return {void}
12
+ * @param {HTMLElement} element The element to update.
13
+ * @param {string|string[]} classNames A string of class names.
14
+ * @returns {void}
15
15
  */
16
16
  export function remove(element: HTMLElement, classNames: string | string[]): void;
17
17
  /**
18
18
  * Toggle class names from an element.
19
19
  *
20
- * @param {HTMLElement} element The element to update.
21
- * @param {string|string[]} classNames A string of class names.
22
- * @param {boolean} [force] Force toggle?
23
- * @return {void}
20
+ * @param {HTMLElement} element The element to update.
21
+ * @param {string|string[]} classNames A string of class names.
22
+ * @param {boolean} [force] Force toggle?
23
+ * @returns {void}
24
24
  */
25
25
  export function toggle(element: HTMLElement, classNames: string | string[], force?: boolean): void;
@@ -1,4 +1,4 @@
1
- function setClasses(element, classNames, method = "add", forceToggle = void 0) {
1
+ function setClasses(element, classNames, method, forceToggle) {
2
2
  if (!element || !classNames) {
3
3
  return;
4
4
  }
@@ -10,12 +10,12 @@ function setClasses(element, classNames, method = "add", forceToggle = void 0) {
10
10
  }
11
11
  }
12
12
  function add(element, classNames) {
13
- setClasses(element, classNames);
13
+ setClasses(element, classNames, "add");
14
14
  }
15
15
  function remove(element, classNames) {
16
16
  setClasses(element, classNames, "remove");
17
17
  }
18
- function toggle(element, classNames, force = void 0) {
18
+ function toggle(element, classNames, force) {
19
19
  setClasses(element, classNames, "toggle", force);
20
20
  }
21
21
  export {
@@ -1,15 +1,14 @@
1
1
  /**
2
2
  * Format a CSS transform matrix with the given values.
3
3
  *
4
- * @param {Object} transform
5
- * @param {Number=} [transform.scaleX=1] The scale on the x axis.
6
- * @param {Number=} [transform.scaleY=1] The scale on the y axis.
7
- * @param {Number=} [transform.skewX=0] The skew on the x axis.
8
- * @param {Number=} [transform.skewY=0] The skew on the y axis.
9
- * @param {Number=} [transform.translateX=0] The translate on the x axis.
10
- * @param {Number=} [transform.translateY=0] The translate on the y axis.
11
- * @return {String} A formatted CSS matrix transform.
12
- *
4
+ * @param {Object} transform
5
+ * @param {number} [transform.scaleX=1] The scale on the x axis.
6
+ * @param {number} [transform.scaleY=1] The scale on the y axis.
7
+ * @param {number} [transform.skewX=0] The skew on the x axis.
8
+ * @param {number} [transform.skewY=0] The skew on the y axis.
9
+ * @param {number} [transform.translateX=0] The translate on the x axis.
10
+ * @param {number} [transform.translateY=0] The translate on the y axis.
11
+ * @returns {string} A formatted CSS matrix transform.
13
12
  * @example
14
13
  * ```js
15
14
  * matrix({ scaleX: 0.5, scaleY: 0.5 });
@@ -17,10 +16,10 @@
17
16
  * ```
18
17
  */
19
18
  export default function matrix(transform: {
20
- scaleX?: number | undefined;
21
- scaleY?: number | undefined;
22
- skewX?: number | undefined;
23
- skewY?: number | undefined;
24
- translateX?: number | undefined;
25
- translateY?: number | undefined;
19
+ scaleX?: number;
20
+ scaleY?: number;
21
+ skewX?: number;
22
+ skewY?: number;
23
+ translateX?: number;
24
+ translateY?: number;
26
25
  }): string;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @param {HTMLElement} element The element to update.
5
5
  * @param {Partial<CSSStyleDeclaration>} styles A string of class names.
6
- * @return {void}
6
+ * @returns {void}
7
7
  */
8
8
  export function add(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
9
9
  /**
@@ -11,6 +11,6 @@ export function add(element: HTMLElement, styles: Partial<CSSStyleDeclaration>):
11
11
  *
12
12
  * @param {HTMLElement} element The element to update.
13
13
  * @param {Partial<CSSStyleDeclaration>} styles A string of class names.
14
- * @return {void}
14
+ * @returns {void}
15
15
  */
16
16
  export function remove(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
@@ -68,8 +68,10 @@ async function start(element, classesOrStyles) {
68
68
  trs.isTransitioning = true;
69
69
  setClassesOrStyles(element, classesOrStyles.from);
70
70
  await (0, import_nextFrame.default)();
71
+ await (0, import_nextFrame.default)();
71
72
  setClassesOrStyles(element, classesOrStyles.active);
72
73
  await (0, import_nextFrame.default)();
74
+ await (0, import_nextFrame.default)();
73
75
  }
74
76
  async function next(element, classesOrStyles) {
75
77
  const hasTransition = testTransition(element);
@@ -14,8 +14,8 @@ export function setClassesOrStyles(element: HTMLElement, classesOrStyles: Classe
14
14
  *
15
15
  * @param {HTMLElement} element The target element.
16
16
  * @param {string|TransitionStyles} name The name of the transition or an object with the hooks classesOrStyles.
17
- * @param {String} endMode Whether to remove or keep the `to` classes/styles
18
- * @return {Promise<void>} A promise resolving at the end of the transition.
17
+ * @param {string} endMode Whether to remove or keep the `to` classes/styles
18
+ * @returns {Promise<void>} A promise resolving at the end of the transition.
19
19
  */
20
20
  export default function transition(element: HTMLElement, name: string | TransitionStyles, endMode?: string): Promise<void>;
21
21
  export type ClassesOrStyles = string | string[] | Partial<CSSStyleDeclaration>;
@@ -41,8 +41,10 @@ async function start(element, classesOrStyles) {
41
41
  trs.isTransitioning = true;
42
42
  setClassesOrStyles(element, classesOrStyles.from);
43
43
  await nextFrame();
44
+ await nextFrame();
44
45
  setClassesOrStyles(element, classesOrStyles.active);
45
46
  await nextFrame();
47
+ await nextFrame();
46
48
  }
47
49
  async function next(element, classesOrStyles) {
48
50
  const hasTransition = testTransition(element);
@@ -3,8 +3,8 @@
3
3
  * will not be triggered. The function will be called after it stops
4
4
  * being called for N milliseconds.
5
5
  *
6
- * @param {(...args:any[]) => void} fn The function to call.
7
- * @param {Number=} [delay=300] The delay in ms to wait before calling the function.
8
- * @return {(...args:any[]) => void} The debounced function.
6
+ * @param {(...args:any[]) => void} fn The function to call.
7
+ * @param {number} [delay=300] The delay in ms to wait before calling the function.
8
+ * @returns {(...args:any[]) => void} The debounced function.
9
9
  */
10
- export default function debounce(fn: (...args: any[]) => void, delay?: number | undefined): (...args: any[]) => void;
10
+ export default function debounce(fn: (...args: any[]) => void, delay?: number): (...args: any[]) => void;
@@ -63,7 +63,7 @@ function trap(element, event) {
63
63
  event.preventDefault();
64
64
  }
65
65
  if (event.shiftKey && focusedItemIndex === 0) {
66
- focusableChildren[focusableChildren.length - 1].focus();
66
+ focusableChildren.at(-1).focus();
67
67
  event.preventDefault();
68
68
  } else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {
69
69
  focusableChildren[0].focus();
@@ -14,6 +14,7 @@ export function trap(element: HTMLElement, event: KeyboardEvent): void;
14
14
  export function untrap(): void;
15
15
  /**
16
16
  * Use a trap/untrap tabs logic.
17
+ * @returns {{ trap: trap, untrap: untrap, saveActiveElement: saveActiveElement }}
17
18
  */
18
19
  export default function useFocusTrap(): {
19
20
  trap: typeof trap;
@@ -33,7 +33,7 @@ function trap(element, event) {
33
33
  event.preventDefault();
34
34
  }
35
35
  if (event.shiftKey && focusedItemIndex === 0) {
36
- focusableChildren[focusableChildren.length - 1].focus();
36
+ focusableChildren.at(-1).focus();
37
37
  event.preventDefault();
38
38
  } else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {
39
39
  focusableChildren[0].focus();
@@ -1,31 +1,33 @@
1
1
  /**
2
2
  * Transform an object to an URLSearchParams instance.
3
3
  *
4
- * @param {Object} obj The object to convert.
5
- * @param {string} defaultSearch A string of defaults search params.
6
- * @return {URLSearchParams}
4
+ * @param {Object} obj The object to convert.
5
+ * @param {string} defaultSearch A string of defaults search params.
6
+ * @returns {URLSearchParams}
7
7
  */
8
8
  export function objectToURLSearchParams(obj: any, defaultSearch?: string): URLSearchParams;
9
9
  /**
10
10
  * Push a new state.
11
11
  *
12
- * @param {HistoryOptions} options The new state.
13
- * @param {Object} [data] The data for the new state.
14
- * @param {string} [title] The title for the new state.
12
+ * @param {HistoryOptions} options The new state.
13
+ * @param {Object} [data] The data for the new state.
14
+ * @param {string} [title] The title for the new state.
15
+ * @returns {void}
15
16
  */
16
17
  export function push(options: HistoryOptions, data?: any, title?: string): void;
17
18
  /**
18
19
  * Replace a new state.
19
20
  *
20
- * @param {HistoryOptions} options The new state.
21
- * @param {Object} [data] The data for the new state.
22
- * @param {string} [title] The title for the new state.
21
+ * @param {HistoryOptions} options The new state.
22
+ * @param {Object} [data] The data for the new state.
23
+ * @param {string} [title] The title for the new state.
24
+ * @returns {void}
23
25
  */
24
26
  export function replace(options: HistoryOptions, data?: any, title?: string): void;
25
27
  export type HistoryOptions = {
26
- path?: string | undefined;
28
+ path?: string;
27
29
  search?: URLSearchParams | {
28
30
  [key: string]: unknown;
29
31
  };
30
- hash?: string | undefined;
32
+ hash?: string;
31
33
  };
@@ -3,6 +3,6 @@
3
3
  * @param {number} value
4
4
  * @param {number} min
5
5
  * @param {number} max
6
- * @return {number}
6
+ * @returns {number}
7
7
  */
8
8
  export default function clamp(value: number, min: number, max: number): number;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Clamp a value in the 0–1 range.
3
3
  * @param {number} value
4
- * @return {number}
4
+ * @returns {number}
5
5
  */
6
6
  export default function clamp01(value: number): number;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Get the next damped value for a given factor.
3
3
  *
4
- * @param {number} targetValue The final value.
5
- * @param {number} currentValue The current value.
6
- * @param {number=} [factor=0.5] The factor used to reach the target value.
7
- * @param {number=} [precision=0.01] The precision used to calculate the latest value.
8
- * @return {number} The next value.
4
+ * @param {number} targetValue The final value.
5
+ * @param {number} currentValue The current value.
6
+ * @param {number} [factor=0.5] The factor used to reach the target value.
7
+ * @param {number} [precision=0.01] The precision used to calculate the latest value.
8
+ * @returns {number} The next value.
9
9
  */
10
- export default function damp(targetValue: number, currentValue: number, factor?: number | undefined, precision?: number | undefined): number;
10
+ export default function damp(targetValue: number, currentValue: number, factor?: number, precision?: number): number;
@@ -12,7 +12,7 @@ export function createEaseOut(easeIn: EasingFunction): EasingFunction;
12
12
  * Create an in-out easing function.
13
13
  *
14
14
  * @param {EasingFunction} easeIn The ease in function.
15
- * @return {EasingFunction} The in-out function.
15
+ * @returns {EasingFunction} The in-out function.
16
16
  */
17
17
  export function createEaseInOut(easeIn: EasingFunction): EasingFunction;
18
18
  /**
@@ -23,42 +23,42 @@ export function easeInQuad(progress: number): number;
23
23
  * Ease in cubic.
24
24
  *
25
25
  * @param {number} progress Progress value betwen 0 and 1.
26
- * @return {number} Eased value between 0 and 1.
26
+ * @returns {number} Eased value between 0 and 1.
27
27
  */
28
28
  export function easeInCubic(progress: number): number;
29
29
  /**
30
30
  * Ease in quart.
31
31
  *
32
32
  * @param {number} progress Progress value betwen 0 and 1.
33
- * @return {number} Eased value between 0 and 1.
33
+ * @returns {number} Eased value between 0 and 1.
34
34
  */
35
35
  export function easeInQuart(progress: number): number;
36
36
  /**
37
37
  * Ease in quint.
38
38
  *
39
39
  * @param {number} progress Progress value betwen 0 and 1.
40
- * @return {number} Eased value between 0 and 1.
40
+ * @returns {number} Eased value between 0 and 1.
41
41
  */
42
42
  export function easeInQuint(progress: number): number;
43
43
  /**
44
44
  * Ease in sine.
45
45
  *
46
46
  * @param {number} progress Progress value betwen 0 and 1.
47
- * @return {number} Eased value between 0 and 1.
47
+ * @returns {number} Eased value between 0 and 1.
48
48
  */
49
49
  export function easeInSine(progress: number): number;
50
50
  /**
51
51
  * Ease in circ.
52
52
  *
53
53
  * @param {number} progress Progress value betwen 0 and 1.
54
- * @return {number} Eased value between 0 and 1.
54
+ * @returns {number} Eased value between 0 and 1.
55
55
  */
56
56
  export function easeInCirc(progress: number): number;
57
57
  /**
58
58
  * Ease in exponential.
59
59
  *
60
60
  * @param {number} progress Progress value betwen 0 and 1.
61
- * @return {number} Eased value between 0 and 1.
61
+ * @returns {number} Eased value between 0 and 1.
62
62
  */
63
63
  export function easeInExpo(progress: number): number;
64
64
  export function easeOutQuad(progress: number): number;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Get the final damped value for a given factor.
3
3
  *
4
- * @param {Number} initialValue The final value.
5
- * @param {Number} initialDelta The current value.
6
- * @param {Number=} [dampFactor=0.85] The speed to reach the target value.
7
- * @return {Number} The next value.
4
+ * @param {number} initialValue The final value.
5
+ * @param {number} initialDelta The current value.
6
+ * @param {number} [dampFactor=0.85] The speed to reach the target value.
7
+ * @returns {number} The next value.
8
8
  */
9
- export default function inertiaFinalValue(initialValue: number, initialDelta: number, dampFactor?: number | undefined): number;
9
+ export default function inertiaFinalValue(initialValue: number, initialDelta: number, dampFactor?: number): number;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Interpolate the ratio between a given interval.
3
3
  *
4
- * @param {Number} min The interval minimum value.
5
- * @param {Number} max The inverval maximum value.
6
- * @param {Number} ratio The ratio to get.
7
- * @return {Number} The value between min and max corresponding to ratio.
4
+ * @param {number} min The interval minimum value.
5
+ * @param {number} max The inverval maximum value.
6
+ * @param {number} ratio The ratio to get.
7
+ * @returns {number} The value between min and max corresponding to ratio.
8
8
  */
9
9
  export default function lerp(min: number, max: number, ratio: number): number;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Maps the value from one range of [inputMin..inputMax] to another range of [outputMin..outputMax].
3
3
  *
4
- * @param {Number} value The value to map.
5
- * @param {Number} inputMin The input's minimum value.
6
- * @param {Number} inputMax The input's maximum value.
7
- * @param {Number} outputMin The output's minimum value.
8
- * @param {Number} outputMax The output's maximum value.
9
- * @return {Number} The input value mapped to the output range.
4
+ * @param {number} value The value to map.
5
+ * @param {number} inputMin The input's minimum value.
6
+ * @param {number} inputMax The input's maximum value.
7
+ * @param {number} outputMin The output's minimum value.
8
+ * @param {number} outputMax The output's maximum value.
9
+ * @returns {number} The input value mapped to the output range.
10
10
  */
11
11
  export default function map(value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number): number;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Round a value with a given number of decimals.
3
3
  *
4
- * @param {Number} value The number to round.
5
- * @param {Number=} [decimals=0] The number of decimals to keep.
6
- * @return {Number} A rounded number to the given decimals length.
4
+ * @param {number} value The number to round.
5
+ * @param {number} [decimals=0] The number of decimals to keep.
6
+ * @returns {number} A rounded number to the given decimals length.
7
7
  */
8
- export default function round(value: number, decimals?: number | undefined): number;
8
+ export default function round(value: number, decimals?: number): number;
@@ -15,7 +15,7 @@
15
15
  * @template {(...args:any) => any} T
16
16
  * @param {T} fn
17
17
  * @param {MemorizeOptions} options
18
- * @return {(...args:Parameters<T>) => ReturnType<T>}
18
+ * @returns {(...args:Parameters<T>) => ReturnType<T>}
19
19
  */
20
20
  export default function memoize<T extends (...args: any) => any>(fn: T, { maxAge, cacheKey, cache }?: MemorizeOptions): (...args: Parameters<T>) => ReturnType<T>;
21
21
  export type MemorizeCache = {
@@ -1,22 +1,21 @@
1
1
  /**
2
2
  * RequestAnimation frame polyfill.
3
3
  * @see https://github.com/vuejs/vue/blob/ec78fc8b6d03e59da669be1adf4b4b5abf670a34/dist/vue.runtime.esm.js#L7355
4
- * @return {(handler: Function) => number}
4
+ * @returns {(handler: Function) => number}
5
5
  */
6
6
  export function getRaf(): (handler: Function) => number;
7
7
  /**
8
8
  * Get a function to cancel the method returned by `getRaf()`.
9
9
  *
10
- * @return {(id:number) => void}
10
+ * @returns {(id:number) => void}
11
11
  */
12
12
  export function getCancelRaf(): (id: number) => void;
13
13
  /**
14
14
  * Wait for the next frame to execute a function.
15
15
  *
16
16
  * @template {() => any} T
17
- * @param {T=} [fn] The callback function to execute.
17
+ * @param {T} [fn] The callback function to execute.
18
18
  * @returns {Promise<T extends Function ? ReturnType<T> : undefined>} A Promise resolving when the next frame is reached.
19
- *
20
19
  * @example
21
20
  * ```js
22
21
  * nextFrame(() => console.log('hello world'));
@@ -2,7 +2,7 @@
2
2
  * Wait for the next microtask.
3
3
  *
4
4
  * @template {() => any} T
5
- * @param {T=} [fn]
5
+ * @param {T} [fn]
6
6
  * @returns {Promise<T extends Function ? ReturnType<T> : undefined>}
7
7
  */
8
8
  export default function nextMicrotask<T extends () => any>(fn?: T): Promise<T extends Function ? ReturnType<T> : undefined>;
@@ -2,7 +2,7 @@
2
2
  * Wait for the next tick.
3
3
  *
4
4
  * @template {() => any} T
5
- * @param {T=} [fn]
5
+ * @param {T} [fn]
6
6
  * @returns {Promise<T extends Function ? ReturnType<T> : undefined>}
7
7
  */
8
8
  export default function nextTick<T extends () => any>(fn?: T): Promise<T extends Function ? ReturnType<T> : undefined>;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * @param {Object} instance The instance.
5
5
  * @param {Object} options Define specific methods to include or exlude.
6
- * @param {Array<String|RegExp>} [options.include] Methods to include.
7
- * @param {Array<String|RegExp>} [options.exclude] Methods to exclude.
8
- * @return {Object} The instance.
6
+ * @param {Array<string | RegExp>} [options.include] Methods to include.
7
+ * @param {Array<string | RegExp>} [options.exclude] Methods to exclude.
8
+ * @returns {Object} The instance.
9
9
  */
10
10
  export default function autoBind(instance: any, options: {
11
11
  include?: Array<string | RegExp>;