param m1 param m2 export function extend < T > ( m1 , m2 ) { var m = < T > { } ; for ( var attr in m1 ) { if ( m1 . hasOwnProperty ( attr ) ) { ( < any > m ) [ attr ] = ( < any > m1 ) [ attr ] ; } } for ( var attr in m2 ) { if ( m2 . hasOwnProperty ( attr ) ) { ( < any > m ) [ attr ] = ( < any > m2 ) [ attr ] ; } } return m ; } param arr1 param arr2 export function arrayUnion < T > ( arr1 , arr2 ) { return arr1 . concat ( arr2 . filter ( v => arr1 . indexOf ( v ) === - 1 ) ) ; } param key export function supportsKey ( keyCode , config ) { if ( ! Array . isArray ( config ) ) return config === null ? false : true ; return config . indexOf ( keyCode ) > - 1 ; } param obj export function toStyleString ( obj ) { return Object . getOwnPropertyNames ( obj ) . map ( k => `${ k }:${ obj [ k ] }` ) . join ( ';' ) ; } export class PromiseCompleter < R > { promise : Promise < R > ; resolve : ( value ? : R | PromiseLike < R > ) => void ; reject : ( error ? : any , stackTrace ? : string ) => void ; constructor ( ) { this . promise = new Promise ( ( res , rej ) => { this . resolve = res ; this . reject = rej ; } ) ; } } export interface Class < T > { new ( ... args ) : T ; } export function noop ( ) { }