-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1ef5c1
commit 4193c7c
Showing
12 changed files
with
173 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
Config as BaseConfig, | ||
BoundFunction as BoundFunctionBase, | ||
queries, | ||
} from '@testing-library/dom' | ||
import {Element} from 'webdriverio' | ||
|
||
export type Config = Pick<BaseConfig, 'testIdAttribute'> | ||
|
||
export type WebdriverIOQueryReturnType<T> = T extends Promise<HTMLElement> | ||
? Element | ||
: T extends HTMLElement | ||
? Element | ||
: T extends Promise<HTMLElement[]> | ||
? Element[] | ||
: T extends HTMLElement[] | ||
? Element[] | ||
: T extends null | ||
? null | ||
: never | ||
|
||
export type WebdriverIOBoundFunction<T> = ( | ||
...params: Parameters<BoundFunctionBase<T>> | ||
) => Promise<WebdriverIOQueryReturnType<ReturnType<BoundFunctionBase<T>>>> | ||
|
||
export type WebdriverIOBoundFunctionSync<T> = ( | ||
...params: Parameters<BoundFunctionBase<T>> | ||
) => WebdriverIOQueryReturnType<ReturnType<BoundFunctionBase<T>>> | ||
|
||
export type WebdriverIOBoundFunctions<T> = { | ||
[P in keyof T]: WebdriverIOBoundFunction<T[P]> | ||
} | ||
|
||
export type WebdriverIOBoundFunctionsSync<T> = { | ||
[P in keyof T]: WebdriverIOBoundFunctionSync<T[P]> | ||
} | ||
|
||
export type WebdriverIOQueries = WebdriverIOBoundFunctions<typeof queries> | ||
export type WebdriverIOQueriesSync = WebdriverIOBoundFunctionsSync< | ||
typeof queries | ||
> | ||
|
||
export type QueryName = keyof typeof queries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"declaration": true | ||
}, | ||
"exclude": ["test", "dist"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"target": "es2019", | ||
"module": "commonjs", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"declaration": true, | ||
"outDir": "./dist", | ||
"skipLibCheck": true | ||
} | ||
} |
Oops, something went wrong.