import { PropType } from 'vue'; import { propertyDecorator, Vue } from './index'; import { constructor } from './utils'; export interface PropOptions { default: T | (() => T); required: boolean; type: PropType; validator?: (value: T) => boolean; } export function prop(options: Partial> | T, property?: string) { return propertyDecorator, T>(options , (options, target, property) => { const Component = constructor(target); if (!Object.hasOwn(Component, 'props')) { Component.props = {}; } Component.props[property] = options; }, property); }