module export const linear = ( k ) : number => k ; export const quadraticIn = ( k ) : number => k * k ; export const quadraticOut = ( k ) : number => k * ( 2 - k ) ; export const quadraticInOut = ( k ) : number => { if ( ( k *= 2 ) < 1 ) return 0.5 * k * k ; return - 0.5 * ( -- k * ( k - 2 ) - 1 ) ; } ; export const cubicIn = ( k ) : number => k * k * k ; export const cubicOut = ( k ) : number => -- k * k * k + 1 ; export const cubicInOut = ( k ) : number => { if ( ( k *= 2 ) < 1 ) return 0.5 * k * k * k ; return 0.5 * ( ( k -= 2 ) * k * k + 2 ) ; } ; const easings = { linear , quadraticIn , quadraticOut , quadraticInOut , cubicIn , cubicOut , cubicInOut , } ; export default easings ;