{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-refs/index.ts"],"sourcesContent":["import type { Key, RefsValue, RefType } from '@antdv/types';\nimport type { Ref } from 'vue';\nimport { onBeforeUpdate, ref } from 'vue';\n\ntype UseRef = [(key: Key) => (el: RefType) => void, Ref<RefsValue>];\nexport function useRefs(): UseRef {\n  const refs = ref<RefsValue>(new Map());\n\n  const setRef = (key: Key) => (el: RefType) => {\n    refs.value.set(key, el);\n  };\n  onBeforeUpdate(() => {\n    refs.value = new Map();\n  });\n  return [setRef, refs];\n}\n"],"names":[],"mappings":";;AAKO,SAAS,OAAkB,GAAA;AAChC,EAAA,MAAM,IAAO,GAAA,GAAA,iBAAmB,IAAA,GAAA,EAAK,CAAA,CAAA;AAErC,EAAA,MAAM,MAAS,GAAA,CAAC,GAAa,KAAA,CAAC,EAAgB,KAAA;AAC5C,IAAK,IAAA,CAAA,KAAA,CAAM,GAAI,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAAA,GACxB,CAAA;AACA,EAAA,cAAA,CAAe,MAAM;AACnB,IAAK,IAAA,CAAA,KAAA,uBAAY,GAAI,EAAA,CAAA;AAAA,GACtB,CAAA,CAAA;AACD,EAAO,OAAA,CAAC,QAAQ,IAAI,CAAA,CAAA;AACtB;;;;"}