c7a063a152
This PR adds a method to ElementHandle that validates the tag type of that handle and returns it. Fixed: #8579, #9280
18 lines
371 B
Markdown
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;
|
|
```
|