MockAnimationPlayer

class MockAnimationPlayer extends NoopAnimationPlayer { constructor(element: any, keyframes: { [key: string]: string | number; }[], duration: number, delay: number, easing: string, previousPlayers: any[]) previousStyles: {...} currentSnapshot: ɵStyleData element: any keyframes: {...} duration: number delay: number easing: string previousPlayers: any[] onInit(fn: () => any) init() finish(): void destroy(): void triggerMicrotask() play(): void hasStarted() beforeDestroy() // 继承自 animations/NoopAnimationPlayer constructor(duration: number = 0, delay: number = 0) parentPlayer: AnimationPlayer | null totalTime: number onStart(fn: () => void): void onDone(fn: () => void): void onDestroy(fn: () => void): void hasStarted(): boolean init(): void play(): void pause(): void restart(): void finish(): void destroy(): void reset(): void setPosition(position: number): void getPosition(): number }
      
      class MockAnimationPlayer extends NoopAnimationPlayer {
  constructor(element: any, keyframes: { [key: string]: string | number; }[], duration: number, delay: number, easing: string, previousPlayers: any[])
  previousStyles: {...}
  currentSnapshot: ɵStyleData
  element: any
  keyframes: {...}
  duration: number
  delay: number
  easing: string
  previousPlayers: any[]
  onInit(fn: () => any)
  init()
  finish(): void
  destroy(): void
  triggerMicrotask()
  play(): void
  hasStarted()
  beforeDestroy()

  // 继承自 animations/NoopAnimationPlayer
  constructor(duration: number = 0, delay: number = 0)
  parentPlayer: AnimationPlayer | null
  totalTime: number
  onStart(fn: () => void): void
  onDone(fn: () => void): void
  onDestroy(fn: () => void): void
  hasStarted(): boolean
  init(): void
  play(): void
  pause(): void
  restart(): void
  finish(): void
  destroy(): void
  reset(): void
  setPosition(position: number): void
  getPosition(): number
}
    

构造函数

constructor(element: any, keyframes: { [key: string]: string | number; }[], duration: number, delay: number, easing: string, previousPlayers: any[])
      
      constructor(element: any, keyframes: { [key: string]: string | number; }[], duration: number, delay: number, easing: string, previousPlayers: any[])
    
参数
element any
keyframes { [key: string]: string | number; }[]
duration number
delay number
easing string
previousPlayers any[]

属性

属性说明
previousStyles: { [key: string]: string | number; }
currentSnapshot: ɵStyleData
element: any 声明于构造函数中
keyframes: { [key: string]: string | number; }[] 声明于构造函数中
duration: number 声明于构造函数中
delay: number 声明于构造函数中
easing: string 声明于构造函数中
previousPlayers: any[] 声明于构造函数中

方法

onInit(fn: () => any)
      
      onInit(fn: () => any)
    
参数
fn () => any
init()
      
      init()
    
参数

没有参数。

finish(): void
      
      finish(): void
    
参数

没有参数。

返回值

void

destroy(): void
      
      destroy(): void
    
参数

没有参数。

返回值

void

triggerMicrotask()
      
      triggerMicrotask()
    
参数

没有参数。

play(): void
      
      play(): void
    
参数

没有参数。

返回值

void

hasStarted()
      
      hasStarted()
    
参数

没有参数。

      
      beforeDestroy()
    
参数

没有参数。