import{r as n,aC as f,l as s,cj as l,ac as d}from"./index-9PRMimni.js";import{u as h}from"./usePageCache-DluHn7Yy.js";function g(m){const o=n(null),r=n(!1),{registerForm:c}=h(m);async function a(){const e=s(o);return e||console.error("The form instance has not been obtained, please make sure that the form has been rendered when performing the form operation!"),await d(),e}function i(e){f(()=>{o.value=null,r.value=null}),!(s(r)&&l()&&e===s(o))&&(o.value=e,r.value=!0,c(e))}return[i,{setProps:async e=>{await(await a()).setProps(e)},resetFields:async()=>{a().then(async e=>{await e.resetFields()})},clearValidate:async e=>{await(await a()).clearValidate(e)},getFieldsValue:()=>s(o)?.getFieldsValue(),setFieldsValue:async e=>{await(await a()).setFieldsValue(e)},submit:async()=>(await a()).submit(),validate:async e=>(await a()).validate(e),setLoading:e=>{r.value=e},setSchema:async e=>{(await a()).setSchema(e)},setGroupSchema:async e=>{(await a()).setGroupSchema(e)},updateSchema:async e=>{await(await a()).updateSchema(e)},updateGroupSchema:async(e,t,u)=>{await(await a()).updateGroupSchema(e,t,u)},deletePageFormCache:async()=>{await(await a()).deletePageFormCache()}}]}export{g as u};
