import { computed } from "vue"

import * as helperFunctions from "./helperFunctions"

export default () => {
  const widgets = computed(() => helperFunctions.getWidgetDeclacations())

  const findWidgetByName = (widgetName?: string) =>
    widgets.value.find((widget) => widget.name === widgetName)

  return {
    widgets,
    findWidgetByName,
    ...helperFunctions,
  }
}

export type * from "./types"
