mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accept new baselines
This commit is contained in:
1 parent
39f82a8029
commit
d9a0f50d21
26 files changed
+155
-155
No files matched your search
@@ -963,7 +963,7 @@ interface B2 extends A {
|
||||
>c : NewDiff<keyof this, "a">
|
||||
}
|
||||
type c1 = B1['c']; // 'c' | 'b'
|
||||
>c1 : OldDiff<"a" | "b" | "c", "a">
|
||||
>c1 : OldDiff<keyof B1, "a">
|
||||
|
||||
type c2 = B2['c']; // 'c' | 'b'
|
||||
>c2 : "b" | "c"
|
||||
|
||||
@@ -24,10 +24,10 @@ const ok: Properties = {
|
||||
|
||||
// As expected, "__property2" is indeed a key of the type
|
||||
type Keys = keyof Properties;
|
||||
>Keys : "property1" | "__property2"
|
||||
>Keys : keyof Properties
|
||||
|
||||
const k: Keys = "__property2"; // ok
|
||||
>k : "property1" | "__property2"
|
||||
>k : keyof Properties
|
||||
>"__property2" : "__property2"
|
||||
|
||||
// This should be valid
|
||||
|
||||
@@ -31,9 +31,9 @@ class C {
|
||||
const nodes = document.getElementsByTagName("li");
|
||||
>nodes : HTMLCollectionOf<HTMLLIElement>
|
||||
>document.getElementsByTagName("li") : HTMLCollectionOf<HTMLLIElement>
|
||||
>document.getElementsByTagName : { <K extends "object" | "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document.getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document : Document
|
||||
>getElementsByTagName : { <K extends "object" | "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>"li" : "li"
|
||||
|
||||
type ItemType = "".typeof(nodes.item(0));
|
||||
@@ -72,9 +72,9 @@ class C2 {
|
||||
const nodes2 = document.getElementsByTagName("li");
|
||||
>nodes2 : HTMLCollectionOf<HTMLLIElement>
|
||||
>document.getElementsByTagName("li") : HTMLCollectionOf<HTMLLIElement>
|
||||
>document.getElementsByTagName : { <K extends "object" | "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document.getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document : Document
|
||||
>getElementsByTagName : { <K extends "object" | "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>"li" : "li"
|
||||
|
||||
type ItemType2 = 4..typeof(nodes.item(0));
|
||||
@@ -114,9 +114,9 @@ class C3 {
|
||||
const nodes3 = document.getElementsByTagName("li");
|
||||
>nodes3 : HTMLCollectionOf<HTMLLIElement>
|
||||
>document.getElementsByTagName("li") : HTMLCollectionOf<HTMLLIElement>
|
||||
>document.getElementsByTagName : { <K extends "object" | "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document.getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document : Document
|
||||
>getElementsByTagName : { <K extends "object" | "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>"li" : "li"
|
||||
|
||||
type ItemType3 = true.typeof(nodes.item(0));
|
||||
|
||||
@@ -94,7 +94,7 @@ type Item = { a: string, b: number, c: boolean };
|
||||
>c : boolean
|
||||
|
||||
function f4<K1 extends keyof Item, K2 extends keyof Item>(obj: Item, k1: K1, k2: K2) {
|
||||
>f4 : <K1 extends "a" | "b" | "c", K2 extends "a" | "b" | "c">(obj: Item, k1: K1, k2: K2) => void
|
||||
>f4 : <K1 extends keyof Item, K2 extends keyof Item>(obj: Item, k1: K1, k2: K2) => void
|
||||
>obj : Item
|
||||
>k1 : K1
|
||||
>k2 : K2
|
||||
|
||||
@@ -733,35 +733,35 @@ declare var events: EventType<Record1>;
|
||||
|
||||
events.emit('move', 10, 'left');
|
||||
>events.emit('move', 10, 'left') : void
|
||||
>events.emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events.emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events : EventType<Record1>
|
||||
>emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>'move' : "move"
|
||||
>10 : 10
|
||||
>'left' : "left"
|
||||
|
||||
events.emit('jump', 20, 'up');
|
||||
>events.emit('jump', 20, 'up') : void
|
||||
>events.emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events.emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events : EventType<Record1>
|
||||
>emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>'jump' : "jump"
|
||||
>20 : 20
|
||||
>'up' : "up"
|
||||
|
||||
events.emit('stop', 'Bye!');
|
||||
>events.emit('stop', 'Bye!') : void
|
||||
>events.emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events.emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events : EventType<Record1>
|
||||
>emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>'stop' : "stop"
|
||||
>'Bye!' : "Bye!"
|
||||
|
||||
events.emit('done');
|
||||
>events.emit('done') : void
|
||||
>events.emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events.emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>events : EventType<Record1>
|
||||
>emit : <K extends "move" | "jump" | "stop" | "done" = "move" | "jump" | "stop" | "done">(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>emit : <K extends keyof Record1 = keyof Record1>(e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void
|
||||
>'done' : "done"
|
||||
|
||||
// Repro from #25871
|
||||
|
||||
@@ -10,7 +10,7 @@ interface RelationFields {
|
||||
>z : A[]
|
||||
}
|
||||
type Name = keyof RelationFields;
|
||||
>Name : "x" | "y" | "z"
|
||||
>Name : keyof RelationFields
|
||||
|
||||
type ShouldA<RF extends RelationFields, N extends Name> = RF[N] extends A[]
|
||||
>ShouldA : ShouldA<RF, N>
|
||||
@@ -31,7 +31,7 @@ class A {
|
||||
>z : A[]
|
||||
|
||||
whereRelated< // Works // Type is same as A1, but is not assignable to type A
|
||||
>whereRelated : <RF extends RelationFields = RelationFields, N extends "x" | "y" | "z" = "x" | "y" | "z", A1 extends A = RF[N] extends A[] ? RF[N][0] : never, A2 extends A = ShouldA<RF, N>>() => number
|
||||
>whereRelated : <RF extends RelationFields = RelationFields, N extends keyof RelationFields = keyof RelationFields, A1 extends A = RF[N] extends A[] ? RF[N][0] : never, A2 extends A = ShouldA<RF, N>>() => number
|
||||
|
||||
RF extends RelationFields = RelationFields,
|
||||
N extends Name = Name,
|
||||
|
||||
@@ -185,7 +185,7 @@ type O = {
|
||||
>O : O
|
||||
|
||||
on<P extends keyof R>(x: P, callback: R[P]): void;
|
||||
>on : <P extends "a" | "b">(x: P, callback: R[P]) => void
|
||||
>on : <P extends keyof R>(x: P, callback: R[P]) => void
|
||||
>x : P
|
||||
>callback : R[P]
|
||||
|
||||
@@ -196,9 +196,9 @@ declare var x: O;
|
||||
|
||||
x.on('a', a => {});
|
||||
>x.on('a', a => {}) : void
|
||||
>x.on : <P extends "a" | "b">(x: P, callback: R[P]) => void
|
||||
>x.on : <P extends keyof R>(x: P, callback: R[P]) => void
|
||||
>x : O
|
||||
>on : <P extends "a" | "b">(x: P, callback: R[P]) => void
|
||||
>on : <P extends keyof R>(x: P, callback: R[P]) => void
|
||||
>'a' : "a"
|
||||
>a => {} : (a: number) => void
|
||||
>a : number
|
||||
|
||||
@@ -24,7 +24,7 @@ export function assertIsElement(node: Node | null): node is Element {
|
||||
}
|
||||
|
||||
export function assertNodeTagName<
|
||||
>assertNodeTagName : <T extends "symbol" | "object" | "a" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "script" | "stop" | "style" | "svg" | "switch" | "text" | "textPath" | "title" | "tspan" | "use" | "view" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends "symbol" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
|
||||
T extends keyof ElementTagNameMap,
|
||||
U extends ElementTagNameMap[T]>(node: Node | null, tagName: T): node is U {
|
||||
@@ -56,7 +56,7 @@ export function assertNodeTagName<
|
||||
}
|
||||
|
||||
export function assertNodeProperty<
|
||||
>assertNodeProperty : <T extends "symbol" | "object" | "a" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "script" | "stop" | "style" | "svg" | "switch" | "text" | "textPath" | "title" | "tspan" | "use" | "view" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr", P extends keyof ElementTagNameMap[T], V extends HTMLElementTagNameMap[T][P]>(node: Node | null, tagName: T, prop: P, value: V) => void
|
||||
>assertNodeProperty : <T extends "symbol" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap, P extends keyof ElementTagNameMap[T], V extends HTMLElementTagNameMap[T][P]>(node: Node | null, tagName: T, prop: P, value: V) => void
|
||||
|
||||
T extends keyof ElementTagNameMap,
|
||||
P extends keyof ElementTagNameMap[T],
|
||||
@@ -69,7 +69,7 @@ export function assertNodeProperty<
|
||||
|
||||
if (assertNodeTagName(node, tagName)) {
|
||||
>assertNodeTagName(node, tagName) : boolean
|
||||
>assertNodeTagName : <T extends "symbol" | "object" | "a" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "script" | "stop" | "style" | "svg" | "switch" | "text" | "textPath" | "title" | "tspan" | "use" | "view" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends "symbol" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>node : Node | null
|
||||
>tagName : T
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export function assertIsElement(node: Node | null): node is Element {
|
||||
}
|
||||
|
||||
export function assertNodeTagName<
|
||||
>assertNodeTagName : <T extends "symbol" | "object" | "a" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "script" | "stop" | "style" | "svg" | "switch" | "text" | "textPath" | "title" | "tspan" | "use" | "view" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends "symbol" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
|
||||
T extends keyof ElementTagNameMap,
|
||||
U extends ElementTagNameMap[T]>(node: Node | null, tagName: T): node is U {
|
||||
@@ -70,7 +70,7 @@ export function assertNodeTagName<
|
||||
}
|
||||
|
||||
export function assertNodeProperty<
|
||||
>assertNodeProperty : <T extends "symbol" | "object" | "a" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "script" | "stop" | "style" | "svg" | "switch" | "text" | "textPath" | "title" | "tspan" | "use" | "view" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr", P extends keyof ElementTagNameMap[T], V extends HTMLElementTagNameMap[T][P]>(node: Node | null, tagName: T, prop: P, value: V) => void
|
||||
>assertNodeProperty : <T extends "symbol" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap, P extends keyof ElementTagNameMap[T], V extends HTMLElementTagNameMap[T][P]>(node: Node | null, tagName: T, prop: P, value: V) => void
|
||||
|
||||
T extends keyof ElementTagNameMap,
|
||||
P extends keyof ElementTagNameMap[T],
|
||||
@@ -83,7 +83,7 @@ export function assertNodeProperty<
|
||||
|
||||
if (assertNodeTagName(node, tagName)) {
|
||||
>assertNodeTagName(node, tagName) : boolean
|
||||
>assertNodeTagName : <T extends "symbol" | "object" | "a" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "script" | "stop" | "style" | "svg" | "switch" | "text" | "textPath" | "title" | "tspan" | "use" | "view" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends "symbol" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>node : Node | null
|
||||
>tagName : T
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ export function createReactSingleSelect<
|
||||
>React : any
|
||||
|
||||
return (props) => {
|
||||
>(props) => { return ( <ReactSelectClass<ExtractValueType<WrappedProps>> {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ); } : (props: Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & ("value" | "onChange")> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }) => JSX.Element
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & ("value" | "onChange")> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>(props) => { return ( <ReactSelectClass<ExtractValueType<WrappedProps>> {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ); } : (props: Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & keyof Props<ExtractValueType<WrappedProps>>> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }) => JSX.Element
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & keyof Props<ExtractValueType<WrappedProps>>> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
|
||||
return (
|
||||
>( <ReactSelectClass<ExtractValueType<WrappedProps>> {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ) : JSX.Element
|
||||
@@ -50,7 +50,7 @@ export function createReactSingleSelect<
|
||||
>ReactSelectClass : typeof ReactSelectClass
|
||||
|
||||
{...props}
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & ("value" | "onChange")> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & keyof Props<ExtractValueType<WrappedProps>>> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
|
||||
multi={false}
|
||||
>multi : false
|
||||
@@ -63,7 +63,7 @@ export function createReactSingleSelect<
|
||||
value={props.value}
|
||||
>value : ExtractValueType<WrappedProps> | Option<ExtractValueType<WrappedProps>> | undefined
|
||||
>props.value : ExtractValueType<WrappedProps> | Option<ExtractValueType<WrappedProps>> | undefined
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & ("value" | "onChange")> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & keyof Props<ExtractValueType<WrappedProps>>> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>value : ExtractValueType<WrappedProps> | Option<ExtractValueType<WrappedProps>> | undefined
|
||||
|
||||
onChange={(value) => {
|
||||
@@ -73,13 +73,13 @@ export function createReactSingleSelect<
|
||||
|
||||
if (props.onChange) {
|
||||
>props.onChange : ((value: Option<ExtractValueType<WrappedProps>> | undefined) => void) | undefined
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & ("value" | "onChange")> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & keyof Props<ExtractValueType<WrappedProps>>> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>onChange : ((value: Option<ExtractValueType<WrappedProps>> | undefined) => void) | undefined
|
||||
|
||||
props.onChange(value === null ? undefined : value);
|
||||
>props.onChange(value === null ? undefined : value) : void
|
||||
>props.onChange : (value: Option<ExtractValueType<WrappedProps>> | undefined) => void
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & ("value" | "onChange")> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>props : Omit<Omit<WrappedProps, "multi">, keyof Omit<WrappedProps, "multi"> & keyof Props<ExtractValueType<WrappedProps>>> & Props<ExtractValueType<WrappedProps>> & { children?: React.ReactNode; }
|
||||
>onChange : (value: Option<ExtractValueType<WrappedProps>> | undefined) => void
|
||||
>value === null ? undefined : value : Option<ExtractValueType<WrappedProps>> | Options<ExtractValueType<WrappedProps>> | undefined
|
||||
>value === null : boolean
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/// <reference path="react16.d.ts" />
|
||||
import { Fragment, createElement } from "react"
|
||||
>Fragment : import("react").ComponentType<{}>
|
||||
>createElement : { (type: "input", props?: import("react").InputHTMLAttributes<HTMLInputElement> & import("react").ClassAttributes<HTMLInputElement>, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>; <P extends import("react").HTMLAttributes<T>, T extends HTMLElement>(type: "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview", props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement<P, T>; <P extends import("react").SVGAttributes<T>, T extends SVGElement>(type: "symbol" | "text" | "animate" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "textPath" | "tspan" | "use" | "view", props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").ReactSVGElement; <P extends import("react").DOMAttributes<T>, T extends Element>(type: string, props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").DOMElement<P, T>; <P>(type: import("react").SFC<P>, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").SFCElement<P>; <P>(type: import("react").ClassType<P, import("react").ClassicComponent<P, any>, import("react").ClassicComponentClass<P>>, props?: import("react").ClassAttributes<import("react").ClassicComponent<P, any>> & P, ...children: import("react").ReactNode[]): import("react").CElement<P, import("react").ClassicComponent<P, any>>; <P, T extends import("react").Component<P, any, any>, C extends import("react").ComponentClass<P, any>>(type: import("react").ClassType<P, T, C>, props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").CElement<P, T>; <P>(type: string | import("react").SFC<P> | import("react").ComponentClass<P, any>, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").ReactElement<P>; }
|
||||
>createElement : { (type: "input", props?: import("react").InputHTMLAttributes<HTMLInputElement> & import("react").ClassAttributes<HTMLInputElement>, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>; <P extends import("react").HTMLAttributes<T>, T extends HTMLElement>(type: keyof import("react").ReactHTML, props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement<P, T>; <P extends import("react").SVGAttributes<T>, T extends SVGElement>(type: keyof import("react").ReactSVG, props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").ReactSVGElement; <P extends import("react").DOMAttributes<T>, T extends Element>(type: string, props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").DOMElement<P, T>; <P>(type: import("react").SFC<P>, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").SFCElement<P>; <P>(type: import("react").ClassType<P, import("react").ClassicComponent<P, any>, import("react").ClassicComponentClass<P>>, props?: import("react").ClassAttributes<import("react").ClassicComponent<P, any>> & P, ...children: import("react").ReactNode[]): import("react").CElement<P, import("react").ClassicComponent<P, any>>; <P, T extends import("react").Component<P, any, any>, C extends import("react").ComponentClass<P, any>>(type: import("react").ClassType<P, T, C>, props?: import("react").ClassAttributes<T> & P, ...children: import("react").ReactNode[]): import("react").CElement<P, T>; <P>(type: string | import("react").SFC<P> | import("react").ComponentClass<P, any>, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").ReactElement<P>; }
|
||||
|
||||
type CounterProps = {
|
||||
>CounterProps : CounterProps
|
||||
|
||||
@@ -83,10 +83,10 @@ type K08 = keyof unknown; // never
|
||||
>K08 : never
|
||||
|
||||
type K10 = keyof Shape; // "name" | "width" | "height" | "visible"
|
||||
>K10 : "name" | "width" | "height" | "visible"
|
||||
>K10 : keyof Shape
|
||||
|
||||
type K11 = keyof Shape[]; // "length" | "toString" | ...
|
||||
>K11 : number | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight"
|
||||
>K11 : number | keyof Shape[]
|
||||
|
||||
type K12 = keyof Dictionary<Shape>; // string
|
||||
>K12 : string | number
|
||||
@@ -95,13 +95,13 @@ type K13 = keyof {}; // never
|
||||
>K13 : never
|
||||
|
||||
type K14 = keyof Object; // "constructor" | "toString" | ...
|
||||
>K14 : "toString" | "toLocaleString" | "valueOf" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable"
|
||||
>K14 : keyof Object
|
||||
|
||||
type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ...
|
||||
>K15 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision"
|
||||
|
||||
type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ...
|
||||
>K16 : number | "0" | "1" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight"
|
||||
>K16 : number | keyof [string, number]
|
||||
|
||||
type K17 = keyof (Shape | Item); // "name"
|
||||
>K17 : "name"
|
||||
@@ -116,7 +116,7 @@ type KeyOf<T> = keyof T;
|
||||
>KeyOf : keyof T
|
||||
|
||||
type K20 = KeyOf<Shape>; // "name" | "width" | "height" | "visible"
|
||||
>K20 : "name" | "width" | "height" | "visible"
|
||||
>K20 : keyof Shape
|
||||
|
||||
type K21 = KeyOf<Dictionary<Shape>>; // string
|
||||
>K21 : string | number
|
||||
@@ -380,17 +380,17 @@ function f20(component: Component<Shape>) {
|
||||
let name = component.getProperty("name"); // string
|
||||
>name : string
|
||||
>component.getProperty("name") : string
|
||||
>component.getProperty : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>component.getProperty : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>component : Component<Shape>
|
||||
>getProperty : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>getProperty : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>"name" : "name"
|
||||
|
||||
let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number
|
||||
>widthOrHeight : number
|
||||
>component.getProperty(cond ? "width" : "height") : number
|
||||
>component.getProperty : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>component.getProperty : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>component : Component<Shape>
|
||||
>getProperty : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>getProperty : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>cond ? "width" : "height" : "width" | "height"
|
||||
>cond : boolean
|
||||
>"width" : "width"
|
||||
@@ -399,9 +399,9 @@ function f20(component: Component<Shape>) {
|
||||
let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean
|
||||
>nameOrVisible : string | boolean
|
||||
>component.getProperty(cond ? "name" : "visible") : string | boolean
|
||||
>component.getProperty : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>component.getProperty : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>component : Component<Shape>
|
||||
>getProperty : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>getProperty : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>cond ? "name" : "visible" : "name" | "visible"
|
||||
>cond : boolean
|
||||
>"name" : "name"
|
||||
@@ -409,17 +409,17 @@ function f20(component: Component<Shape>) {
|
||||
|
||||
component.setProperty("name", "rectangle");
|
||||
>component.setProperty("name", "rectangle") : void
|
||||
>component.setProperty : <K extends "name" | "width" | "height" | "visible">(key: K, value: Shape[K]) => void
|
||||
>component.setProperty : <K extends keyof Shape>(key: K, value: Shape[K]) => void
|
||||
>component : Component<Shape>
|
||||
>setProperty : <K extends "name" | "width" | "height" | "visible">(key: K, value: Shape[K]) => void
|
||||
>setProperty : <K extends keyof Shape>(key: K, value: Shape[K]) => void
|
||||
>"name" : "name"
|
||||
>"rectangle" : "rectangle"
|
||||
|
||||
component.setProperty(cond ? "width" : "height", 10)
|
||||
>component.setProperty(cond ? "width" : "height", 10) : void
|
||||
>component.setProperty : <K extends "name" | "width" | "height" | "visible">(key: K, value: Shape[K]) => void
|
||||
>component.setProperty : <K extends keyof Shape>(key: K, value: Shape[K]) => void
|
||||
>component : Component<Shape>
|
||||
>setProperty : <K extends "name" | "width" | "height" | "visible">(key: K, value: Shape[K]) => void
|
||||
>setProperty : <K extends keyof Shape>(key: K, value: Shape[K]) => void
|
||||
>cond ? "width" : "height" : "width" | "height"
|
||||
>cond : boolean
|
||||
>"width" : "width"
|
||||
@@ -428,9 +428,9 @@ function f20(component: Component<Shape>) {
|
||||
|
||||
component.setProperty(cond ? "name" : "visible", true); // Technically not safe
|
||||
>component.setProperty(cond ? "name" : "visible", true) : void
|
||||
>component.setProperty : <K extends "name" | "width" | "height" | "visible">(key: K, value: Shape[K]) => void
|
||||
>component.setProperty : <K extends keyof Shape>(key: K, value: Shape[K]) => void
|
||||
>component : Component<Shape>
|
||||
>setProperty : <K extends "name" | "width" | "height" | "visible">(key: K, value: Shape[K]) => void
|
||||
>setProperty : <K extends keyof Shape>(key: K, value: Shape[K]) => void
|
||||
>cond ? "name" : "visible" : "name" | "visible"
|
||||
>cond : boolean
|
||||
>"name" : "name"
|
||||
@@ -485,7 +485,7 @@ function f30(shapes: Shape[]) {
|
||||
}
|
||||
|
||||
function f31<K extends keyof Shape>(key: K) {
|
||||
>f31 : <K extends "name" | "width" | "height" | "visible">(key: K) => Shape[K]
|
||||
>f31 : <K extends keyof Shape>(key: K) => Shape[K]
|
||||
>key : K
|
||||
|
||||
const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
|
||||
@@ -1207,15 +1207,15 @@ type S2 = {
|
||||
};
|
||||
|
||||
function f90<T extends S2, K extends keyof S2>(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) {
|
||||
>f90 : <T extends S2, K extends "a" | "b">(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) => void
|
||||
>f90 : <T extends S2, K extends keyof S2>(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) => void
|
||||
>x1 : string
|
||||
>x2 : T["a" | "b"]
|
||||
>x2 : T[keyof S2]
|
||||
>x3 : S2[K]
|
||||
|
||||
x1 = x2;
|
||||
>x1 = x2 : T["a" | "b"]
|
||||
>x1 = x2 : T[keyof S2]
|
||||
>x1 : string
|
||||
>x2 : T["a" | "b"]
|
||||
>x2 : T[keyof S2]
|
||||
|
||||
x1 = x3;
|
||||
>x1 = x3 : S2[K]
|
||||
@@ -1224,12 +1224,12 @@ function f90<T extends S2, K extends keyof S2>(x1: S2[keyof S2], x2: T[keyof S2]
|
||||
|
||||
x2 = x1;
|
||||
>x2 = x1 : string
|
||||
>x2 : T["a" | "b"]
|
||||
>x2 : T[keyof S2]
|
||||
>x1 : string
|
||||
|
||||
x2 = x3;
|
||||
>x2 = x3 : S2[K]
|
||||
>x2 : T["a" | "b"]
|
||||
>x2 : T[keyof S2]
|
||||
>x3 : S2[K]
|
||||
|
||||
x3 = x1;
|
||||
@@ -1238,9 +1238,9 @@ function f90<T extends S2, K extends keyof S2>(x1: S2[keyof S2], x2: T[keyof S2]
|
||||
>x1 : string
|
||||
|
||||
x3 = x2;
|
||||
>x3 = x2 : T["a" | "b"]
|
||||
>x3 = x2 : T[keyof S2]
|
||||
>x3 : S2[K]
|
||||
>x2 : T["a" | "b"]
|
||||
>x2 : T[keyof S2]
|
||||
|
||||
x1.length;
|
||||
>x1.length : number
|
||||
@@ -1249,7 +1249,7 @@ function f90<T extends S2, K extends keyof S2>(x1: S2[keyof S2], x2: T[keyof S2]
|
||||
|
||||
x2.length;
|
||||
>x2.length : number
|
||||
>x2 : T["a" | "b"]
|
||||
>x2 : T[keyof S2]
|
||||
>length : number
|
||||
|
||||
x3.length;
|
||||
|
||||
@@ -236,7 +236,7 @@ function f10<T extends Item, K extends keyof T>(obj: T, k1: string, k2: keyof It
|
||||
>f10 : <T extends Item, K extends keyof T>(obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) => void
|
||||
>obj : T
|
||||
>k1 : string
|
||||
>k2 : "a" | "b"
|
||||
>k2 : keyof Item
|
||||
>k3 : keyof T
|
||||
>k4 : K
|
||||
|
||||
@@ -251,7 +251,7 @@ function f10<T extends Item, K extends keyof T>(obj: T, k1: string, k2: keyof It
|
||||
>obj[k2] = 123 : 123
|
||||
>obj[k2] : never
|
||||
>obj : T
|
||||
>k2 : "a" | "b"
|
||||
>k2 : keyof Item
|
||||
>123 : 123
|
||||
|
||||
obj[k3] = 123; // Error
|
||||
@@ -417,7 +417,7 @@ interface Type {
|
||||
}
|
||||
|
||||
function get123<K extends keyof Type>(): Type[K] {
|
||||
>get123 : <K extends "a" | "b">() => Type[K]
|
||||
>get123 : <K extends keyof Type>() => Type[K]
|
||||
|
||||
return 123; // Error
|
||||
>123 : 123
|
||||
|
||||
@@ -17,12 +17,12 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(35,21): error
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(36,21): error TS2538: Type 'boolean' cannot be used as an index type.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(41,31): error TS2538: Type 'boolean' cannot be used as an index type.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(46,16): error TS2538: Type 'boolean' cannot be used as an index type.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(73,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(74,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(82,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
|
||||
@@ -179,19 +179,19 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error
|
||||
let x1 = getProperty(shape, "name");
|
||||
let x2 = getProperty(shape, "size"); // Error
|
||||
~~~~~~
|
||||
!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
let x3 = getProperty(shape, cond ? "name" : "size"); // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2345: Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
!!! error TS2345: Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
setProperty(shape, "name", "rectangle");
|
||||
setProperty(shape, "size", 10); // Error
|
||||
~~~~~~
|
||||
!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
setProperty(shape, cond ? "name" : "size", 10); // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2345: Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'.
|
||||
!!! error TS2345: Type '"size"' is not assignable to type 'keyof Shape'.
|
||||
}
|
||||
|
||||
function f20<T, U>(x: T | U, y: T & U, k1: keyof (T | U), k2: keyof T & keyof U, k3: keyof (T & U), k4: keyof T | keyof U) {
|
||||
|
||||
@@ -23,7 +23,7 @@ type T00 = keyof K0; // Error
|
||||
>T00 : string | number | symbol
|
||||
|
||||
type T01 = keyof Object;
|
||||
>T01 : "toString" | "valueOf" | "toLocaleString" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable"
|
||||
>T01 : keyof Object
|
||||
|
||||
type T02 = keyof keyof Object;
|
||||
>T02 : number | "length" | "toString" | "valueOf" | "charAt" | "charCodeAt" | "concat" | "indexOf" | "lastIndexOf" | "localeCompare" | "match" | "replace" | "search" | "slice" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr"
|
||||
|
||||
@@ -3,17 +3,17 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(21,20): error TS2322: T
|
||||
Type 'Date' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(22,19): error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'.
|
||||
Type 'Date' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint 'keyof Shape'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint 'keyof Shape'.
|
||||
Type '"foo"' is not assignable to type 'keyof Shape'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type 'keyof Point' does not satisfy the constraint 'keyof Shape'.
|
||||
Type '"x"' is not assignable to type 'keyof Shape'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint 'keyof Shape'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'.
|
||||
Type 'T' is not assignable to type '"visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'.
|
||||
Type 'string | number' is not assignable to type 'keyof Shape'.
|
||||
Type 'string' is not assignable to type 'keyof Shape'.
|
||||
Type 'T' is not assignable to type '"visible"'.
|
||||
Type 'string | number' is not assignable to type '"visible"'.
|
||||
Type 'string' is not assignable to type '"visible"'.
|
||||
@@ -28,11 +28,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: A
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(83,58): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'.
|
||||
Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(105,17): error TS2322: Type 'undefined' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, "a" | "b">'.
|
||||
Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, "a" | "b">'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, keyof Foo>'.
|
||||
Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, keyof Foo>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(123,14): error TS2322: Type 'undefined' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, "a" | "b">'.
|
||||
Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, "a" | "b">'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, keyof Foo>'.
|
||||
Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, keyof Foo>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
|
||||
@@ -78,34 +78,34 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339:
|
||||
type T10 = Pick<Shape, "name">;
|
||||
type T11 = Pick<Shape, "foo">; // Error
|
||||
~~~~~
|
||||
!!! error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type '"foo"' does not satisfy the constraint 'keyof Shape'.
|
||||
type T12 = Pick<Shape, "name" | "foo">; // Error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint 'keyof Shape'.
|
||||
!!! error TS2344: Type '"foo"' is not assignable to type 'keyof Shape'.
|
||||
type T13 = Pick<Shape, keyof Named>;
|
||||
type T14 = Pick<Shape, keyof Point>; // Error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type 'keyof Point' does not satisfy the constraint 'keyof Shape'.
|
||||
!!! error TS2344: Type '"x"' is not assignable to type 'keyof Shape'.
|
||||
type T15 = Pick<Shape, never>;
|
||||
type T16 = Pick<Shape, undefined>; // Error
|
||||
~~~~~~~~~
|
||||
!!! error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type 'undefined' does not satisfy the constraint 'keyof Shape'.
|
||||
|
||||
function f1<T>(x: T) {
|
||||
let y: Pick<Shape, T>; // Error
|
||||
~
|
||||
!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'.
|
||||
!!! error TS2344: Type 'T' is not assignable to type '"visible"'.
|
||||
}
|
||||
|
||||
function f2<T extends string | number>(x: T) {
|
||||
let y: Pick<Shape, T>; // Error
|
||||
~
|
||||
!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'.
|
||||
!!! error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'.
|
||||
!!! error TS2344: Type 'string | number' is not assignable to type 'keyof Shape'.
|
||||
!!! error TS2344: Type 'string' is not assignable to type 'keyof Shape'.
|
||||
!!! error TS2344: Type 'T' is not assignable to type '"visible"'.
|
||||
!!! error TS2344: Type 'string | number' is not assignable to type '"visible"'.
|
||||
!!! error TS2344: Type 'string' is not assignable to type '"visible"'.
|
||||
@@ -204,8 +204,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339:
|
||||
!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick<Foo, "a">'
|
||||
setState(foo, { c: true }); // Error
|
||||
~~~~~~~
|
||||
!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, "a" | "b">'.
|
||||
!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, "a" | "b">'.
|
||||
!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, keyof Foo>'.
|
||||
!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, keyof Foo>'.
|
||||
|
||||
class C<T> {
|
||||
state: T;
|
||||
@@ -228,8 +228,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339:
|
||||
!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick<Foo, "a">'
|
||||
c.setState({ c: true }); // Error
|
||||
~~~~~~~
|
||||
!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, "a" | "b">'.
|
||||
!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, "a" | "b">'.
|
||||
!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, keyof Foo>'.
|
||||
!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, keyof Foo>'.
|
||||
|
||||
type T2 = { a?: number, [key: string]: any };
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ type T13 = Pick<Shape, keyof Named>;
|
||||
>T13 : Pick<Shape, "name">
|
||||
|
||||
type T14 = Pick<Shape, keyof Point>; // Error
|
||||
>T14 : Pick<Shape, "x" | "y">
|
||||
>T14 : Pick<Shape, keyof Point>
|
||||
|
||||
type T15 = Pick<Shape, never>;
|
||||
>T15 : Pick<Shape, never>
|
||||
@@ -78,7 +78,7 @@ function f2<T extends string | number>(x: T) {
|
||||
}
|
||||
|
||||
function f3<T extends keyof Shape>(x: T) {
|
||||
>f3 : <T extends "name" | "width" | "height" | "visible">(x: T) => void
|
||||
>f3 : <T extends keyof Shape>(x: T) => void
|
||||
>x : T
|
||||
|
||||
let y: Pick<Shape, T>;
|
||||
@@ -374,9 +374,9 @@ let c = new C<Foo>();
|
||||
|
||||
c.setState({ a: "test", b: 43 });
|
||||
>c.setState({ a: "test", b: 43 }) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>{ a: "test", b: 43 } : { a: string; b: number; }
|
||||
>a : string
|
||||
>"test" : "test"
|
||||
@@ -385,50 +385,50 @@ c.setState({ a: "test", b: 43 });
|
||||
|
||||
c.setState({ a: "hi" });
|
||||
>c.setState({ a: "hi" }) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>{ a: "hi" } : { a: string; }
|
||||
>a : string
|
||||
>"hi" : "hi"
|
||||
|
||||
c.setState({ b: undefined });
|
||||
>c.setState({ b: undefined }) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>{ b: undefined } : { b: undefined; }
|
||||
>b : undefined
|
||||
>undefined : undefined
|
||||
|
||||
c.setState({ });
|
||||
>c.setState({ }) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>{ } : {}
|
||||
|
||||
c.setState(foo);
|
||||
>c.setState(foo) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>foo : Foo
|
||||
|
||||
c.setState({ a: undefined }); // Error
|
||||
>c.setState({ a: undefined }) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>{ a: undefined } : { a: undefined; }
|
||||
>a : undefined
|
||||
>undefined : undefined
|
||||
|
||||
c.setState({ c: true }); // Error
|
||||
>c.setState({ c: true }) : void
|
||||
>c.setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>c.setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>c : C<Foo>
|
||||
>setState : <K extends "a" | "b">(props: Pick<Foo, K>) => void
|
||||
>setState : <K extends keyof Foo>(props: Pick<Foo, K>) => void
|
||||
>{ c: true } : { c: boolean; }
|
||||
>c : boolean
|
||||
>true : true
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
for (const element of document.getElementsByTagName("a")) {
|
||||
>element : HTMLAnchorElement
|
||||
>document.getElementsByTagName("a") : HTMLCollectionOf<HTMLAnchorElement>
|
||||
>document.getElementsByTagName : { <K extends "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document.getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>document : Document
|
||||
>getElementsByTagName : { <K extends "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends "symbol" | "a" | "script" | "style" | "title" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>getElementsByTagName : { <K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>; <K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>"a" : "a"
|
||||
|
||||
element.href;
|
||||
|
||||
@@ -128,17 +128,17 @@ interface Big {
|
||||
>ref : Obj<{ common?: string | undefined; "17"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; }> | Func<{ common?: string | undefined; "17"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; }> | undefined
|
||||
}
|
||||
declare function getCtor<T extends keyof Big>(comp: T): CtorOf<Big[T]>
|
||||
>getCtor : <T extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17">(comp: T) => CtorOf<Big[T]>
|
||||
>getCtor : <T extends keyof Big>(comp: T) => CtorOf<Big[T]>
|
||||
>comp : T
|
||||
|
||||
declare var all: keyof Big;
|
||||
>all : "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17"
|
||||
>all : keyof Big
|
||||
|
||||
const ctor = getCtor(all);
|
||||
>ctor : CtorOf<{ common?: string | undefined; "0"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; }>
|
||||
>getCtor(all) : CtorOf<{ common?: string | undefined; "0"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; }>
|
||||
>getCtor : <T extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17">(comp: T) => CtorOf<Big[T]>
|
||||
>all : "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17"
|
||||
>getCtor : <T extends keyof Big>(comp: T) => CtorOf<Big[T]>
|
||||
>all : keyof Big
|
||||
|
||||
const comp = ctor({ common: "ok", ref: x => console.log(x) });
|
||||
>comp : { common?: string | undefined; "0"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj<any> | Func<any> | undefined; }
|
||||
|
||||
@@ -5,11 +5,11 @@ interface Bar { bar: number; foo: object | null; }
|
||||
>null : null
|
||||
|
||||
let a = {
|
||||
>a : { test<K extends "bar" | "foo">(a: K, b?: Bar[K] | null | undefined): void; }
|
||||
>{ test<K extends keyof Bar> (a: K, b?: Bar[K] | null) { }} : { test<K extends "bar" | "foo">(a: K, b?: Bar[K] | null | undefined): void; }
|
||||
>a : { test<K extends keyof Bar>(a: K, b?: Bar[K] | null | undefined): void; }
|
||||
>{ test<K extends keyof Bar> (a: K, b?: Bar[K] | null) { }} : { test<K extends keyof Bar>(a: K, b?: Bar[K] | null | undefined): void; }
|
||||
|
||||
test<K extends keyof Bar> (a: K, b?: Bar[K] | null) { }
|
||||
>test : <K extends "bar" | "foo">(a: K, b?: Bar[K] | null | undefined) => void
|
||||
>test : <K extends keyof Bar>(a: K, b?: Bar[K] | null | undefined) => void
|
||||
>a : K
|
||||
>b : Bar[K] | null | undefined
|
||||
>null : null
|
||||
@@ -17,9 +17,9 @@ let a = {
|
||||
};
|
||||
a.test("bar", null); // ok, null is assignable to number | null | undefined
|
||||
>a.test("bar", null) : void
|
||||
>a.test : <K extends "bar" | "foo">(a: K, b?: Bar[K] | null | undefined) => void
|
||||
>a : { test<K extends "bar" | "foo">(a: K, b?: Bar[K] | null | undefined): void; }
|
||||
>test : <K extends "bar" | "foo">(a: K, b?: Bar[K] | null | undefined) => void
|
||||
>a.test : <K extends keyof Bar>(a: K, b?: Bar[K] | null | undefined) => void
|
||||
>a : { test<K extends keyof Bar>(a: K, b?: Bar[K] | null | undefined): void; }
|
||||
>test : <K extends keyof Bar>(a: K, b?: Bar[K] | null | undefined) => void
|
||||
>"bar" : "bar"
|
||||
>null : null
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts ===
|
||||
interface Document {
|
||||
createElement(tagName: string): HTMLElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends "listing" | "xmp">(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; }
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; }
|
||||
>tagName : string
|
||||
|
||||
createElement(tagName: 'canvas'): HTMLCanvasElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends "listing" | "xmp">(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: 'canvas'): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; }
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: 'canvas'): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; }
|
||||
>tagName : "canvas"
|
||||
|
||||
createElement(tagName: 'div'): HTMLDivElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends "listing" | "xmp">(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: 'div'): HTMLDivElement; (tagName: "span"): HTMLSpanElement; }
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: 'div'): HTMLDivElement; (tagName: "span"): HTMLSpanElement; }
|
||||
>tagName : "div"
|
||||
|
||||
createElement(tagName: 'span'): HTMLSpanElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr">(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends "listing" | "xmp">(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: 'span'): HTMLSpanElement; }
|
||||
>createElement : { <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; <K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: 'span'): HTMLSpanElement; }
|
||||
>tagName : "span"
|
||||
}
|
||||
@@ -214,17 +214,17 @@ const obj: Partial<MyAPI> = {};
|
||||
>{} : {}
|
||||
|
||||
declare var keys: (keyof MyAPI)[];
|
||||
>keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[]
|
||||
>keys : (keyof MyAPI)[]
|
||||
|
||||
for (const k of keys) {
|
||||
>k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51
|
||||
>keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[]
|
||||
>k : keyof MyAPI
|
||||
>keys : (keyof MyAPI)[]
|
||||
|
||||
obj[k] = () => "12"; // shouldn't cause a complexity error
|
||||
>obj[k] = () => "12" : () => string
|
||||
>obj[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | undefined
|
||||
>obj : Partial<MyAPI>
|
||||
>k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51
|
||||
>k : keyof MyAPI
|
||||
>() => "12" : () => string
|
||||
>"12" : "12"
|
||||
}
|
||||
@@ -238,14 +238,14 @@ const obj2: PartialNull<MyAPI> = {};
|
||||
>{} : {}
|
||||
|
||||
for (const k of keys) {
|
||||
>k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51
|
||||
>keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[]
|
||||
>k : keyof MyAPI
|
||||
>keys : (keyof MyAPI)[]
|
||||
|
||||
obj2[k] = () => "12"; // shouldn't cause a complexity error
|
||||
>obj2[k] = () => "12" : () => string
|
||||
>obj2[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | null | undefined
|
||||
>obj2 : PartialNull<MyAPI>
|
||||
>k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51
|
||||
>k : keyof MyAPI
|
||||
>() => "12" : () => string
|
||||
>"12" : "12"
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ class A {
|
||||
}
|
||||
|
||||
type T = keyof A // should not include '#foo'
|
||||
>T : "bar" | "baz"
|
||||
>T : keyof A
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as React from "react";
|
||||
>React : typeof React
|
||||
|
||||
declare const Tag: keyof React.ReactHTML;
|
||||
>Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview"
|
||||
>Tag : keyof React.ReactHTML
|
||||
>React : any
|
||||
|
||||
const classes = "";
|
||||
@@ -22,7 +22,7 @@ const children: any[] = [];
|
||||
|
||||
<Tag className={classes} {...rest}>
|
||||
><Tag className={classes} {...rest}>{children}</Tag> : JSX.Element
|
||||
>Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview"
|
||||
>Tag : keyof React.ReactHTML
|
||||
>className : string
|
||||
>classes : ""
|
||||
>rest : {}
|
||||
@@ -31,5 +31,5 @@ const children: any[] = [];
|
||||
>children : any[]
|
||||
|
||||
</Tag>
|
||||
>Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview"
|
||||
>Tag : keyof React.ReactHTML
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as React from "react";
|
||||
>React : typeof React
|
||||
|
||||
declare const Tag: keyof React.ReactHTML;
|
||||
>Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview"
|
||||
>Tag : keyof React.ReactHTML
|
||||
>React : any
|
||||
|
||||
const classes = "";
|
||||
@@ -23,7 +23,7 @@ const children: any[] = [];
|
||||
|
||||
<Tag className={classes} {...rest}>
|
||||
><Tag className={classes} {...rest}>{children}</Tag> : JSX.Element
|
||||
>Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview"
|
||||
>Tag : keyof React.ReactHTML
|
||||
>className : string
|
||||
>classes : ""
|
||||
>rest : React.HTMLAttributes<HTMLElement>
|
||||
@@ -32,5 +32,5 @@ const children: any[] = [];
|
||||
>children : any[]
|
||||
|
||||
</Tag>
|
||||
>Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview"
|
||||
>Tag : keyof React.ReactHTML
|
||||
|
||||
@@ -38,7 +38,7 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(191,5): error TS2322: Typ
|
||||
Type 'readonly string[]' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'readonly string[]'.
|
||||
tests/cases/conformance/types/tuple/variadicTuples1.ts(203,5): error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'.
|
||||
Type '"2"' is not assignable to type 'number | "0" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "1"'.
|
||||
Type '"2"' is not assignable to type '"0" | (number | keyof T[]) | "1"'.
|
||||
tests/cases/conformance/types/tuple/variadicTuples1.ts(346,14): error TS7019: Rest parameter 'x' implicitly has an 'any[]' type.
|
||||
tests/cases/conformance/types/tuple/variadicTuples1.ts(354,26): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
|
||||
tests/cases/conformance/types/tuple/variadicTuples1.ts(393,19): error TS1256: A rest element must be last in a tuple type.
|
||||
@@ -309,7 +309,7 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(397,12): error TS1256: A
|
||||
k3 = '2'; // Error
|
||||
~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'.
|
||||
!!! error TS2322: Type '"2"' is not assignable to type 'number | "0" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "1"'.
|
||||
!!! error TS2322: Type '"2"' is not assignable to type '"0" | (number | keyof T[]) | "1"'.
|
||||
}
|
||||
|
||||
// Inference between variadic tuple types
|
||||
|
||||
Reference in new issue
Block a user