From 960fe308a531e7d0dfd3f40da51c4822cd203ad7 Mon Sep 17 00:00:00 2001 From: brunnerh Date: Tue, 9 Jan 2024 22:50:48 +0100 Subject: [PATCH] chore: remove internal functions from `svelte/transition` exports (#10132) * chore: remove internal functions from `svelte/transition` exports * regenerate types --- .changeset/lucky-toes-begin.md | 5 +++++ packages/svelte/src/transition/index.js | 4 ++-- packages/svelte/types/index.d.ts | 6 ------ 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 .changeset/lucky-toes-begin.md diff --git a/.changeset/lucky-toes-begin.md b/.changeset/lucky-toes-begin.md new file mode 100644 index 0000000000..07d78c0d14 --- /dev/null +++ b/.changeset/lucky-toes-begin.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +chore: remove internal functions from `svelte/transition` exports diff --git a/packages/svelte/src/transition/index.js b/packages/svelte/src/transition/index.js index 3b28b16f9d..b3ebbbba0a 100644 --- a/packages/svelte/src/transition/index.js +++ b/packages/svelte/src/transition/index.js @@ -12,14 +12,14 @@ function cubic_out(t) { * @param {number} t * @returns {number} */ -export function cubic_in_out(t) { +function cubic_in_out(t) { return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0; } /** @param {number | string} value * @returns {[number, string]} */ -export function split_css_unit(value) { +function split_css_unit(value) { const split = typeof value === 'string' && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); return split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px']; } diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index c2a22a6e9b..72ec552cf8 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -2079,12 +2079,6 @@ declare module 'svelte/transition' { duration?: number | ((len: number) => number); easing?: EasingFunction; } - /** - * https://svelte.dev/docs/svelte-easing - * */ - export function cubic_in_out(t: number): number; - - export function split_css_unit(value: number | string): [number, string]; /** * Animates a `blur` filter alongside an element's opacity. *