@@ -3,7 +3,7 @@ import * as path from 'path'
33import { JSHandle , Page } from 'playwright'
44import waitForExpect from 'wait-for-expect'
55
6- import { ElementHandle , IConfigureOptions , IQueryUtils , IScopedQueryUtils } from './typedefs'
6+ import { ElementHandle , ConfigurationOptions , Queries , ScopedQueries } from './typedefs'
77import { queryNames } from './common'
88
99const domLibraryAsString = readFileSync (
@@ -88,11 +88,11 @@ async function covertToElementHandle(handle: JSHandle, asArray: boolean): Promis
8888 return asArray ? createElementHandleArray ( handle ) : createElementHandle ( handle )
8989}
9090
91- function processNodeText ( handles : IHandleSet ) : Promise < string > {
91+ function processNodeText ( handles : HandleSet ) : Promise < string > {
9292 return handles . containerHandle . evaluate ( handles . evaluateFn , [ 'getNodeText' ] )
9393}
9494
95- async function processQuery ( handles : IHandleSet ) : Promise < DOMReturnType > {
95+ async function processQuery ( handles : HandleSet ) : Promise < DOMReturnType > {
9696 const { containerHandle, evaluateFn, fnName, argsToForward} = handles
9797
9898 try {
@@ -111,7 +111,7 @@ async function processQuery(handles: IHandleSet): Promise<DOMReturnType> {
111111 }
112112}
113113
114- interface IHandleSet {
114+ interface HandleSet {
115115 containerHandle : ElementHandle
116116 // FIXME: Playwright doesn't expose a type for this like Puppeteer does with
117117 // `EvaluateFn`. This *should* be something like the `PageFunction` type that
@@ -122,9 +122,9 @@ interface IHandleSet {
122122}
123123
124124function createDelegateFor < T = DOMReturnType > (
125- fnName : keyof IQueryUtils ,
125+ fnName : keyof Queries ,
126126 contextFn ?: ContextFn ,
127- processHandleFn ?: ( handles : IHandleSet ) => Promise < T > ,
127+ processHandleFn ?: ( handles : HandleSet ) => Promise < T > ,
128128) : ( ...args : any [ ] ) => Promise < T > {
129129 // @ts -ignore
130130 // eslint-disable-next-line no-param-reassign
@@ -171,7 +171,7 @@ export function wait(
171171
172172export const waitFor = wait
173173
174- export function configure ( options : Partial < IConfigureOptions > ) : void {
174+ export function configure ( options : Partial < ConfigurationOptions > ) : void {
175175 if ( ! options ) {
176176 return
177177 }
@@ -189,7 +189,7 @@ export function configure(options: Partial<IConfigureOptions>): void {
189189export function getQueriesForElement < T > (
190190 object : T ,
191191 contextFn ?: ContextFn ,
192- ) : T & IQueryUtils & IScopedQueryUtils {
192+ ) : T & Queries & ScopedQueries {
193193 const o = object as any
194194 // eslint-disable-next-line no-param-reassign
195195 if ( ! contextFn ) contextFn = ( ) => o
@@ -207,5 +207,5 @@ export function getQueriesForElement<T>(
207207export const within = getQueriesForElement
208208
209209// @ts -ignore
210- export const queries : IQueryUtils = { }
210+ export const queries : Queries = { }
211211getQueriesForElement ( queries , el => el )
0 commit comments