import { ref } from 'vue'
import type { ComponentPublicInstance } from 'vue'

interface AppInstance extends ComponentPublicInstance {
    showGlobalLoading: () => void
    hideGlobalLoading: () => void
}

const appRef = ref<AppInstance | null>(null)

export const useApp = () => {
    return appRef
}

export const setAppRef = (ref: AppInstance | null) => {
    appRef.value = ref
}
