File size: 780 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { AnimatedValue } from '@react-spring/animated'
import { FluidValue } from '@react-spring/shared'
import { AnimationConfig } from './AnimationConfig'
import { PickEventFns } from './types/internal'
import { SpringProps } from './types'

const emptyArray: readonly any[] = []

/** An animation being executed by the frameloop */
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export class Animation<T = any> {
  changed = false
  values: readonly AnimatedValue[] = emptyArray
  toValues: readonly number[] | null = null
  fromValues: readonly number[] = emptyArray

  to!: T | FluidValue<T>
  from!: T | FluidValue<T>
  config = new AnimationConfig()
  immediate = false
}

export interface Animation<T> extends PickEventFns<SpringProps<T>> {}