mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs(page): add TypeScript $eval type-hint notes (#6693)
This commit is contained in:
parent
0f7a7604bc
commit
c8c849e164
@ -1012,6 +1012,8 @@ Examples:
|
||||
const searchValue = await page.$eval('#search', el => el.value);
|
||||
const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
|
||||
const html = await page.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');
|
||||
// In TypeScript, this example requires an explicit type annotation (HTMLLinkElement) on el:
|
||||
const preloadHrefTS = await page.$eval('link[rel=preload]', (el: HTMLLinkElement) => el.href);
|
||||
```
|
||||
|
||||
```java
|
||||
|
2
types/types.d.ts
vendored
2
types/types.d.ts
vendored
@ -200,6 +200,8 @@ export interface Page {
|
||||
* const searchValue = await page.$eval('#search', el => el.value);
|
||||
* const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
|
||||
* const html = await page.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');
|
||||
* // In TypeScript, this example requires an explicit type annotation (HTMLLinkElement) on el:
|
||||
* const preloadHrefTS = await page.$eval('link[rel=preload]', (el: HTMLLinkElement) => el.href);
|
||||
* ```
|
||||
*
|
||||
* Shortcut for main frame's
|
||||
|
Loading…
x
Reference in New Issue
Block a user