From 75cb96a24e5dc98d947a175a12a6be5aa4a77bb6 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 2 Aug 2022 22:23:01 +0800 Subject: [PATCH] feat: add return type to the usePluginLifeCycle function Signed-off-by: Ryan Wang --- src/modules/system/plugins/composables/use-plugin.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/system/plugins/composables/use-plugin.ts b/src/modules/system/plugins/composables/use-plugin.ts index 523e6190e..373d7ce80 100644 --- a/src/modules/system/plugins/composables/use-plugin.ts +++ b/src/modules/system/plugins/composables/use-plugin.ts @@ -1,11 +1,19 @@ -import type { Ref } from "vue"; +import type { ComputedRef, Ref } from "vue"; import { computed } from "vue"; import type { Plugin } from "@halo-dev/api-client"; import cloneDeep from "lodash.clonedeep"; import { apiClient } from "@halo-dev/admin-shared"; import { useDialog } from "@halo-dev/components"; -export function usePluginLifeCycle(plugin: Ref) { +interface usePluginLifeCycleReturn { + isStarted: ComputedRef; + changeStatus: () => void; + uninstall: () => void; +} + +export function usePluginLifeCycle( + plugin: Ref +): usePluginLifeCycleReturn { const dialog = useDialog(); const isStarted = computed(() => {