diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 75be36474222f..8718c264bb5d3 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -41,7 +41,6 @@ import {
BindableObjectDefinePropertyCall,
BindableStaticNameExpression,
BindingElement,
- BindingElementGrandparent,
BindingName,
BindingPattern,
bindSourceFile,
@@ -11527,12 +11526,17 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// Return the type of a binding element parent. We check SymbolLinks first to see if a type has been
// assigned by contextual typing.
- function getTypeForBindingElementParent(node: BindingElementGrandparent, checkMode: CheckMode) {
- if (checkMode !== CheckMode.Normal) {
- return getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
+ function getTypeForBindingElementParent(node: BindingElement) {
+ const grandparent = node.parent.parent;
+ const rootParameter = tryGetRootParameterDeclaration(node);
+ if (rootParameter) {
+ const symbol = getSymbolOfDeclaration(grandparent);
+ const contextualParameterType = symbol && getSymbolLinks(symbol).type;
+ if (contextualParameterType) {
+ return contextualParameterType;
+ }
}
- const symbol = getSymbolOfDeclaration(node);
- return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
+ return getTypeForVariableLikeDeclaration(grandparent, /*includeOptionality*/ false, node.dotDotDotToken ? CheckMode.RestBindingElement : CheckMode.Normal);
}
function getRestType(source: Type, properties: PropertyName[], symbol: Symbol | undefined): Type {
@@ -11665,8 +11669,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
/** Return the inferred type for a binding element */
function getTypeForBindingElement(declaration: BindingElement): Type | undefined {
- const checkMode = declaration.dotDotDotToken ? CheckMode.RestBindingElement : CheckMode.Normal;
- const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
+ const parentType = getTypeForBindingElementParent(declaration);
return parentType && getBindingElementTypeFromParentType(declaration, parentType, /*noTupleBoundsCheck*/ false);
}
@@ -30811,7 +30814,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const type = getTypeOfSymbol(symbol);
const declaration = symbol.valueDeclaration;
if (declaration) {
- // If we have a non-rest binding element with no initializer declared as a const variable or a const-like
+ // If we have a binding element with no initializer declared as a const variable or a const-like
// parameter (a parameter for which there are no assignments in the function body), and if the parent type
// for the destructuring is a union type, one or more of the binding elements may represent discriminant
// properties, and we want the effects of conditional checks on such discriminants to affect the types of
@@ -30834,19 +30837,20 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// the binding pattern AST instance for '{ kind, payload }' as a pseudo-reference and narrow this reference
// as if it occurred in the specified location. We then recompute the narrowed binding element type by
// destructuring from the narrowed parent type.
- if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
+ if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
const parent = declaration.parent.parent;
const rootDeclaration = getRootDeclaration(parent);
if (rootDeclaration.kind === SyntaxKind.VariableDeclaration && getCombinedNodeFlagsCached(rootDeclaration) & NodeFlags.Constant || rootDeclaration.kind === SyntaxKind.Parameter) {
const links = getNodeLinks(parent);
if (!(links.flags & NodeCheckFlags.InCheckIdentifier)) {
links.flags |= NodeCheckFlags.InCheckIdentifier;
- const parentType = getTypeForBindingElementParent(parent, CheckMode.Normal);
- const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
+ const parentType = getTypeForBindingElementParent(declaration);
+ const parentNarrowableType = parentType && getNarrowableTypeForReference(parentType, location);
+
links.flags &= ~NodeCheckFlags.InCheckIdentifier;
- if (parentTypeConstraint && parentTypeConstraint.flags & TypeFlags.Union && !(rootDeclaration.kind === SyntaxKind.Parameter && isSomeSymbolAssigned(rootDeclaration))) {
+ if (parentNarrowableType && parentNarrowableType.flags & TypeFlags.Union && !(rootDeclaration.kind === SyntaxKind.Parameter && isSomeSymbolAssigned(rootDeclaration))) {
const pattern = declaration.parent;
- const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, /*flowContainer*/ undefined, location.flowNode);
+ const narrowedType = getFlowTypeOfReference(pattern, parentNarrowableType, parentNarrowableType, /*flowContainer*/ undefined, location.flowNode);
if (narrowedType.flags & TypeFlags.Never) {
return neverType;
}
@@ -44917,8 +44921,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// check private/protected variable access
const parent = node.parent.parent;
- const parentCheckMode = node.dotDotDotToken ? CheckMode.RestBindingElement : CheckMode.Normal;
- const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
+ const parentType = getTypeForBindingElementParent(node);
const name = node.propertyName || node.name;
if (parentType && !isBindingPattern(name)) {
const exprType = getLiteralTypeFromPropertyName(name);
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 1cfe3e04ba68d..b1a01425008a8 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -1911,9 +1911,6 @@ export interface BindingElement extends NamedDeclaration, FlowContainer {
readonly initializer?: Expression; // Optional initializer
}
-/** @internal */
-export type BindingElementGrandparent = BindingElement["parent"]["parent"];
-
// dprint-ignore
export interface PropertySignature extends TypeElement, JSDocContainer {
readonly kind: SyntaxKind.PropertySignature;
diff --git a/tests/baselines/reference/arrayDestructuringInSwitch1.symbols b/tests/baselines/reference/arrayDestructuringInSwitch1.symbols
index 1218fb03d02f2..96664f670e4ed 100644
--- a/tests/baselines/reference/arrayDestructuringInSwitch1.symbols
+++ b/tests/baselines/reference/arrayDestructuringInSwitch1.symbols
@@ -31,9 +31,9 @@ export function evaluate(expression: Expression): boolean {
case 'and': {
return operands.every((child) => evaluate(child));
->operands.every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
+>operands.every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>operands : Symbol(operands, Decl(arrayDestructuringInSwitch1.ts, 5, 20))
->every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
+>every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>child : Symbol(child, Decl(arrayDestructuringInSwitch1.ts, 8, 31))
>evaluate : Symbol(evaluate, Decl(arrayDestructuringInSwitch1.ts, 1, 84))
>child : Symbol(child, Decl(arrayDestructuringInSwitch1.ts, 8, 31))
diff --git a/tests/baselines/reference/arrayDestructuringInSwitch1.types b/tests/baselines/reference/arrayDestructuringInSwitch1.types
index ec8ad2209e0b2..201627f79f332 100644
--- a/tests/baselines/reference/arrayDestructuringInSwitch1.types
+++ b/tests/baselines/reference/arrayDestructuringInSwitch1.types
@@ -46,12 +46,12 @@ export function evaluate(expression: Expression): boolean {
return operands.every((child) => evaluate(child));
>operands.every((child) => evaluate(child)) : boolean
> : ^^^^^^^
->operands.every : { (predicate: (value: Expression, index: number, array: Expression[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: Expression, index: number, array: Expression[]) => unknown, thisArg?: any): boolean; } | { (predicate: (value: Expression, index: number, array: Expression[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: Expression, index: number, array: Expression[]) => unknown, thisArg?: any): boolean; }
-> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^ ^ ^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^ ^ ^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^ ^^^
->operands : Expression[] | [Expression]
-> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
->every : { (predicate: (value: Expression, index: number, array: Expression[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: Expression, index: number, array: Expression[]) => unknown, thisArg?: any): boolean; } | { (predicate: (value: Expression, index: number, array: Expression[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: Expression, index: number, array: Expression[]) => unknown, thisArg?: any): boolean; }
-> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^ ^ ^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^ ^ ^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^ ^^^
+>operands.every : { (predicate: (value: Expression, index: number, array: Expression[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: Expression, index: number, array: Expression[]) => unknown, thisArg?: any): boolean; }
+> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^ ^ ^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^ ^^^
+>operands : Expression[]
+> : ^^^^^^^^^^^^
+>every : { (predicate: (value: Expression, index: number, array: Expression[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: Expression, index: number, array: Expression[]) => unknown, thisArg?: any): boolean; }
+> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^ ^ ^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^ ^^^
>(child) => evaluate(child) : (child: Expression) => boolean
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^
>child : Expression
@@ -76,8 +76,8 @@ export function evaluate(expression: Expression): boolean {
> : ^ ^^ ^^^^^
>operands[0] : Expression
> : ^^^^^^^^^^
->operands : Expression[] | [Expression]
-> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+>operands : [Expression]
+> : ^^^^^^^^^^^^
>0 : 0
> : ^
}
diff --git a/tests/baselines/reference/dependentDestructuredRestVariables1.symbols b/tests/baselines/reference/dependentDestructuredRestVariables1.symbols
new file mode 100644
index 0000000000000..9847a8ce9180d
--- /dev/null
+++ b/tests/baselines/reference/dependentDestructuredRestVariables1.symbols
@@ -0,0 +1,248 @@
+//// [tests/cases/conformance/controlFlow/dependentDestructuredRestVariables1.tsx] ////
+
+=== dependentDestructuredRestVariables1.tsx ===
+///
+
+import React from "react";
+>React : Symbol(React, Decl(dependentDestructuredRestVariables1.tsx, 2, 6))
+
+// https://github.com/microsoft/TypeScript/issues/46680
+
+type Action1 = { kind: "A"; payload: number } | { kind: "B"; payload: string };
+>Action1 : Symbol(Action1, Decl(dependentDestructuredRestVariables1.tsx, 2, 26))
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 6, 16))
+>payload : Symbol(payload, Decl(dependentDestructuredRestVariables1.tsx, 6, 27))
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 6, 49))
+>payload : Symbol(payload, Decl(dependentDestructuredRestVariables1.tsx, 6, 60))
+
+function example1({ kind, ...rest }: Action1) {
+>example1 : Symbol(example1, Decl(dependentDestructuredRestVariables1.tsx, 6, 79))
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 8, 19))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 8, 25))
+>Action1 : Symbol(Action1, Decl(dependentDestructuredRestVariables1.tsx, 2, 26))
+
+ if (kind === "A") {
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 8, 19))
+
+ rest.payload.toFixed();
+>rest.payload.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+>rest.payload : Symbol(payload, Decl(dependentDestructuredRestVariables1.tsx, 6, 27))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 8, 25))
+>payload : Symbol(payload, Decl(dependentDestructuredRestVariables1.tsx, 6, 27))
+>toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+ }
+ if (kind === "B") {
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 8, 19))
+
+ rest.payload.toUpperCase();
+>rest.payload.toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
+>rest.payload : Symbol(payload, Decl(dependentDestructuredRestVariables1.tsx, 6, 60))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 8, 25))
+>payload : Symbol(payload, Decl(dependentDestructuredRestVariables1.tsx, 6, 60))
+>toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
+ }
+}
+
+type Action2 = [kind: "A", payload: number] | [kind: "B", payload: string];
+>Action2 : Symbol(Action2, Decl(dependentDestructuredRestVariables1.tsx, 15, 1))
+
+function example2([kind, ...rest]: Action2) {
+>example2 : Symbol(example2, Decl(dependentDestructuredRestVariables1.tsx, 17, 75))
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 19, 19))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 19, 24))
+>Action2 : Symbol(Action2, Decl(dependentDestructuredRestVariables1.tsx, 15, 1))
+
+ if (kind === "A") {
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 19, 19))
+
+ rest[0].toFixed();
+>rest[0].toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 19, 24))
+>0 : Symbol(0)
+>toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+ }
+ if (kind === "B") {
+>kind : Symbol(kind, Decl(dependentDestructuredRestVariables1.tsx, 19, 19))
+
+ rest[0].toUpperCase();
+>rest[0].toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 19, 24))
+>0 : Symbol(0)
+>toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
+ }
+}
+
+type Props1 =
+>Props1 : Symbol(Props1, Decl(dependentDestructuredRestVariables1.tsx, 26, 1))
+
+ | ({ as: "div" } & React.ComponentPropsWithRef<"div">)
+>as : Symbol(as, Decl(dependentDestructuredRestVariables1.tsx, 29, 6))
+>React : Symbol(React, Decl(dependentDestructuredRestVariables1.tsx, 2, 6))
+>ComponentPropsWithRef : Symbol(React.ComponentPropsWithRef, Decl(react16.d.ts, 2434, 25))
+
+ | ({ as: "span" } & React.ComponentPropsWithRef<"span">);
+>as : Symbol(as, Decl(dependentDestructuredRestVariables1.tsx, 30, 6))
+>React : Symbol(React, Decl(dependentDestructuredRestVariables1.tsx, 2, 6))
+>ComponentPropsWithRef : Symbol(React.ComponentPropsWithRef, Decl(react16.d.ts, 2434, 25))
+
+function MyComponent1({ as, ...rest }: Props1) {
+>MyComponent1 : Symbol(MyComponent1, Decl(dependentDestructuredRestVariables1.tsx, 30, 59))
+>as : Symbol(as, Decl(dependentDestructuredRestVariables1.tsx, 32, 23))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 32, 27))
+>Props1 : Symbol(Props1, Decl(dependentDestructuredRestVariables1.tsx, 26, 1))
+
+ if (as === "div") {
+>as : Symbol(as, Decl(dependentDestructuredRestVariables1.tsx, 32, 23))
+
+ return
;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 32, 27))
+ }
+ if (as === "span") {
+>as : Symbol(as, Decl(dependentDestructuredRestVariables1.tsx, 32, 23))
+
+ return ;
+>span : Symbol(JSX.IntrinsicElements.span, Decl(react16.d.ts, 2609, 114))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 32, 27))
+ }
+}
+
+type Params1 = {
+>Params1 : Symbol(Params1, Decl(dependentDestructuredRestVariables1.tsx, 39, 1))
+
+ foo: string;
+>foo : Symbol(foo, Decl(dependentDestructuredRestVariables1.tsx, 41, 16))
+
+} & ({ tag: "a"; type: number } | { tag: "b"; type: string });
+>tag : Symbol(tag, Decl(dependentDestructuredRestVariables1.tsx, 43, 6))
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 43, 16))
+>tag : Symbol(tag, Decl(dependentDestructuredRestVariables1.tsx, 43, 35))
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 43, 45))
+
+const fn1 = (params: P) => {
+>fn1 : Symbol(fn1, Decl(dependentDestructuredRestVariables1.tsx, 45, 5))
+>P : Symbol(P, Decl(dependentDestructuredRestVariables1.tsx, 45, 13))
+>Params1 : Symbol(Params1, Decl(dependentDestructuredRestVariables1.tsx, 39, 1))
+>params : Symbol(params, Decl(dependentDestructuredRestVariables1.tsx, 45, 32))
+>P : Symbol(P, Decl(dependentDestructuredRestVariables1.tsx, 45, 13))
+
+ const { foo, ...rest } = params;
+>foo : Symbol(foo, Decl(dependentDestructuredRestVariables1.tsx, 46, 9))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 46, 14))
+>params : Symbol(params, Decl(dependentDestructuredRestVariables1.tsx, 45, 32))
+
+ if (rest.tag === "a") {
+>rest.tag : Symbol(tag, Decl(dependentDestructuredRestVariables1.tsx, 43, 6), Decl(dependentDestructuredRestVariables1.tsx, 43, 35))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 46, 14))
+>tag : Symbol(tag, Decl(dependentDestructuredRestVariables1.tsx, 43, 6), Decl(dependentDestructuredRestVariables1.tsx, 43, 35))
+
+ rest.type.toFixed(); // ok
+>rest.type.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+>rest.type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 43, 16))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 46, 14))
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 43, 16))
+>toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+
+ return rest; // Omit
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 46, 14))
+ }
+
+ return undefined;
+>undefined : Symbol(undefined)
+
+};
+
+const fn2 =
({ foo, ...rest }: P) => {
+>fn2 : Symbol(fn2, Decl(dependentDestructuredRestVariables1.tsx, 56, 5))
+>P : Symbol(P, Decl(dependentDestructuredRestVariables1.tsx, 56, 13))
+>Params1 : Symbol(Params1, Decl(dependentDestructuredRestVariables1.tsx, 39, 1))
+>foo : Symbol(foo, Decl(dependentDestructuredRestVariables1.tsx, 56, 33))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 56, 38))
+>P : Symbol(P, Decl(dependentDestructuredRestVariables1.tsx, 56, 13))
+
+ if (rest.tag === "a") {
+>rest.tag : Symbol(tag, Decl(dependentDestructuredRestVariables1.tsx, 43, 6), Decl(dependentDestructuredRestVariables1.tsx, 43, 35))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 56, 38))
+>tag : Symbol(tag, Decl(dependentDestructuredRestVariables1.tsx, 43, 6), Decl(dependentDestructuredRestVariables1.tsx, 43, 35))
+
+ rest.type.toFixed(); // ok
+>rest.type.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+>rest.type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 43, 16))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 56, 38))
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 43, 16))
+>toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
+
+ return rest; // Omit
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 56, 38))
+ }
+
+ return undefined;
+>undefined : Symbol(undefined)
+
+};
+
+// https://github.com/microsoft/TypeScript/issues/53947
+
+function ImageAvatar(props: { className?: string; src: string }) {
+>ImageAvatar : Symbol(ImageAvatar, Decl(dependentDestructuredRestVariables1.tsx, 63, 2))
+>props : Symbol(props, Decl(dependentDestructuredRestVariables1.tsx, 67, 21))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 67, 29))
+>src : Symbol(src, Decl(dependentDestructuredRestVariables1.tsx, 67, 49))
+
+ return null;
+}
+
+function InitialsAvatar(props: { className?: string; name: string }) {
+>InitialsAvatar : Symbol(InitialsAvatar, Decl(dependentDestructuredRestVariables1.tsx, 69, 1))
+>props : Symbol(props, Decl(dependentDestructuredRestVariables1.tsx, 71, 24))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 71, 32))
+>name : Symbol(name, Decl(dependentDestructuredRestVariables1.tsx, 71, 52))
+
+ return null;
+}
+
+type AvatarProps =
+>AvatarProps : Symbol(AvatarProps, Decl(dependentDestructuredRestVariables1.tsx, 73, 1))
+
+ | { type: "image"; src: string; className: string }
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 76, 5))
+>src : Symbol(src, Decl(dependentDestructuredRestVariables1.tsx, 76, 20))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 76, 33))
+
+ | { type: "initials"; name: string; className: string };
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 77, 5))
+>name : Symbol(name, Decl(dependentDestructuredRestVariables1.tsx, 77, 23))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 77, 37))
+
+const Avatar = ({ type, className, ...rest }: AvatarProps) => {
+>Avatar : Symbol(Avatar, Decl(dependentDestructuredRestVariables1.tsx, 79, 5))
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 79, 17))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 79, 23))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 79, 34))
+>AvatarProps : Symbol(AvatarProps, Decl(dependentDestructuredRestVariables1.tsx, 73, 1))
+
+ if (type === "image") {
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 79, 17))
+
+ return ;
+>ImageAvatar : Symbol(ImageAvatar, Decl(dependentDestructuredRestVariables1.tsx, 63, 2))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 81, 23))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 79, 23))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 79, 34))
+ }
+
+ if (type === "initials") {
+>type : Symbol(type, Decl(dependentDestructuredRestVariables1.tsx, 79, 17))
+
+ return ;
+>InitialsAvatar : Symbol(InitialsAvatar, Decl(dependentDestructuredRestVariables1.tsx, 69, 1))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 85, 26))
+>className : Symbol(className, Decl(dependentDestructuredRestVariables1.tsx, 79, 23))
+>rest : Symbol(rest, Decl(dependentDestructuredRestVariables1.tsx, 79, 34))
+ }
+
+ throw new Error("");
+>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --))
+
+};
+
diff --git a/tests/baselines/reference/dependentDestructuredRestVariables1.types b/tests/baselines/reference/dependentDestructuredRestVariables1.types
new file mode 100644
index 0000000000000..f2d787a7ed229
--- /dev/null
+++ b/tests/baselines/reference/dependentDestructuredRestVariables1.types
@@ -0,0 +1,429 @@
+//// [tests/cases/conformance/controlFlow/dependentDestructuredRestVariables1.tsx] ////
+
+=== Performance Stats ===
+Assignability cache: 2,500
+Type Count: 10,000
+Instantiation count: 100,000
+Symbol count: 50,000
+
+=== dependentDestructuredRestVariables1.tsx ===
+///
+
+import React from "react";
+>React : typeof React
+> : ^^^^^^^^^^^^
+
+// https://github.com/microsoft/TypeScript/issues/46680
+
+type Action1 = { kind: "A"; payload: number } | { kind: "B"; payload: string };
+>Action1 : Action1
+> : ^^^^^^^
+>kind : "A"
+> : ^^^
+>payload : number
+> : ^^^^^^
+>kind : "B"
+> : ^^^
+>payload : string
+> : ^^^^^^
+
+function example1({ kind, ...rest }: Action1) {
+>example1 : ({ kind, ...rest }: Action1) => void
+> : ^ ^^ ^^^^^^^^^
+>kind : "A" | "B"
+> : ^^^^^^^^^
+>rest : { payload: number; } | { payload: string; }
+> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^
+
+ if (kind === "A") {
+>kind === "A" : boolean
+> : ^^^^^^^
+>kind : "A" | "B"
+> : ^^^^^^^^^
+>"A" : "A"
+> : ^^^
+
+ rest.payload.toFixed();
+>rest.payload.toFixed() : string
+> : ^^^^^^
+>rest.payload.toFixed : (fractionDigits?: number) => string
+> : ^ ^^^ ^^^^^
+>rest.payload : number
+> : ^^^^^^
+>rest : { payload: number; }
+> : ^^^^^^^^^^^ ^^^
+>payload : number
+> : ^^^^^^
+>toFixed : (fractionDigits?: number) => string
+> : ^ ^^^ ^^^^^
+ }
+ if (kind === "B") {
+>kind === "B" : boolean
+> : ^^^^^^^
+>kind : "A" | "B"
+> : ^^^^^^^^^
+>"B" : "B"
+> : ^^^
+
+ rest.payload.toUpperCase();
+>rest.payload.toUpperCase() : string
+> : ^^^^^^
+>rest.payload.toUpperCase : () => string
+> : ^^^^^^
+>rest.payload : string
+> : ^^^^^^
+>rest : { payload: string; }
+> : ^^^^^^^^^^^ ^^^
+>payload : string
+> : ^^^^^^
+>toUpperCase : () => string
+> : ^^^^^^
+ }
+}
+
+type Action2 = [kind: "A", payload: number] | [kind: "B", payload: string];
+>Action2 : Action2
+> : ^^^^^^^
+
+function example2([kind, ...rest]: Action2) {
+>example2 : ([kind, ...rest]: Action2) => void
+> : ^ ^^ ^^^^^^^^^
+>kind : "A" | "B"
+> : ^^^^^^^^^
+>rest : [payload: number] | [payload: string]
+> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ if (kind === "A") {
+>kind === "A" : boolean
+> : ^^^^^^^
+>kind : "A" | "B"
+> : ^^^^^^^^^
+>"A" : "A"
+> : ^^^
+
+ rest[0].toFixed();
+>rest[0].toFixed() : string
+> : ^^^^^^
+>rest[0].toFixed : (fractionDigits?: number) => string
+> : ^ ^^^ ^^^^^
+>rest[0] : number
+> : ^^^^^^
+>rest : [payload: number]
+> : ^^^^^^^^^^^^^^^^^
+>0 : 0
+> : ^
+>toFixed : (fractionDigits?: number) => string
+> : ^ ^^^ ^^^^^
+ }
+ if (kind === "B") {
+>kind === "B" : boolean
+> : ^^^^^^^
+>kind : "A" | "B"
+> : ^^^^^^^^^
+>"B" : "B"
+> : ^^^
+
+ rest[0].toUpperCase();
+>rest[0].toUpperCase() : string
+> : ^^^^^^
+>rest[0].toUpperCase : () => string
+> : ^^^^^^
+>rest[0] : string
+> : ^^^^^^
+>rest : [payload: string]
+> : ^^^^^^^^^^^^^^^^^
+>0 : 0
+> : ^
+>toUpperCase : () => string
+> : ^^^^^^
+ }
+}
+
+type Props1 =
+>Props1 : Props1
+> : ^^^^^^
+
+ | ({ as: "div" } & React.ComponentPropsWithRef<"div">)
+>as : "div"
+> : ^^^^^
+>React : any
+> : ^^^
+
+ | ({ as: "span" } & React.ComponentPropsWithRef<"span">);
+>as : "span"
+> : ^^^^^^
+>React : any
+> : ^^^
+
+function MyComponent1({ as, ...rest }: Props1) {
+>MyComponent1 : ({ as, ...rest }: Props1) => JSX.Element | undefined
+> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+>as : "div" | "span"
+> : ^^^^^^^^^^^^^^
+>rest : { children?: React.ReactNode; style?: React.CSSProperties | undefined; title?: string | undefined; defaultChecked?: boolean | undefined; defaultValue?: string | string[] | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; className?: string | undefined; contentEditable?: boolean | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: boolean | undefined; hidden?: boolean | undefined; id?: string | undefined; lang?: string | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: boolean | undefined; tabIndex?: number | undefined; inputMode?: string | undefined; is?: string | undefined; radioGroup?: string | undefined; role?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; color?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: "on" | "off" | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | "false" | "true" | undefined; 'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined; 'aria-busy'?: boolean | "false" | "true" | undefined; 'aria-checked'?: boolean | "false" | "mixed" | "true" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | "false" | "true" | undefined; 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | "false" | "true" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | "false" | "true" | undefined; 'aria-haspopup'?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined; 'aria-hidden'?: boolean | "false" | "true" | undefined; 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: "off" | "assertive" | "polite" | undefined; 'aria-modal'?: boolean | "false" | "true" | undefined; 'aria-multiline'?: boolean | "false" | "true" | undefined; 'aria-multiselectable'?: boolean | "false" | "true" | undefined; 'aria-orientation'?: "horizontal" | "vertical" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | "false" | "mixed" | "true" | undefined; 'aria-readonly'?: boolean | "false" | "true" | undefined; 'aria-relevant'?: "additions" | "additions text" | "all" | "removals" | "text" | undefined; 'aria-required'?: boolean | "false" | "true" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | "false" | "true" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: React.ClipboardEventHandler | undefined; onCopyCapture?: React.ClipboardEventHandler | undefined; onCut?: React.ClipboardEventHandler | undefined; onCutCapture?: React.ClipboardEventHandler | undefined; onPaste?: React.ClipboardEventHandler | undefined; onPasteCapture?: React.ClipboardEventHandler | undefined; onCompositionEnd?: React.CompositionEventHandler | undefined; onCompositionEndCapture?: React.CompositionEventHandler | undefined; onCompositionStart?: React.CompositionEventHandler | undefined; onCompositionStartCapture?: React.CompositionEventHandler | undefined; onCompositionUpdate?: React.CompositionEventHandler | undefined; onCompositionUpdateCapture?: React.CompositionEventHandler | undefined; onFocus?: React.FocusEventHandler | undefined; onFocusCapture?: React.FocusEventHandler | undefined; onBlur?: React.FocusEventHandler | undefined; onBlurCapture?: React.FocusEventHandler | undefined; onChange?: React.FormEventHandler | undefined; onChangeCapture?: React.FormEventHandler | undefined; onInput?: React.FormEventHandler | undefined; onInputCapture?: React.FormEventHandler | undefined; onReset?: React.FormEventHandler | undefined; onResetCapture?: React.FormEventHandler | undefined; onSubmit?: React.FormEventHandler | undefined; onSubmitCapture?: React.FormEventHandler | undefined; onInvalid?: React.FormEventHandler | undefined; onInvalidCapture?: React.FormEventHandler | undefined; onLoad?: React.ReactEventHandler | undefined; onLoadCapture?: React.ReactEventHandler | undefined; onError?: React.ReactEventHandler | undefined; onErrorCapture?: React.ReactEventHandler | undefined; onKeyDown?: React.KeyboardEventHandler | undefined; onKeyDownCapture?: React.KeyboardEventHandler | undefined; onKeyPress?: React.KeyboardEventHandler | undefined; onKeyPressCapture?: React.KeyboardEventHandler | undefined; onKeyUp?: React.KeyboardEventHandler | undefined; onKeyUpCapture?: React.KeyboardEventHandler | undefined; onAbort?: React.ReactEventHandler | undefined; onAbortCapture?: React.ReactEventHandler | undefined; onCanPlay?: React.ReactEventHandler | undefined; onCanPlayCapture?: React.ReactEventHandler | undefined; onCanPlayThrough?: React.ReactEventHandler | undefined; onCanPlayThroughCapture?: React.ReactEventHandler | undefined; onDurationChange?: React.ReactEventHandler | undefined; onDurationChangeCapture?: React.ReactEventHandler | undefined; onEmptied?: React.ReactEventHandler | undefined; onEmptiedCapture?: React.ReactEventHandler | undefined; onEncrypted?: React.ReactEventHandler | undefined; onEncryptedCapture?: React.ReactEventHandler | undefined; onEnded?: React.ReactEventHandler | undefined; onEndedCapture?: React.ReactEventHandler | undefined; onLoadedData?: React.ReactEventHandler | undefined; onLoadedDataCapture?: React.ReactEventHandler | undefined; onLoadedMetadata?: React.ReactEventHandler | undefined; onLoadedMetadataCapture?: React.ReactEventHandler | undefined; onLoadStart?: React.ReactEventHandler | undefined; onLoadStartCapture?: React.ReactEventHandler | undefined; onPause?: React.ReactEventHandler | undefined; onPauseCapture?: React.ReactEventHandler | undefined; onPlay?: React.ReactEventHandler | undefined; onPlayCapture?: React.ReactEventHandler | undefined; onPlaying?: React.ReactEventHandler | undefined; onPlayingCapture?: React.ReactEventHandler | undefined; onProgress?: React.ReactEventHandler | undefined; onProgressCapture?: React.ReactEventHandler | undefined; onRateChange?: React.ReactEventHandler | undefined; onRateChangeCapture?: React.ReactEventHandler | undefined; onSeeked?: React.ReactEventHandler | undefined; onSeekedCapture?: React.ReactEventHandler | undefined; onSeeking?: React.ReactEventHandler | undefined; onSeekingCapture?: React.ReactEventHandler | undefined; onStalled?: React.ReactEventHandler | undefined; onStalledCapture?: React.ReactEventHandler | undefined; onSuspend?: React.ReactEventHandler | undefined; onSuspendCapture?: React.ReactEventHandler | undefined; onTimeUpdate?: React.ReactEventHandler | undefined; onTimeUpdateCapture?: React.ReactEventHandler | undefined; onVolumeChange?: React.ReactEventHandler | undefined; onVolumeChangeCapture?: React.ReactEventHandler | undefined; onWaiting?: React.ReactEventHandler | undefined; onWaitingCapture?: React.ReactEventHandler | undefined; onClick?: React.MouseEventHandler | undefined; onClickCapture?: React.MouseEventHandler | undefined; onContextMenu?: React.MouseEventHandler | undefined; onContextMenuCapture?: React.MouseEventHandler | undefined; onDoubleClick?: React.MouseEventHandler | undefined; onDoubleClickCapture?: React.MouseEventHandler | undefined; onDrag?: React.DragEventHandler | undefined; onDragCapture?: React.DragEventHandler | undefined; onDragEnd?: React.DragEventHandler | undefined; onDragEndCapture?: React.DragEventHandler | undefined; onDragEnter?: React.DragEventHandler | undefined; onDragEnterCapture?: React.DragEventHandler | undefined; onDragExit?: React.DragEventHandler | undefined; onDragExitCapture?: React.DragEventHandler | undefined; onDragLeave?: React.DragEventHandler | undefined; onDragLeaveCapture?: React.DragEventHandler | undefined; onDragOver?: React.DragEventHandler | undefined; onDragOverCapture?: React.DragEventHandler | undefined; onDragStart?: React.DragEventHandler | undefined; onDragStartCapture?: React.DragEventHandler | undefined; onDrop?: React.DragEventHandler | undefined; onDropCapture?: React.DragEventHandler | undefined; onMouseDown?: React.MouseEventHandler | undefined; onMouseDownCapture?: React.MouseEventHandler | undefined; onMouseEnter?: React.MouseEventHandler | undefined; onMouseLeave?: React.MouseEventHandler | undefined; onMouseMove?: React.MouseEventHandler | undefined; onMouseMoveCapture?: React.MouseEventHandler | undefined; onMouseOut?: React.MouseEventHandler | undefined; onMouseOutCapture?: React.MouseEventHandler | undefined; onMouseOver?: React.MouseEventHandler | undefined; onMouseOverCapture?: React.MouseEventHandler | undefined; onMouseUp?: React.MouseEventHandler | undefined; onMouseUpCapture?: React.MouseEventHandler | undefined; onSelect?: React.ReactEventHandler | undefined; onSelectCapture?: React.ReactEventHandler | undefined; onTouchCancel?: React.TouchEventHandler | undefined; onTouchCancelCapture?: React.TouchEventHandler | undefined; onTouchEnd?: React.TouchEventHandler | undefined; onTouchEndCapture?: React.TouchEventHandler | undefined; onTouchMove?: React.TouchEventHandler | undefined; onTouchMoveCapture?: React.TouchEventHandler | undefined; onTouchStart?: React.TouchEventHandler | undefined; onTouchStartCapture?: React.TouchEventHandler | undefined; onPointerDown?: React.PointerEventHandler | undefined; onPointerDownCapture?: React.PointerEventHandler | undefined; onPointerMove?: React.PointerEventHandler | undefined; onPointerMoveCapture?: React.PointerEventHandler | undefined; onPointerUp?: React.PointerEventHandler | undefined; onPointerUpCapture?: React.PointerEventHandler | undefined; onPointerCancel?: React.PointerEventHandler | undefined; onPointerCancelCapture?: React.PointerEventHandler | undefined; onPointerEnter?: React.PointerEventHandler | undefined; onPointerEnterCapture?: React.PointerEventHandler | undefined; onPointerLeave?: React.PointerEventHandler | undefined; onPointerLeaveCapture?: React.PointerEventHandler | undefined; onPointerOver?: React.PointerEventHandler | undefined; onPointerOverCapture?: React.PointerEventHandler | undefined; onPointerOut?: React.PointerEventHandler | undefined; onPointerOutCapture?: React.PointerEventHandler | undefined; onGotPointerCapture?: React.PointerEventHandler | undefined; onGotPointerCaptureCapture?: React.PointerEventHandler | undefined; onLostPointerCapture?: React.PointerEventHandler | undefined; onLostPointerCaptureCapture?: React.PointerEventHandler | undefined; onScroll?: React.UIEventHandler | undefined; onScrollCapture?: React.UIEventHandler | undefined; onWheel?: React.WheelEventHandler | undefined; onWheelCapture?: React.WheelEventHandler | undefined; onAnimationStart?: React.AnimationEventHandler | undefined; onAnimationStartCapture?: React.AnimationEventHandler | undefined; onAnimationEnd?: React.AnimationEventHandler | undefined; onAnimationEndCapture?: React.AnimationEventHandler | undefined; onAnimationIteration?: React.AnimationEventHandler | undefined; onAnimationIterationCapture?: React.AnimationEventHandler | undefined; onTransitionEnd?: React.TransitionEventHandler | undefined; onTransitionEndCapture?: React.TransitionEventHandler | undefined; key?: React.Key | undefined; ref?: ((instance: HTMLDivElement | null) => any) | React.RefObject | undefined; } | { children?: React.ReactNode; style?: React.CSSProperties | undefined; title?: string | undefined; defaultChecked?: boolean | undefined; defaultValue?: string | string[] | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; className?: string | undefined; contentEditable?: boolean | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: boolean | undefined; hidden?: boolean | undefined; id?: string | undefined; lang?: string | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: boolean | undefined; tabIndex?: number | undefined; inputMode?: string | undefined; is?: string | undefined; radioGroup?: string | undefined; role?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; color?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: "on" | "off" | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | "false" | "true" | undefined; 'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined; 'aria-busy'?: boolean | "false" | "true" | undefined; 'aria-checked'?: boolean | "false" | "mixed" | "true" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | "false" | "true" | undefined; 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | "false" | "true" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | "false" | "true" | undefined; 'aria-haspopup'?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined; 'aria-hidden'?: boolean | "false" | "true" | undefined; 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: "off" | "assertive" | "polite" | undefined; 'aria-modal'?: boolean | "false" | "true" | undefined; 'aria-multiline'?: boolean | "false" | "true" | undefined; 'aria-multiselectable'?: boolean | "false" | "true" | undefined; 'aria-orientation'?: "horizontal" | "vertical" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | "false" | "mixed" | "true" | undefined; 'aria-readonly'?: boolean | "false" | "true" | undefined; 'aria-relevant'?: "additions" | "additions text" | "all" | "removals" | "text" | undefined; 'aria-required'?: boolean | "false" | "true" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | "false" | "true" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: React.ClipboardEventHandler | undefined; onCopyCapture?: React.ClipboardEventHandler | undefined; onCut?: React.ClipboardEventHandler | undefined; onCutCapture?: React.ClipboardEventHandler | undefined; onPaste?: React.ClipboardEventHandler | undefined; onPasteCapture?: React.ClipboardEventHandler | undefined; onCompositionEnd?: React.CompositionEventHandler | undefined; onCompositionEndCapture?: React.CompositionEventHandler | undefined; onCompositionStart?: React.CompositionEventHandler | undefined; onCompositionStartCapture?: React.CompositionEventHandler | undefined; onCompositionUpdate?: React.CompositionEventHandler | undefined; onCompositionUpdateCapture?: React.CompositionEventHandler | undefined; onFocus?: React.FocusEventHandler | undefined; onFocusCapture?: React.FocusEventHandler | undefined; onBlur?: React.FocusEventHandler | undefined; onBlurCapture?: React.FocusEventHandler | undefined; onChange?: React.FormEventHandler | undefined; onChangeCapture?: React.FormEventHandler | undefined; onInput?: React.FormEventHandler | undefined; onInputCapture?: React.FormEventHandler | undefined; onReset?: React.FormEventHandler | undefined; onResetCapture?: React.FormEventHandler | undefined; onSubmit?: React.FormEventHandler | undefined; onSubmitCapture?: React.FormEventHandler | undefined; onInvalid?: React.FormEventHandler | undefined; onInvalidCapture?: React.FormEventHandler | undefined; onLoad?: React.ReactEventHandler | undefined; onLoadCapture?: React.ReactEventHandler | undefined; onError?: React.ReactEventHandler | undefined; onErrorCapture?: React.ReactEventHandler | undefined; onKeyDown?: React.KeyboardEventHandler | undefined; onKeyDownCapture?: React.KeyboardEventHandler | undefined; onKeyPress?: React.KeyboardEventHandler | undefined; onKeyPressCapture?: React.KeyboardEventHandler | undefined; onKeyUp?: React.KeyboardEventHandler | undefined; onKeyUpCapture?: React.KeyboardEventHandler | undefined; onAbort?: React.ReactEventHandler | undefined; onAbortCapture?: React.ReactEventHandler | undefined; onCanPlay?: React.ReactEventHandler | undefined; onCanPlayCapture?: React.ReactEventHandler | undefined; onCanPlayThrough?: React.ReactEventHandler | undefined; onCanPlayThroughCapture?: React.ReactEventHandler | undefined; onDurationChange?: React.ReactEventHandler | undefined; onDurationChangeCapture?: React.ReactEventHandler | undefined; onEmptied?: React.ReactEventHandler | undefined; onEmptiedCapture?: React.ReactEventHandler | undefined; onEncrypted?: React.ReactEventHandler | undefined; onEncryptedCapture?: React.ReactEventHandler | undefined; onEnded?: React.ReactEventHandler | undefined; onEndedCapture?: React.ReactEventHandler | undefined; onLoadedData?: React.ReactEventHandler | undefined; onLoadedDataCapture?: React.ReactEventHandler | undefined; onLoadedMetadata?: React.ReactEventHandler | undefined; onLoadedMetadataCapture?: React.ReactEventHandler | undefined; onLoadStart?: React.ReactEventHandler | undefined; onLoadStartCapture?: React.ReactEventHandler | undefined; onPause?: React.ReactEventHandler | undefined; onPauseCapture?: React.ReactEventHandler | undefined; onPlay?: React.ReactEventHandler | undefined; onPlayCapture?: React.ReactEventHandler | undefined; onPlaying?: React.ReactEventHandler | undefined; onPlayingCapture?: React.ReactEventHandler | undefined; onProgress?: React.ReactEventHandler | undefined; onProgressCapture?: React.ReactEventHandler | undefined; onRateChange?: React.ReactEventHandler | undefined; onRateChangeCapture?: React.ReactEventHandler | undefined; onSeeked?: React.ReactEventHandler | undefined; onSeekedCapture?: React.ReactEventHandler | undefined; onSeeking?: React.ReactEventHandler | undefined; onSeekingCapture?: React.ReactEventHandler | undefined; onStalled?: React.ReactEventHandler | undefined; onStalledCapture?: React.ReactEventHandler | undefined; onSuspend?: React.ReactEventHandler | undefined; onSuspendCapture?: React.ReactEventHandler | undefined; onTimeUpdate?: React.ReactEventHandler | undefined; onTimeUpdateCapture?: React.ReactEventHandler | undefined; onVolumeChange?: React.ReactEventHandler | undefined; onVolumeChangeCapture?: React.ReactEventHandler | undefined; onWaiting?: React.ReactEventHandler | undefined; onWaitingCapture?: React.ReactEventHandler | undefined; onClick?: React.MouseEventHandler | undefined; onClickCapture?: React.MouseEventHandler | undefined; onContextMenu?: React.MouseEventHandler | undefined; onContextMenuCapture?: React.MouseEventHandler | undefined; onDoubleClick?: React.MouseEventHandler | undefined; onDoubleClickCapture?: React.MouseEventHandler | undefined; onDrag?: React.DragEventHandler | undefined; onDragCapture?: React.DragEventHandler | undefined; onDragEnd?: React.DragEventHandler | undefined; onDragEndCapture?: React.DragEventHandler | undefined; onDragEnter?: React.DragEventHandler | undefined; onDragEnterCapture?: React.DragEventHandler | undefined; onDragExit?: React.DragEventHandler | undefined; onDragExitCapture?: React.DragEventHandler | undefined; onDragLeave?: React.DragEventHandler | undefined; onDragLeaveCapture?: React.DragEventHandler