diff --git a/packages/shims-vue-runtime.d.ts b/packages/shims-vue-runtime.d.ts index 463f675a6965477a1a0e153d253aefee12ae6d7c..012c97780589df2dc2b1b4af5937a6e3a50a5344 100644 --- a/packages/shims-vue-runtime.d.ts +++ b/packages/shims-vue-runtime.d.ts @@ -1,5 +1,4 @@ -import { EventChannel } from '@dcloudio/uni-shared' -import { UniLifecycleHooks } from '@dcloudio/uni-vue/src/apiLifecycle' +import { EventChannel, UniLifecycleHooks } from '@dcloudio/uni-shared' import { ComponentCustomProperties, ComponentInternalInstance } from 'vue' declare module '@vue/runtime-core' { interface ComponentCustomProperties { @@ -19,9 +18,9 @@ declare module '@vue/runtime-core' { type LifecycleHook = Function[] | null type UniLifecycleHookInstance = { - [name in UniLifecycleHooks]: LifecycleHook + [name in typeof UniLifecycleHooks[number]]: LifecycleHook } - interface ComponentInternalInstance { + interface ComponentInternalInstance extends UniLifecycleHookInstance { __isUnload: boolean __isVisible: boolean __isActive?: boolean // tabBar @@ -29,13 +28,6 @@ declare module '@vue/runtime-core' { $wxsModules?: string[] } - export const callSyncHook: ( - name: 'onLaunch' | 'onLoad' | 'onShow', - type: UniLifecycleHooks, - options: ComponentOptions, - instance: ComponentInternalInstance, - globalMixins: ComponentOptions[] - ) => void export const onBeforeActivate: (fn: () => void) => void export const onBeforeDeactivate: (fn: () => void) => void export const injectHook: (