import { ref as i, unref as s } from "vue";
const p = (c) => {
  const r = i(
    c
  ), t = i();
  function a(e, n = !1) {
    const F = s(t) || {}, u = s(r) || {}, l = n ? e : {};
    return e.filters && (l.filteredValue = F[e.key] || null), e.sorter && (l.sortOrder = u.columnKey === e.key ? u.order : null), l;
  }
  function d(e, n) {
    t.value = e, r.value = n;
  }
  function o() {
    r.value = null;
  }
  function f() {
    t.value = null;
  }
  function v() {
    o(), f();
  }
  return {
    getColumnSFConfig: a,
    setSF: d,
    clearSorter: o,
    clearFilters: f,
    clearAll: v,
    sortedInfo: r,
    filteredInfo: t
  };
};
export {
  p as useTableSortedAndFiltered
};
