From f4934bf4f89ba401d2e3cf2987c37f2bdde15264 Mon Sep 17 00:00:00 2001 From: Carlos Rodrigues Date: Thu, 16 Nov 2023 11:44:09 +0000 Subject: [PATCH] fix --- src/vueWrapper.ts | 26 +++++--------------------- src/wrapperFactory.ts | 2 +- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/vueWrapper.ts b/src/vueWrapper.ts index ed8c09187..de190b5ac 100644 --- a/src/vueWrapper.ts +++ b/src/vueWrapper.ts @@ -3,8 +3,7 @@ import { App, ComponentPublicInstance, VNode, - ExtractComponentEmits, - ComponentCustomProperties + ExtractComponentEmits } from 'vue' import { config } from './config' @@ -95,23 +94,9 @@ type ResolveEmitRecord = ExtractComponentEmits extends infer E } : never -declare const aaa: keyof Omit< - ComponentPublicInstance, - keyof ComponentCustomProperties -> - -// type BetterKeys = keyof Omit< -// ComponentPublicInstance, -// keyof ComponentCustomProperties -// > -// export type ComponentInstance = { -// [K in keyof ComponentPublicInstance]?: any -// } & Record - export class VueWrapper< - T extends Omit & { - $emit: any - } = ComponentPublicInstance + VM = unknown, + T extends ComponentPublicInstance = ComponentPublicInstance & VM > extends BaseWrapper { private readonly componentVM: T private readonly rootVM: ComponentPublicInstance | undefined | null @@ -251,7 +236,6 @@ export class VueWrapper< get vm(): T { return this.componentVM } - props(): T['$props'] props( selector: Selector @@ -264,9 +248,9 @@ export class VueWrapper< } emitted(): ResolveEmitRecord - emitted>( + emitted>( eventName: E - ): undefined | ResolveEmitRecord[E] + ): undefined | ResolveEmitRecord[E] emitted(eventName?: string) { return emitted(this.vm, eventName) } diff --git a/src/wrapperFactory.ts b/src/wrapperFactory.ts index 429773e30..6eea52caa 100644 --- a/src/wrapperFactory.ts +++ b/src/wrapperFactory.ts @@ -1,4 +1,4 @@ -import { ComponentPublicInstance, App } from 'vue' +import { App, ComponentPublicInstance } from 'vue' import type { DOMWrapper as DOMWrapperType } from './domWrapper' import type { VueWrapper as VueWrapperType } from './vueWrapper'