1
+ /** @import { AnimateFn, Animation, AnimationConfig, EachItem, Effect, Task, TransitionFn, TransitionManager } from '#client' */
1
2
import { noop , is_function } from '../../../shared/utils.js' ;
2
3
import { effect } from '../../reactivity/effects.js' ;
3
4
import { current_effect , untrack } from '../../runtime.js' ;
@@ -60,19 +61,19 @@ const linear = (t) => t;
60
61
* and attaches it to the block, so that moves can be animated following reconciliation.
61
62
* @template P
62
63
* @param {Element } element
63
- * @param {() => import('#client'). AnimateFn<P | undefined> } get_fn
64
+ * @param {() => AnimateFn<P | undefined> } get_fn
64
65
* @param {(() => P) | null } get_params
65
66
*/
66
67
export function animation ( element , get_fn , get_params ) {
67
- var item = /** @type {import('#client'). EachItem } */ ( current_each_item ) ;
68
+ var item = /** @type {EachItem } */ ( current_each_item ) ;
68
69
69
70
/** @type {DOMRect } */
70
71
var from ;
71
72
72
73
/** @type {DOMRect } */
73
74
var to ;
74
75
75
- /** @type {import('#client'). Animation | undefined } */
76
+ /** @type {Animation | undefined } */
76
77
var animation ;
77
78
78
79
/** @type {null | { position: string, width: string, height: string, transform: string } } */
@@ -167,7 +168,7 @@ export function animation(element, get_fn, get_params) {
167
168
* @template P
168
169
* @param {number } flags
169
170
* @param {HTMLElement } element
170
- * @param {() => import('#client'). TransitionFn<P | undefined> } get_fn
171
+ * @param {() => TransitionFn<P | undefined> } get_fn
171
172
* @param {(() => P) | null } get_params
172
173
* @returns {void }
173
174
*/
@@ -180,15 +181,15 @@ export function transition(flags, element, get_fn, get_params) {
180
181
/** @type {'in' | 'out' | 'both' } */
181
182
var direction = is_both ? 'both' : is_intro ? 'in' : 'out' ;
182
183
183
- /** @type {import('#client'). AnimationConfig | ((opts: { direction: 'in' | 'out' }) => import('#client'). AnimationConfig) | undefined } */
184
+ /** @type {AnimationConfig | ((opts: { direction: 'in' | 'out' }) => AnimationConfig) | undefined } */
184
185
var current_options ;
185
186
186
187
var inert = element . inert ;
187
188
188
- /** @type {import('#client'). Animation | undefined } */
189
+ /** @type {Animation | undefined } */
189
190
var intro ;
190
191
191
- /** @type {import('#client'). Animation | undefined } */
192
+ /** @type {Animation | undefined } */
192
193
var outro ;
193
194
194
195
/** @type {(() => void) | undefined } */
@@ -201,7 +202,7 @@ export function transition(flags, element, get_fn, get_params) {
201
202
return ( current_options ??= get_fn ( ) ( element , get_params ?. ( ) , { direction } ) ) ;
202
203
}
203
204
204
- /** @type {import('#client'). TransitionManager } */
205
+ /** @type {TransitionManager } */
205
206
var transition = {
206
207
is_global,
207
208
in ( ) {
@@ -271,7 +272,7 @@ export function transition(flags, element, get_fn, get_params) {
271
272
}
272
273
} ;
273
274
274
- var e = /** @type {import('#client'). Effect } */ ( current_effect ) ;
275
+ var e = /** @type {Effect } */ ( current_effect ) ;
275
276
276
277
( e . transitions ??= [ ] ) . push ( transition ) ;
277
278
@@ -282,7 +283,7 @@ export function transition(flags, element, get_fn, get_params) {
282
283
let run = is_global ;
283
284
284
285
if ( ! run ) {
285
- var block = /** @type {import('#client'). Effect | null } */ ( e . parent ) ;
286
+ var block = /** @type {Effect | null } */ ( e . parent ) ;
286
287
287
288
// skip over transparent blocks (e.g. snippets, else-if blocks)
288
289
while ( block && ( block . f & EFFECT_TRANSPARENT ) !== 0 ) {
@@ -305,12 +306,12 @@ export function transition(flags, element, get_fn, get_params) {
305
306
/**
306
307
* Animates an element, according to the provided configuration
307
308
* @param {Element } element
308
- * @param {import('#client'). AnimationConfig | ((opts: { direction: 'in' | 'out' }) => import('#client'). AnimationConfig) } options
309
- * @param {import('#client'). Animation | undefined } counterpart The corresponding intro/outro to this outro/intro
309
+ * @param {AnimationConfig | ((opts: { direction: 'in' | 'out' }) => AnimationConfig) } options
310
+ * @param {Animation | undefined } counterpart The corresponding intro/outro to this outro/intro
310
311
* @param {number } t2 The target `t` value — `1` for intro, `0` for outro
311
312
* @param {(() => void) | undefined } on_finish Called after successfully completing the animation
312
313
* @param {(() => void) | undefined } on_abort Called if the animation is aborted
313
- * @returns {import('#client'). Animation }
314
+ * @returns {Animation }
314
315
*/
315
316
function animate ( element , options , counterpart , t2 , on_finish , on_abort ) {
316
317
var is_intro = t2 === 1 ;
@@ -319,7 +320,7 @@ function animate(element, options, counterpart, t2, on_finish, on_abort) {
319
320
// In the case of a deferred transition (such as `crossfade`), `option` will be
320
321
// a function rather than an `AnimationConfig`. We need to call this function
321
322
// once DOM has been updated...
322
- /** @type {import('#client'). Animation } */
323
+ /** @type {Animation } */
323
324
var a ;
324
325
325
326
queue_micro_task ( ( ) => {
@@ -358,10 +359,10 @@ function animate(element, options, counterpart, t2, on_finish, on_abort) {
358
359
var duration = options . duration * Math . abs ( delta ) ;
359
360
var end = start + duration ;
360
361
361
- /** @type {Animation } */
362
+ /** @type {globalThis. Animation } */
362
363
var animation ;
363
364
364
- /** @type {import('#client'). Task } */
365
+ /** @type {Task } */
365
366
var task ;
366
367
367
368
if ( css ) {
0 commit comments