@studiometa/js-toolkit 2.0.0-rc.2 → 2.0.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.
- package/Base/index.cjs +1 -2
- package/Base/index.d.ts +25 -26
- package/Base/index.js +1 -2
- package/Base/managers/ChildrenManager.d.ts +2 -2
- package/Base/managers/EventsManager.d.ts +13 -20
- package/Base/managers/OptionsManager.cjs +0 -1
- package/Base/managers/OptionsManager.d.ts +13 -10
- package/Base/managers/OptionsManager.js +0 -1
- package/Base/managers/RefsManager.d.ts +4 -4
- package/Base/managers/ServicesManager.cjs +3 -0
- package/Base/managers/ServicesManager.d.ts +14 -8
- package/Base/managers/ServicesManager.js +3 -0
- package/Base/utils.d.ts +4 -4
- package/decorators/withBreakpointManager.cjs +0 -1
- package/decorators/withBreakpointManager.d.ts +2 -2
- package/decorators/withBreakpointManager.js +0 -1
- package/decorators/withBreakpointObserver.cjs +1 -2
- package/decorators/withBreakpointObserver.d.ts +1 -1
- package/decorators/withBreakpointObserver.js +1 -2
- package/decorators/withDrag.d.ts +1 -1
- package/decorators/withExtraConfig.d.ts +1 -1
- package/decorators/withFreezedOptions.d.ts +1 -1
- package/decorators/withIntersectionObserver.cjs +0 -1
- package/decorators/withIntersectionObserver.d.ts +1 -1
- package/decorators/withIntersectionObserver.js +0 -1
- package/decorators/withMountWhenInView.cjs +0 -1
- package/decorators/withMountWhenInView.d.ts +1 -1
- package/decorators/withMountWhenInView.js +0 -1
- package/decorators/withScrolledInView.d.ts +1 -1
- package/helpers/createApp.d.ts +3 -26
- package/helpers/getInstanceFromElement.cjs +32 -0
- package/helpers/getInstanceFromElement.d.ts +14 -0
- package/helpers/getInstanceFromElement.js +10 -0
- package/helpers/importOnInteraction.d.ts +3 -5
- package/helpers/importWhenIdle.d.ts +3 -5
- package/helpers/importWhenVisible.d.ts +4 -6
- package/helpers/index.cjs +2 -0
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +8 -6
- package/helpers/utils.d.ts +3 -4
- package/package.json +1 -1
- package/services/Service.d.ts +9 -9
- package/services/drag.cjs +0 -1
- package/services/drag.d.ts +3 -3
- package/services/drag.js +0 -1
- package/services/key.d.ts +1 -1
- package/services/load.d.ts +1 -1
- package/services/pointer.d.ts +1 -1
- package/services/raf.d.ts +1 -1
- package/services/resize.cjs +2 -2
- package/services/resize.d.ts +1 -1
- package/services/resize.js +2 -2
- package/services/scroll.d.ts +1 -1
- package/utils/collide/boundingRectToCircle.d.ts +5 -5
- package/utils/collide/collideCircleCircle.d.ts +4 -4
- package/utils/collide/collideCircleRect.d.ts +8 -8
- package/utils/collide/collidePointCircle.d.ts +6 -6
- package/utils/collide/collidePointRect.d.ts +7 -7
- package/utils/collide/collideRectRect.d.ts +5 -5
- package/utils/css/classes.cjs +3 -3
- package/utils/css/classes.d.ts +10 -10
- package/utils/css/classes.js +3 -3
- package/utils/css/matrix.d.ts +14 -15
- package/utils/css/styles.d.ts +2 -2
- package/utils/css/transition.d.ts +2 -2
- package/utils/debounce.d.ts +4 -4
- package/utils/focusTrap.cjs +1 -1
- package/utils/focusTrap.d.ts +1 -0
- package/utils/focusTrap.js +1 -1
- package/utils/history.d.ts +13 -11
- package/utils/math/clamp.d.ts +1 -1
- package/utils/math/clamp01.d.ts +1 -1
- package/utils/math/damp.d.ts +6 -6
- package/utils/math/ease.d.ts +7 -7
- package/utils/math/inertiaFinalValue.d.ts +5 -5
- package/utils/math/lerp.d.ts +4 -4
- package/utils/math/map.d.ts +6 -6
- package/utils/math/round.d.ts +4 -4
- package/utils/memoize.d.ts +1 -1
- package/utils/nextFrame.d.ts +3 -4
- package/utils/nextMicrotask.d.ts +1 -1
- package/utils/nextTick.d.ts +1 -1
- package/utils/object/autoBind.d.ts +3 -3
- package/utils/object/getAllProperties.d.ts +3 -3
- package/utils/object/isObject.d.ts +1 -1
- package/utils/scrollTo.cjs +1 -1
- package/utils/scrollTo.d.ts +1 -1
- package/utils/scrollTo.js +1 -1
- package/utils/string/withLeadingCharacters.d.ts +3 -2
- package/utils/string/withLeadingSlash.d.ts +1 -1
- package/utils/string/withTrailingCharacters.d.ts +3 -2
- package/utils/string/withTrailingSlash.d.ts +1 -1
- package/utils/string/withoutLeadingCharacters.d.ts +3 -2
- package/utils/string/withoutLeadingCharactersRecursive.d.ts +3 -2
- package/utils/string/withoutLeadingSlash.d.ts +1 -1
- package/utils/string/withoutTrailingCharacters.d.ts +3 -2
- package/utils/string/withoutTrailingCharactersRecursive.d.ts +3 -2
- package/utils/string/withoutTrailingSlash.d.ts +1 -1
- package/utils/throttle.cjs +1 -1
- package/utils/throttle.d.ts +3 -3
- package/utils/throttle.js +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Remove the given characters from the end of the given string.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
4
|
+
* @param {string} string The string to modify.
|
|
5
|
+
* @param {string} characters The characters to remove from the end.
|
|
6
|
+
* @returns {string}
|
|
6
7
|
*/
|
|
7
8
|
export default function withoutTrailingCharacters(string: string, characters: string): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Remove the given characters to the start of the given string recursively.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
4
|
+
* @param {string} string The string to modify.
|
|
5
|
+
* @param {string} characters The characters to add to the start.
|
|
6
|
+
* @returns {string}
|
|
6
7
|
*/
|
|
7
8
|
export default function withoutTrailingCharactersRecursive(string: string, characters: string): string;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Remove the trailing slash from a string.
|
|
3
3
|
*
|
|
4
4
|
* @param {string} string The string to modify.
|
|
5
|
-
* @
|
|
5
|
+
* @returns {string} The string without trailing slash.
|
|
6
6
|
*/
|
|
7
7
|
export default function withoutTrailingSlash(string: string): string;
|
package/utils/throttle.cjs
CHANGED
|
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(throttle_exports);
|
|
|
25
25
|
function throttle(fn, delay = 16) {
|
|
26
26
|
let lastCall = 0;
|
|
27
27
|
return function throttled(...args) {
|
|
28
|
-
const now =
|
|
28
|
+
const now = Date.now();
|
|
29
29
|
if (now - lastCall < delay) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
package/utils/throttle.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Simple throttling helper that limits a function to only run once every {delay}ms.
|
|
3
3
|
*
|
|
4
4
|
* @param {Function} fn The function to throttle
|
|
5
|
-
* @param {
|
|
6
|
-
* @
|
|
5
|
+
* @param {number} [delay] The delay in ms
|
|
6
|
+
* @returns {Function} The throttled function.
|
|
7
7
|
*/
|
|
8
|
-
export default function throttle(fn: Function, delay?: number
|
|
8
|
+
export default function throttle(fn: Function, delay?: number): Function;
|