Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attributes, classes, and props to wrapper type definitions #311

Merged
merged 6 commits into from
Dec 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flow/wrapper.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ declare type Selector = any

declare interface BaseWrapper { // eslint-disable-line no-undef
at(index: number): Wrapper | void,
attributes(): { [name: string]: string } | void,
classes(): Array<string> | void,
contains(selector: Selector): boolean | void,
emitted(event?: string): { [name: string]: Array<Array<any>> } | Array<Array<any>> | void,
emittedByOrder(): Array<{ name: string; args: Array<any> }> | void,
Expand All @@ -22,6 +24,7 @@ declare interface BaseWrapper { // eslint-disable-line no-undef
isEmpty(): boolean | void,
isVueInstance(): boolean | void,
name(): string | void,
props(): { [name: string]: any } | void,
text(): string | void,
setData(data: Object): void,
setComputed(computed: Object): void,
Expand Down
4 changes: 4 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ interface BaseWrapper {
contains (selector: Selector): boolean
exists (): boolean

attributes(): { [name: string]: string } | void
classes(): Array<string> | void
props(): { [name: string]: any } | void

hasAttribute (attribute: string, value: string): boolean
hasClass (className: string): boolean
hasProp (prop: string, value: any): boolean
Expand Down