MockAnimationDriver

class MockAnimationDriver implements AnimationDriver { static log: AnimationPlayer[] validateStyleProperty(prop: string): boolean matchesElement(element: any, selector: string): boolean containsElement(elm1: any, elm2: any): boolean query(element: any, selector: string, multi: boolean): any[] computeStyle(element: any, prop: string, defaultValue?: string): string animate(element: any, keyframes: {...}, duration: number, delay: number, easing: string, previousPlayers: any[] = []): MockAnimationPlayer }

静态属性

属性说明
static log: AnimationPlayer[]

方法

validateStyleProperty(prop: string): boolean

参数

prop

Type: string.

返回值

boolean

matchesElement(element: any, selector: string): boolean

参数

element

Type: any.

selector

Type: string.

返回值

boolean

containsElement(elm1: any, elm2: any): boolean

参数

elm1

Type: any.

elm2

Type: any.

返回值

boolean

query(element: any, selector: string, multi: boolean): any[]

参数

element

Type: any.

selector

Type: string.

multi

Type: boolean.

返回值

any[]

computeStyle(element: any, prop: string, defaultValue?: string): string

参数

element

Type: any.

prop

Type: string.

defaultValue

Type: string.

可选. 默认值是 undefined.

返回值

string

animate(element: any, keyframes: { [key: string]: string | number; }[], duration: number, delay: number, easing: string, previousPlayers: any[] = []): MockAnimationPlayer

参数

element

Type: any.

keyframes

Type: { [key: string]: string | number; }[].

duration

Type: number.

delay

Type: number.

easing

Type: string.

previousPlayers

Type: any[].

可选. 默认值是 [].

返回值

MockAnimationPlayer