puppeteer/docs/api/puppeteer.elementfor.md
jrandolf c7a063a152
feat: add element validation (#9352)
This PR adds a method to ElementHandle that validates the tag type of
that handle and returns it.

Fixed: #8579, #9280
2022-12-19 13:25:56 +01:00

18 lines
371 B
Markdown

---
sidebar_label: ElementFor
---
# ElementFor type
#### Signature:
```typescript
export declare type ElementFor<
TagName extends keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap
> = TagName extends keyof HTMLElementTagNameMap
? HTMLElementTagNameMap[TagName]
: TagName extends keyof SVGElementTagNameMap
? SVGElementTagNameMap[TagName]
: never;
```