import { MetadataStorage , DChoice , DOption , Modifier , ChoicesType } from "../.." ; export function Choices ( choices ) ; export function Choices ( choices ) { return async ( target , key , index ) => { MetadataStorage . instance . addModifier ( Modifier . create < DOption > ( async ( original ) => { const arrayChoices = Object . keys ( choices ) . map ( ( key ) => { return DChoice . create ( key , choices [ key ] ) ; } ) ; original . choices = [ ... original . choices , ... arrayChoices , ] ; } , DOption ) . decorate ( target . constructor , key , target [ key ] , target . constructor , index ) ) ; } ; }