@@ -3,7 +3,7 @@ import {DOM} from 'aurelia-pal';
33
44interface CssAnimation {
55 className: string ;
6- element: HTMLElement ;
6+ element: Element ;
77}
88
99/**
@@ -30,7 +30,7 @@ export class CssAnimator {
3030 * @param s collection of events to bind listeners to
3131 * @param fn callback that gets executed
3232 */
33- _addMultipleEventListener ( el : HTMLElement , s : string , fn : Function ) : void {
33+ _addMultipleEventListener ( el : Element , s : string , fn : Function ) : void {
3434 let evts = s . split ( ' ' ) ;
3535 for ( let i = 0 , ii = evts . length ; i < ii ; ++ i ) {
3636 el . addEventListener ( evts [ i ] , fn , false ) ;
@@ -44,7 +44,7 @@ export class CssAnimator {
4444 * @param s collection of events to remove
4545 * @param fn callback to remove
4646 */
47- _removeMultipleEventListener ( el : HTMLElement , s : string , fn : Function ) : void {
47+ _removeMultipleEventListener ( el : Element , s : string , fn : Function ) : void {
4848 let evts = s . split ( ' ' ) ;
4949 for ( let i = 0 , ii = evts . length ; i < ii ; ++ i ) {
5050 el . removeEventListener ( evts [ i ] , fn , false ) ;
@@ -57,7 +57,7 @@ export class CssAnimator {
5757 * @param element the element to inspect
5858 * @returns animation-delay in seconds
5959 */
60- _getElementAnimationDelay ( element : HTMLElement ) : number {
60+ _getElementAnimationDelay ( element : Element ) : number {
6161 let styl = DOM . getComputedStyle ( element ) ;
6262 let prop ;
6363 let delay ;
@@ -84,7 +84,7 @@ export class CssAnimator {
8484 * @param element the element to inspect
8585 * @returns array of animation names
8686 */
87- _getElementAnimationNames ( element : HTMLElement ) : Array < String > {
87+ _getElementAnimationNames ( element : Element ) : Array < String > {
8888 let styl = DOM . getComputedStyle ( element ) ;
8989 let prefix ;
9090
@@ -109,7 +109,7 @@ export class CssAnimator {
109109 * @param className the class to be added and removed
110110 * @returns {Promise<Boolean> }
111111 */
112- _performSingleAnimate ( element : HTMLElement , className : string ) : Promise < boolean > {
112+ _performSingleAnimate ( element : Element , className : string ) : Promise < boolean > {
113113 this . _triggerDOMEvent ( animationEvent . animateBegin , element ) ;
114114
115115 return this . addClass ( element , className , true )
@@ -135,7 +135,7 @@ export class CssAnimator {
135135 * @param eventType the event type
136136 * @param element the element to be dispatched as event detail
137137 */
138- _triggerDOMEvent ( eventType : string , element : HTMLElement ) : void {
138+ _triggerDOMEvent ( eventType : string , element : Element ) : void {
139139 let evt = DOM . createCustomEvent ( eventType , { bubbles : true , cancelable : true , detail : element } ) ;
140140 DOM . dispatchEvent ( evt ) ;
141141 }
@@ -204,7 +204,7 @@ export class CssAnimator {
204204 * @param options options for the animation (duration, easing, ...)
205205 * @returns Resolved when the animation is done
206206 */
207- animate ( element : HTMLElement | Array < HTMLElement > , className : string ) : Promise < boolean > {
207+ animate ( element : Element | Array < Element > , className : string ) : Promise < boolean > {
208208 if ( Array . isArray ( element ) ) {
209209 return Promise . all ( element . map ( ( el ) => {
210210 return this . _performSingleAnimate ( el , className ) ;
@@ -236,7 +236,7 @@ export class CssAnimator {
236236 * @param doneClass class to apply when done
237237 * @private
238238 */
239- _stateAnim ( element : HTMLElement , direction : string , doneClass : string ) {
239+ _stateAnim ( element : Element , direction : string , doneClass : string ) {
240240 const auClass = 'au-' + direction ;
241241 const auClassActive = auClass + '-active' ;
242242 return new Promise ( ( resolve , reject ) => {
@@ -347,7 +347,7 @@ export class CssAnimator {
347347 * @param element Element to animate
348348 * @returns Resolved when the animation is done
349349 */
350- enter ( element : HTMLElement ) : Promise < boolean > {
350+ enter ( element : Element ) : Promise < boolean > {
351351 return this . _stateAnim ( element , 'enter ', this . animationEnteredClass ) ;
352352 }
353353
@@ -356,7 +356,7 @@ export class CssAnimator {
356356 * @param element Element to animate
357357 * @returns Resolved when the animation is done
358358 */
359- leave ( element : HTMLElement ) : Promise < boolean > {
359+ leave ( element : Element ) : Promise < boolean > {
360360 return this . _stateAnim ( element , 'leave ', this . animationLeftClass ) ;
361361 }
362362
@@ -367,7 +367,7 @@ export class CssAnimator {
367367 * @param suppressEvents Indicates whether or not to suppress animation events.
368368 * @returns Resolved when the animation is done
369369 */
370- removeClass ( element : HTMLElement , className : string , suppressEvents : boolean = false ) : Promise < boolean > {
370+ removeClass ( element : Element , className : string , suppressEvents : boolean = false ) : Promise < boolean > {
371371 return new Promise ( ( resolve , reject ) => {
372372 let classList = element . classList ;
373373
@@ -455,7 +455,7 @@ export class CssAnimator {
455455 * @param suppressEvents Indicates whether or not to suppress animation events.
456456 * @returns Resolved when the animation is done
457457 */
458- addClass ( element : HTMLElement , className : string , suppressEvents : boolean = false ) : Promise < boolean > {
458+ addClass ( element : Element , className : string , suppressEvents : boolean = false ) : Promise < boolean > {
459459 return new Promise ( ( resolve , reject ) => {
460460 let classList = element . classList ;
461461
0 commit comments