Skip to content

Commit 45a445b

Browse files
pshrmneddyerburgh
authored andcommitted
feat: add attributes, classes, and props to wrapper type definitions (#311)
* Add wrapper attributes/classes to TypeScript types * Add wrapper attributes/classes to Flow types * Add wrapper props to TypeScript types * Add wrapper props to Flow types * Flow types can return void * TypeScript types can return void
1 parent 60dde1e commit 45a445b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: flow/wrapper.flow.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ declare type Selector = any
77

88
declare interface BaseWrapper { // eslint-disable-line no-undef
99
at(index: number): Wrapper | void,
10+
attributes(): { [name: string]: string } | void,
11+
classes(): Array<string> | void,
1012
contains(selector: Selector): boolean | void,
1113
emitted(event?: string): { [name: string]: Array<Array<any>> } | Array<Array<any>> | void,
1214
emittedByOrder(): Array<{ name: string; args: Array<any> }> | void,
@@ -22,6 +24,7 @@ declare interface BaseWrapper { // eslint-disable-line no-undef
2224
isEmpty(): boolean | void,
2325
isVueInstance(): boolean | void,
2426
name(): string | void,
27+
props(): { [name: string]: any } | void,
2528
text(): string | void,
2629
setData(data: Object): void,
2730
setComputed(computed: Object): void,

Diff for: types/index.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ interface BaseWrapper {
4040
contains (selector: Selector): boolean
4141
exists (): boolean
4242

43+
attributes(): { [name: string]: string } | void
44+
classes(): Array<string> | void
45+
props(): { [name: string]: any } | void
46+
4347
hasAttribute (attribute: string, value: string): boolean
4448
hasClass (className: string): boolean
4549
hasProp (prop: string, value: any): boolean

0 commit comments

Comments
 (0)