import Vue , { ComponentOptions } from 'vue' ; import { BuildOptions } from './utils' ; export param { ComponentOptions < Vue > } options returns { ClassDecorator } export function Options ( options ? ) { return function ( Component ) { function chainUp ( component ) { const Super = Object . getPrototypeOf ( component ) ; if ( Super instanceof Object && Super . prototype ) { const keys = Object . getOwnPropertyNames ( Super . prototype ) ; for ( const key of keys ) { const descriptor = Object . getOwnPropertyDescriptor ( Super . prototype , key ) as PropertyDecorator ; if ( ! Component . prototype . hasOwnProperty ( key ) ) { Object . defineProperty ( Component . prototype , key , descriptor ) ; } } chainUp ( Super ) ; } } chainUp ( Component ) ; return BuildOptions ( Component , options ) as any ; } ; }