@@ -3,7 +3,7 @@ import * as path from 'path'
3
3
import { JSHandle , Page } from 'playwright'
4
4
import waitForExpect from 'wait-for-expect'
5
5
6
- import { ElementHandle , IConfigureOptions , IQueryUtils , IScopedQueryUtils } from './typedefs'
6
+ import { ElementHandle , ConfigurationOptions , Queries , ScopedQueries } from './typedefs'
7
7
import { queryNames } from './common'
8
8
9
9
const domLibraryAsString = readFileSync (
@@ -88,11 +88,11 @@ async function covertToElementHandle(handle: JSHandle, asArray: boolean): Promis
88
88
return asArray ? createElementHandleArray ( handle ) : createElementHandle ( handle )
89
89
}
90
90
91
- function processNodeText ( handles : IHandleSet ) : Promise < string > {
91
+ function processNodeText ( handles : HandleSet ) : Promise < string > {
92
92
return handles . containerHandle . evaluate ( handles . evaluateFn , [ 'getNodeText' ] )
93
93
}
94
94
95
- async function processQuery ( handles : IHandleSet ) : Promise < DOMReturnType > {
95
+ async function processQuery ( handles : HandleSet ) : Promise < DOMReturnType > {
96
96
const { containerHandle, evaluateFn, fnName, argsToForward} = handles
97
97
98
98
try {
@@ -111,7 +111,7 @@ async function processQuery(handles: IHandleSet): Promise<DOMReturnType> {
111
111
}
112
112
}
113
113
114
- interface IHandleSet {
114
+ interface HandleSet {
115
115
containerHandle : ElementHandle
116
116
// FIXME: Playwright doesn't expose a type for this like Puppeteer does with
117
117
// `EvaluateFn`. This *should* be something like the `PageFunction` type that
@@ -122,9 +122,9 @@ interface IHandleSet {
122
122
}
123
123
124
124
function createDelegateFor < T = DOMReturnType > (
125
- fnName : keyof IQueryUtils ,
125
+ fnName : keyof Queries ,
126
126
contextFn ?: ContextFn ,
127
- processHandleFn ?: ( handles : IHandleSet ) => Promise < T > ,
127
+ processHandleFn ?: ( handles : HandleSet ) => Promise < T > ,
128
128
) : ( ...args : any [ ] ) => Promise < T > {
129
129
// @ts -ignore
130
130
// eslint-disable-next-line no-param-reassign
@@ -171,7 +171,7 @@ export function wait(
171
171
172
172
export const waitFor = wait
173
173
174
- export function configure ( options : Partial < IConfigureOptions > ) : void {
174
+ export function configure ( options : Partial < ConfigurationOptions > ) : void {
175
175
if ( ! options ) {
176
176
return
177
177
}
@@ -189,7 +189,7 @@ export function configure(options: Partial<IConfigureOptions>): void {
189
189
export function getQueriesForElement < T > (
190
190
object : T ,
191
191
contextFn ?: ContextFn ,
192
- ) : T & IQueryUtils & IScopedQueryUtils {
192
+ ) : T & Queries & ScopedQueries {
193
193
const o = object as any
194
194
// eslint-disable-next-line no-param-reassign
195
195
if ( ! contextFn ) contextFn = ( ) => o
@@ -207,5 +207,5 @@ export function getQueriesForElement<T>(
207
207
export const within = getQueriesForElement
208
208
209
209
// @ts -ignore
210
- export const queries : IQueryUtils = { }
210
+ export const queries : Queries = { }
211
211
getQueriesForElement ( queries , el => el )
0 commit comments