From b581967244dfb15dfec0867c4c769064bc7824db Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 25 Oct 2021 14:49:40 +0800 Subject: [PATCH] fix: types --- packages/shims-vue-runtime.d.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/shims-vue-runtime.d.ts b/packages/shims-vue-runtime.d.ts index 463f675a6..012c97780 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: ( -- GitLab