11import { ElementHandle , EvaluateFunc , HTTPRequest , HTTPResponse , Page , WaitForOptions , WaitTimeoutOptions } from 'puppeteer-core' ;
2- import { KeysOfType , Prototype } from '../../../typings/chrome-aws-lambda' ;
2+ import { Prototype } from '../../../typings/chrome-aws-lambda' ;
33
44let Super : Prototype < ElementHandle > = null ;
55
@@ -465,8 +465,8 @@ Super.prototype.getInnerText = function () {
465465 } ) ;
466466} ;
467467
468- Super . prototype . number = function < T = HTMLElement > ( decimal : string = '.' , property : KeysOfType < T , string > = 'textContent' as any ) {
469- let callback = ( node : T , decimal : string , property : KeysOfType < T , string > ) => {
468+ Super . prototype . number = function ( decimal : string = '.' , property : any ) {
469+ let callback = ( node : any , decimal : string , property : any ) => {
470470 let data = ( node [ property ] as unknown ) as string ;
471471
472472 if ( typeof data === 'string' ) {
@@ -486,7 +486,7 @@ Super.prototype.number = function <T = HTMLElement>(decimal: string = '.', prope
486486 return null ;
487487 } ;
488488
489- return this . evaluate ( callback as unknown as EvaluateFunc < Element > , decimal , property as any ) ;
489+ return this . evaluate ( callback , decimal , property as any ) ;
490490} ;
491491
492492Super . prototype . selectByLabel = function ( ...values : string [ ] ) {
@@ -523,11 +523,11 @@ Super.prototype.selectByLabel = function (...values: string[]) {
523523 return result ;
524524 } ;
525525
526- return this . evaluate ( callback as unknown as EvaluateFunc < Element > , values ) ;
526+ return this . evaluate ( callback as any , values ) ;
527527} ;
528528
529- Super . prototype . string = function < T = HTMLElement > ( property : KeysOfType < T , string > = 'textContent' as any ) {
530- let callback = ( node : T , property : KeysOfType < T , string > ) => {
529+ Super . prototype . string = function ( property : any ) {
530+ let callback = ( node : any , property : any ) => {
531531 let data = ( node [ property ] as unknown ) as string ;
532532
533533 if ( typeof data === 'string' ) {
@@ -553,5 +553,5 @@ Super.prototype.string = function <T = HTMLElement>(property: KeysOfType<T, stri
553553 return null ;
554554 } ;
555555
556- return this . evaluate ( callback as unknown as EvaluateFunc < Element > , property as any ) ;
556+ return this . evaluate ( callback , property as any ) ;
557557} ;
0 commit comments