-
Notifications
You must be signed in to change notification settings - Fork 263
/
Copy pathtypes.ts
41 lines (35 loc) · 1.18 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Component, ComponentOptions, Directive, Plugin } from 'vue'
import { DOMWrapper } from './dom-wrapper'
import { ErrorWrapper } from './error-wrapper'
export interface WrapperAPI {
attributes: (key?: string) => string | Record<string, string>
classes: (className?: string) => string[] | boolean | ErrorWrapper
readonly element: Element
exists: () => boolean
get<T extends Element>(selector: string): DOMWrapper<T>
find<T extends Element>(selector: string): DOMWrapper<T> | ErrorWrapper
findAll<T extends Element>(selector: string): DOMWrapper<T>[]
html: () => string
text: () => string
trigger: (
eventString: string,
options?: Object
) => Promise<(fn?: () => void) => Promise<void>>
}
interface RefSelector {
ref: string
}
interface NameSelector {
name: string
}
export type FindComponentSelector = RefSelector | NameSelector | string
export type FindAllComponentsSelector = NameSelector | string
export type GlobalMountOptions = {
plugins?: Plugin[]
mixins?: ComponentOptions[]
mocks?: Record<string, any>
provide?: Record<any, any>
components?: Record<string, Component | object>
directives?: Record<string, Directive>
stubs?: Record<any, any>
}