mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: extends ElementHandle to Nodes (#8552)
* fix: extends `ElementHandle` to `Node`s (#8552)
This commit is contained in:
@@ -10,9 +10,9 @@ Runs `document.querySelector` within the page. If no element matches the selecto
|
||||
|
||||
```typescript
|
||||
class Page {
|
||||
$<Selector extends keyof HTMLElementTagNameMap>(
|
||||
$<Selector extends string>(
|
||||
selector: Selector
|
||||
): Promise<ElementHandle<HTMLElementTagNameMap[Selector]> | null>;
|
||||
): Promise<ElementHandle<NodeFor<Selector>> | null>;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -24,4 +24,4 @@ class Page {
|
||||
|
||||
**Returns:**
|
||||
|
||||
Promise<[ElementHandle](./puppeteer.elementhandle.md)<HTMLElementTagNameMap\[Selector\]> \| null>
|
||||
Promise<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>> \| null>
|
||||
|
||||
Reference in New Issue
Block a user