import Player from '../index' ; function filterPlugins ( plugins ) { let resultAutoPlugins ; const autoPlugins = { } ; const manualPlugins = [ ] ; plugins . map ( element => { if ( element . plugin === undefined ) { autoPlugins [ element . name ] = element . options ; } else { manualPlugins . push ( element ) ; } } ) ; resultAutoPlugins = ( Object . keys ( autoPlugins ) . length === 0 ) ? undefined : autoPlugins ; return [ resultAutoPlugins , manualPlugins , ] ; } namespace filterPlugins { export interface Plugins extends Array < Player . IVideoJsPlugin > { } ; export interface AutoPlugins { [ key ] : any ; } } ; export default filterPlugins ;