import { defineComponent, provide, reactive } from 'vue';
import { PropTypes } from '../utils';
export var PRO_PROVIDER_KEY = 'ProProvider'; // const ProProvider = createContext<ProProviderData>(PRO_PROVIDER_KEY);

var ProProvider = defineComponent({
  name: 'ProProvider',
  props: {
    value: PropTypes.object
  },
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    var state = reactive(props.value || {}); // const setState = (key: string, value: any) => {
    //   state[key] = value;
    // };
    // const realState: T = (props.readonly ? readonly(state) : state) as T;
    // const ctxResult: ContextResult<T> = [realState, setState] as ContextResult<T>;

    /* 注入数据，供子组件使用 */

    provide(PRO_PROVIDER_KEY, state);
    return function () {
      var _slots$default;

      return (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
    };
  }
});
export default ProProvider;