"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useForm = useForm;
var _vue = require("vue");
var _validation = require("@inkline/inkline/validation");
function useForm(formSchema) {
  const schema = (0, _vue.ref)((0, _validation.createSchema)(formSchema));
  const form = (0, _vue.computed)(() => (0, _validation.serializeSchema)(schema.value));
  async function validate() {
    schema.value = await (0, _validation.validateSchema)(schema.value);
  }
  return {
    form,
    schema,
    validate
  };
}