Skip to content

Commit 309af60

Browse files
authored
Merge pull request #191 from AngeloGulina/176-remove-exists-from-get-retur-type
fix: make get() return type adhering to its return type
2 parents 8cdee79 + 351157c commit 309af60

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/vueWrapper.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ export class VueWrapper<T extends ComponentPublicInstance> {
125125

126126
get<K extends keyof HTMLElementTagNameMap>(
127127
selector: K
128-
): DOMWrapper<HTMLElementTagNameMap[K]>
128+
): Omit<DOMWrapper<HTMLElementTagNameMap[K]>, 'exists'>
129129
get<K extends keyof SVGElementTagNameMap>(
130130
selector: K
131-
): DOMWrapper<SVGElementTagNameMap[K]>
132-
get<T extends Element>(selector: string): DOMWrapper<T>
133-
get(selector: string): DOMWrapper<Element> {
131+
): Omit<DOMWrapper<SVGElementTagNameMap[K]>, 'exists'>
132+
get<T extends Element>(selector: string): Omit<DOMWrapper<T>, 'exists'>
133+
get(selector: string): Omit<DOMWrapper<Element>, 'exists'> {
134134
const result = this.find(selector)
135135
if (result instanceof DOMWrapper) {
136136
return result
@@ -169,13 +169,13 @@ export class VueWrapper<T extends ComponentPublicInstance> {
169169

170170
getComponent<T extends ComponentPublicInstance>(
171171
selector: new () => T
172-
): VueWrapper<T>
172+
): Omit<VueWrapper<T>, 'exists'>
173173
getComponent<T extends ComponentPublicInstance>(
174174
selector: FindComponentSelector
175-
): VueWrapper<T>
175+
): Omit<VueWrapper<T>, 'exists'>
176176
getComponent<T extends ComponentPublicInstance>(
177177
selector: any
178-
): VueWrapper<T> {
178+
): Omit<VueWrapper<T>, 'exists'> {
179179
const result = this.findComponent(selector)
180180

181181
if (result instanceof VueWrapper) {

0 commit comments

Comments
 (0)