@ -1,4 +1,4 @@
/** @import * as Public from './public' */
/** @import { BlurParams, CrossfadeParams, DrawParams, FadeParams, FlyParams, ScaleParams, SlideParams, TransitionConfig } from './public' */
/** @param {number} x */
const linear = ( x ) => x ;
@ -30,8 +30,8 @@ function split_css_unit(value) {
*
* https : //svelte.dev/docs/svelte-transition#blur
* @ param { Element } node
* @ param { Public. BlurParams} [ params ]
* @ returns { Public. TransitionConfig}
* @ param { BlurParams} [ params ]
* @ returns { TransitionConfig}
* /
export function blur (
node ,
@ -55,8 +55,8 @@ export function blur(
*
* https : //svelte.dev/docs/svelte-transition#fade
* @ param { Element } node
* @ param { Public. FadeParams} [ params ]
* @ returns { Public. TransitionConfig}
* @ param { FadeParams} [ params ]
* @ returns { TransitionConfig}
* /
export function fade ( node , { delay = 0 , duration = 400 , easing = linear } = { } ) {
const o = + getComputedStyle ( node ) . opacity ;
@ -73,8 +73,8 @@ export function fade(node, { delay = 0, duration = 400, easing = linear } = {})
*
* https : //svelte.dev/docs/svelte-transition#fly
* @ param { Element } node
* @ param { Public. FlyParams} [ params ]
* @ returns { Public. TransitionConfig}
* @ param { FlyParams} [ params ]
* @ returns { TransitionConfig}
* /
export function fly (
node ,
@ -101,8 +101,8 @@ export function fly(
*
* https : //svelte.dev/docs/svelte-transition#slide
* @ param { Element } node
* @ param { Public. SlideParams} [ params ]
* @ returns { Public. TransitionConfig}
* @ param { SlideParams} [ params ]
* @ returns { TransitionConfig}
* /
export function slide ( node , { delay = 0 , duration = 400 , easing = cubic _out , axis = 'y' } = { } ) {
const style = getComputedStyle ( node ) ;
@ -145,8 +145,8 @@ export function slide(node, { delay = 0, duration = 400, easing = cubic_out, axi
*
* https : //svelte.dev/docs/svelte-transition#scale
* @ param { Element } node
* @ param { Public. ScaleParams} [ params ]
* @ returns { Public. TransitionConfig}
* @ param { ScaleParams} [ params ]
* @ returns { TransitionConfig}
* /
export function scale (
node ,
@ -173,8 +173,8 @@ export function scale(
*
* https : //svelte.dev/docs/svelte-transition#draw
* @ param { SVGElement & { getTotalLength ( ) : number } } node
* @ param { Public. DrawParams} [ params ]
* @ returns { Public. TransitionConfig}
* @ param { DrawParams} [ params ]
* @ returns { TransitionConfig}
* /
export function draw ( node , { delay = 0 , speed , duration , easing = cubic _in _out } = { } ) {
let len = node . getTotalLength ( ) ;
@ -219,10 +219,10 @@ function assign(tar, src) {
* The ` crossfade ` function creates a pair of [ transitions ] ( https : //svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
*
* https : //svelte.dev/docs/svelte-transition#crossfade
* @ param { Public. CrossfadeParams & {
* fallback ? : ( node : Element , params : Public. CrossfadeParams, intro : boolean ) => Public . TransitionConfig ;
* @ param { CrossfadeParams & {
* fallback ? : ( node : Element , params : CrossfadeParams, intro : boolean ) => TransitionConfig ;
* } } params
* @ returns { [ ( node : any , params : Public. CrossfadeParams & { key : any ; } ) => ( ) => Public . TransitionConfig , ( node : any , params : Public. CrossfadeParams & { key : any ; } ) => ( ) => Public . TransitionConfig ] }
* @ returns { [ ( node : any , params : CrossfadeParams & { key : any ; } ) => ( ) => TransitionConfig , ( node : any , params : CrossfadeParams & { key : any ; } ) => ( ) => TransitionConfig ] }
* /
export function crossfade ( { fallback , ... defaults } ) {
/** @type {Map<any, Element>} */
@ -233,8 +233,8 @@ export function crossfade({ fallback, ...defaults }) {
/ * *
* @ param { Element } from _node
* @ param { Element } node
* @ param { Public. CrossfadeParams} params
* @ returns { Public. TransitionConfig}
* @ param { CrossfadeParams} params
* @ returns { TransitionConfig}
* /
function crossfade ( from _node , node , params ) {
const {
@ -270,7 +270,7 @@ export function crossfade({ fallback, ...defaults }) {
* @ param { Map < any , Element > } items
* @ param { Map < any , Element > } counterparts
* @ param { boolean } intro
* @ returns { ( node : any , params : Public. CrossfadeParams & { key : any ; } ) => ( ) => Public . TransitionConfig }
* @ returns { ( node : any , params : CrossfadeParams & { key : any ; } ) => ( ) => TransitionConfig }
* /
function transition ( items , counterparts , intro ) {
// @ts-expect-error TODO improve typings (are the public types wrong?)