"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.PRO_PROVIDER_KEY = void 0;

var _vue = require("vue");

var _utils = require("../utils");

var PRO_PROVIDER_KEY = 'ProProvider'; // const ProProvider = createContext<ProProviderData>(PRO_PROVIDER_KEY);

exports.PRO_PROVIDER_KEY = PRO_PROVIDER_KEY;
var ProProvider = (0, _vue.defineComponent)({
  name: 'ProProvider',
  props: {
    value: _utils.PropTypes.object
  },
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    var state = (0, _vue.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>;

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

    (0, _vue.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);
    };
  }
});
var _default = ProProvider;
exports.default = _default;