import { Vue } from './index'; import { constructor, PropertyDecorator } from './utils'; export interface ProvideOptions { key: string; value: any; } export function provide(value: any, key?: string): PropertyDecorator { return function(target, property) { const Component = constructor(target); if (!Object.hasOwn(Component, 'provide')) { Component.provide = {}; } Component.provide[property] = { key, value } as ProvideOptions; }; }