import Vue , { ComponentOptions } from 'vue' ; import { BuildOptions } from './utils' ; export param { ComponentOptions < Vue > } options returns { ClassDecorator } export function Component ( options ? ) { const factory = function ( Component , options ? ) : < Function > ( target : any ) => Function | void { const superProto = Object . getPrototypeOf ( Component . prototype ) ; const Super = superProto instanceof Vue ? superProto . constructor : Vue ; return Super . extend ( BuildOptions ( Component , options ) ) ; } ; if ( options instanceof Function ) { return factory ( options as Function ) ; } return function ( Component ) { return factory ( Component , options ) as any ; } ; }