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. *