Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 18a1cdb

Browse files
committed
Testing types fix
1 parent c220774 commit 18a1cdb

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

source/puppeteer/lib/ElementHandle.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { 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

44
let 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

492492
Super.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
};

source/puppeteer/lib/FrameManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Frame, HTTPRequest, HTTPResponse, Page, WaitForOptions, WaitTimeoutOptions } from 'puppeteer-core';
1+
import { Frame, HTTPRequest, HTTPResponse, WaitForOptions, WaitTimeoutOptions } from 'puppeteer-core';
22
import { KeysOfType, Prototype } from '../../../typings/chrome-aws-lambda';
33

44
let Super: Prototype<Frame> = null;

typings/chrome-aws-lambda.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ declare module 'puppeteer-core' {
127127
* @param decimal - Decimal separator to use, defaults to `.`.
128128
* @param property - Element property to extract content from, defaults to `textContent`.
129129
*/
130-
number<T = HTMLElement>(decimal?: string, property?: KeysOfType<T, string>): Promise<number[]>;
130+
number(decimal?: string, property?: any): Promise<number[]>;
131131

132132
/**
133133
* Selects multiple `select` options by label and returns the values of the actual selection.
@@ -141,7 +141,7 @@ declare module 'puppeteer-core' {
141141
*
142142
* @param property - Element property to extract content from, defaults to `textContent`.
143143
*/
144-
string<T = HTMLElement>(property?: KeysOfType<T, string>): Promise<string>;
144+
string(property?: any): Promise<string>;
145145
}
146146

147147
interface Frame {

0 commit comments

Comments
 (0)