mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Accept new baselines
This commit is contained in:
@@ -5,7 +5,7 @@ async ({ foo, bar, ...rest }) => bar(await foo);
|
||||
>async ({ foo, bar, ...rest }) => bar(await foo) : ({ foo, bar, ...rest }: { [x: string]: any; foo: any; bar: any; }) => Promise<any>
|
||||
>foo : any
|
||||
>bar : any
|
||||
>rest : { [x: string]: any; }
|
||||
>rest : Rest<{ [x: string]: any; foo: any; bar: any; }, "foo" | "bar">
|
||||
>bar(await foo) : any
|
||||
>bar : any
|
||||
>await foo : any
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
|
||||
Index signatures are incompatible.
|
||||
Type 'string | number' is not assignable to type 'boolean'.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ====
|
||||
interface I {
|
||||
[s: string]: boolean;
|
||||
[s: number]: boolean;
|
||||
}
|
||||
|
||||
var o: I = {
|
||||
~
|
||||
!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
|
||||
[""+"foo"]: "",
|
||||
~~~~~~~~~~
|
||||
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
|
||||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature.
|
||||
[""+"bar"]: 0
|
||||
~~~~~~~~~~
|
||||
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
|
||||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature.
|
||||
}
|
||||
@@ -1,20 +1,21 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
|
||||
Index signatures are incompatible.
|
||||
Type 'string | number' is not assignable to type 'boolean'.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (1 errors) ====
|
||||
interface I {
|
||||
[s: string]: boolean;
|
||||
[s: number]: boolean;
|
||||
}
|
||||
|
||||
var o: I = {
|
||||
~
|
||||
!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
|
||||
[""+"foo"]: "",
|
||||
~~~~~~~~~~
|
||||
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
|
||||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature.
|
||||
[""+"bar"]: 0
|
||||
~~~~~~~~~~
|
||||
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
|
||||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature.
|
||||
}
|
||||
@@ -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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "li" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>"li" : "li"
|
||||
|
||||
type ItemType3 = true.typeof(nodes.item(0));
|
||||
|
||||
@@ -10,7 +10,7 @@ let array = [{a: 0, b: 1}]
|
||||
|
||||
for (let { a, ...rest } of array)
|
||||
>a : number
|
||||
>rest : { b: number; }
|
||||
>rest : Rest<{ a: number; b: number; }, "a">
|
||||
>array : { a: number; b: number; }[]
|
||||
|
||||
void a
|
||||
|
||||
@@ -33,7 +33,7 @@ interface Foo {
|
||||
}
|
||||
export var { a, ...x } : Foo;
|
||||
>a : number
|
||||
>x : { b: string; }
|
||||
>x : Rest<Foo, "a">
|
||||
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
export {};
|
||||
@@ -72,7 +72,7 @@ declare namespace N {
|
||||
}
|
||||
export var { a, ...x } : Foo;
|
||||
>a : number
|
||||
>x : { b: string; }
|
||||
>x : Rest<Foo, "a">
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/tslib.d.ts ===
|
||||
|
||||
@@ -24,7 +24,7 @@ export function assertIsElement(node: Node | null): node is Element {
|
||||
}
|
||||
|
||||
export function assertNodeTagName<
|
||||
>assertNodeTagName : <T extends "symbol" | "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view", 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" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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", P extends keyof ElementTagNameMap[T], V extends HTMLElementTagNameMap[T][P]>(node: Node | null, tagName: T, prop: P, value: V) => void
|
||||
>assertNodeProperty : <T extends "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view", 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" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view", 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 number | "symbol" | "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends number | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view", 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 number | "symbol" | "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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", P extends keyof ElementTagNameMap[T], V extends HTMLElementTagNameMap[T][P]>(node: Node | null, tagName: T, prop: P, value: V) => void
|
||||
>assertNodeProperty : <T extends number | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view", 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 number | "symbol" | "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>assertNodeTagName : <T extends number | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view", U extends ElementTagNameMap[T]>(node: Node | null, tagName: T) => node is U
|
||||
>node : Node | null
|
||||
>tagName : T
|
||||
|
||||
|
||||
@@ -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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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" | "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 "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "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 "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" | "symbol" | "text" | "textPath" | "tspan" | "use" | "view">(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>; (qualifiedName: string): HTMLCollectionOf<Element>; }
|
||||
>"a" : "a"
|
||||
|
||||
element.href;
|
||||
|
||||
@@ -19,6 +19,6 @@ var { destructuring } = a; // error
|
||||
>a : object
|
||||
|
||||
var { ...rest } = a; // ok
|
||||
>rest : {}
|
||||
>rest : object
|
||||
>a : object
|
||||
|
||||
|
||||
58
tests/baselines/reference/objectRest.errors.txt
Normal file
58
tests/baselines/reference/objectRest.errors.txt
Normal file
@@ -0,0 +1,58 @@
|
||||
tests/cases/conformance/types/rest/objectRest.ts(43,57): error TS2403: Subsequent variable declarations must have the same type. Variable 'o' must be of type '{ a: number; b: string; }', but here has type 'Rest<{ a: number; b: string; }, string>'.
|
||||
tests/cases/conformance/types/rest/objectRest.ts(44,53): error TS2322: Type 'Rest<{ a: number; b: string; }, string>' is not assignable to type '{ a: number; b: string; }'.
|
||||
Property 'a' is missing in type 'Rest<{ a: number; b: string; }, string>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/rest/objectRest.ts (2 errors) ====
|
||||
var o = { a: 1, b: 'no' }
|
||||
var { ...clone } = o;
|
||||
var { a, ...justB } = o;
|
||||
var { a, b: renamed, ...empty } = o;
|
||||
var { ['b']: renamed, ...justA } = o;
|
||||
var { 'b': renamed, ...justA } = o;
|
||||
var { b: { '0': n, '1': oooo }, ...justA } = o;
|
||||
|
||||
let o2 = { c: 'terrible idea?', d: 'yes' };
|
||||
var { d: renamed, ...d } = o2;
|
||||
|
||||
let nestedrest: { x: number, n1: { y: number, n2: { z: number, n3: { n4: number } } }, rest: number, restrest: number };
|
||||
var { x, n1: { y, n2: { z, n3: { ...nr } } }, ...restrest } = nestedrest;
|
||||
|
||||
let complex: { x: { ka, ki }, y: number };
|
||||
var { x: { ka, ...nested }, y: other, ...rest } = complex;
|
||||
({x: { ka, ...nested }, y: other, ...rest} = complex);
|
||||
var { x, ...fresh } = { x: 1, y: 2 };
|
||||
({ x, ...fresh } = { x: 1, y: 2 });
|
||||
|
||||
class Removable {
|
||||
private x: number;
|
||||
protected y: number;
|
||||
set z(value: number) { }
|
||||
get both(): number { return 12 }
|
||||
set both(value: number) { }
|
||||
m() { }
|
||||
removed: string;
|
||||
remainder: string;
|
||||
}
|
||||
interface I {
|
||||
m(): void;
|
||||
removed: string;
|
||||
remainder: string;
|
||||
}
|
||||
var removable = new Removable();
|
||||
var { removed, ...removableRest } = removable;
|
||||
var i: I = removable;
|
||||
var { removed, ...removableRest2 } = i;
|
||||
|
||||
let computed = 'b';
|
||||
let computed2 = 'a';
|
||||
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
|
||||
~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o' must be of type '{ a: number; b: string; }', but here has type 'Rest<{ a: number; b: string; }, string>'.
|
||||
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
|
||||
~
|
||||
!!! error TS2322: Type 'Rest<{ a: number; b: string; }, string>' is not assignable to type '{ a: number; b: string; }'.
|
||||
!!! error TS2322: Property 'a' is missing in type 'Rest<{ a: number; b: string; }, string>'.
|
||||
|
||||
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes;
|
||||
|
||||
@@ -13,32 +13,32 @@ var { ...clone } = o;
|
||||
|
||||
var { a, ...justB } = o;
|
||||
>a : number
|
||||
>justB : { b: string; }
|
||||
>justB : Rest<{ a: number; b: string; }, "a">
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
var { a, b: renamed, ...empty } = o;
|
||||
>a : number
|
||||
>b : any
|
||||
>renamed : string
|
||||
>empty : {}
|
||||
>empty : Rest<{ a: number; b: string; }, "a" | "b">
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
var { ['b']: renamed, ...justA } = o;
|
||||
>'b' : "b"
|
||||
>renamed : string
|
||||
>justA : { a: number; }
|
||||
>justA : Rest<{ a: number; b: string; }, "b">
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
var { 'b': renamed, ...justA } = o;
|
||||
>renamed : string
|
||||
>justA : { a: number; }
|
||||
>justA : Rest<{ a: number; b: string; }, "b">
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
var { b: { '0': n, '1': oooo }, ...justA } = o;
|
||||
>b : any
|
||||
>n : string
|
||||
>oooo : string
|
||||
>justA : { a: number; }
|
||||
>justA : Rest<{ a: number; b: string; }, "b">
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
let o2 = { c: 'terrible idea?', d: 'yes' };
|
||||
@@ -52,7 +52,7 @@ let o2 = { c: 'terrible idea?', d: 'yes' };
|
||||
var { d: renamed, ...d } = o2;
|
||||
>d : any
|
||||
>renamed : string
|
||||
>d : { c: string; }
|
||||
>d : Rest<{ c: string; d: string; }, "d">
|
||||
>o2 : { c: string; d: string; }
|
||||
|
||||
let nestedrest: { x: number, n1: { y: number, n2: { z: number, n3: { n4: number } } }, rest: number, restrest: number };
|
||||
@@ -75,7 +75,7 @@ var { x, n1: { y, n2: { z, n3: { ...nr } } }, ...restrest } = nestedrest;
|
||||
>z : number
|
||||
>n3 : any
|
||||
>nr : { n4: number; }
|
||||
>restrest : { rest: number; restrest: number; }
|
||||
>restrest : Rest<{ x: number; n1: { y: number; n2: { z: number; n3: { n4: number; }; }; }; rest: number; restrest: number; }, "x" | "n1">
|
||||
>nestedrest : { x: number; n1: { y: number; n2: { z: number; n3: { n4: number; }; }; }; rest: number; restrest: number; }
|
||||
|
||||
let complex: { x: { ka, ki }, y: number };
|
||||
@@ -88,10 +88,10 @@ let complex: { x: { ka, ki }, y: number };
|
||||
var { x: { ka, ...nested }, y: other, ...rest } = complex;
|
||||
>x : any
|
||||
>ka : any
|
||||
>nested : { ki: any; }
|
||||
>nested : Rest<{ ka: any; ki: any; }, "ka">
|
||||
>y : any
|
||||
>other : number
|
||||
>rest : {}
|
||||
>rest : Rest<{ x: { ka: any; ki: any; }; y: number; }, "x" | "y">
|
||||
>complex : { x: { ka: any; ki: any; }; y: number; }
|
||||
|
||||
({x: { ka, ...nested }, y: other, ...rest} = complex);
|
||||
@@ -101,15 +101,15 @@ var { x: { ka, ...nested }, y: other, ...rest } = complex;
|
||||
>x : { ki: any; ka: any; }
|
||||
>{ ka, ...nested } : { ki: any; ka: any; }
|
||||
>ka : any
|
||||
>nested : { ki: any; }
|
||||
>nested : Rest<{ ka: any; ki: any; }, "ka">
|
||||
>y : number
|
||||
>other : number
|
||||
>rest : {}
|
||||
>rest : Rest<{ x: { ka: any; ki: any; }; y: number; }, "x" | "y">
|
||||
>complex : { x: { ka: any; ki: any; }; y: number; }
|
||||
|
||||
var { x, ...fresh } = { x: 1, y: 2 };
|
||||
>x : number
|
||||
>fresh : { y: number; }
|
||||
>fresh : Rest<{ x: number; y: number; }, "x">
|
||||
>{ x: 1, y: 2 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>1 : 1
|
||||
@@ -121,7 +121,7 @@ var { x, ...fresh } = { x: 1, y: 2 };
|
||||
>{ x, ...fresh } = { x: 1, y: 2 } : { x: number; y: number; }
|
||||
>{ x, ...fresh } : { y: number; x: number; }
|
||||
>x : number
|
||||
>fresh : { y: number; }
|
||||
>fresh : Rest<{ x: number; y: number; }, "x">
|
||||
>{ x: 1, y: 2 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>1 : 1
|
||||
@@ -175,7 +175,7 @@ var removable = new Removable();
|
||||
|
||||
var { removed, ...removableRest } = removable;
|
||||
>removed : string
|
||||
>removableRest : { remainder: string; }
|
||||
>removableRest : Rest<Removable, "removed">
|
||||
>removable : Removable
|
||||
|
||||
var i: I = removable;
|
||||
@@ -184,7 +184,7 @@ var i: I = removable;
|
||||
|
||||
var { removed, ...removableRest2 } = i;
|
||||
>removed : string
|
||||
>removableRest2 : { m(): void; remainder: string; }
|
||||
>removableRest2 : Rest<I, "removed">
|
||||
>i : I
|
||||
|
||||
let computed = 'b';
|
||||
@@ -221,10 +221,10 @@ var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmp
|
||||
>({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes : ({ aNumber, ...notEmptyObject }: { [x: string]: any; aNumber?: number; }) => any
|
||||
>aNumber : number
|
||||
>12 : 12
|
||||
>notEmptyObject : { [x: string]: any; }
|
||||
>notEmptyObject : Rest<{ [x: string]: any; aNumber?: number; }, "aNumber">
|
||||
>aNumber + notEmptyObject.anythingGoes : any
|
||||
>aNumber : number
|
||||
>notEmptyObject.anythingGoes : any
|
||||
>notEmptyObject : { [x: string]: any; }
|
||||
>notEmptyObject : Rest<{ [x: string]: any; aNumber?: number; }, "aNumber">
|
||||
>anythingGoes : any
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ var { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit;
|
||||
>y : { ka: string; x: string; }[]
|
||||
>b : any
|
||||
>z : string
|
||||
>c : { ki: string; ku: string; }
|
||||
>rest2 : { ke: string; ko: string; }
|
||||
>c : Rest<{ z: string; ki: string; ku: string; }, "z">
|
||||
>rest2 : Rest<{ a: { ka: string; x: string; }[]; b: { z: string; ki: string; ku: string; }; ke: string; ko: string; }, "a" | "b">
|
||||
>overEmit : { a: { ka: string; x: string; }[]; b: { z: string; ki: string; ku: string; }; ke: string; ko: string; }
|
||||
|
||||
({ a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit);
|
||||
@@ -69,7 +69,7 @@ var { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 } = overEmit;
|
||||
>b : { ki: string; ku: string; z: string; }
|
||||
>{ z, ...c } : { ki: string; ku: string; z: string; }
|
||||
>z : string
|
||||
>c : { ki: string; ku: string; }
|
||||
>rest2 : { ke: string; ko: string; }
|
||||
>c : Rest<{ z: string; ki: string; ku: string; }, "z">
|
||||
>rest2 : Rest<{ a: { ka: string; x: string; }[]; b: { z: string; ki: string; ku: string; }; ke: string; ko: string; }, "a" | "b">
|
||||
>overEmit : { a: { ka: string; x: string; }[]; b: { z: string; ki: string; ku: string; }; ke: string; ko: string; }
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ let array: { x: number, y: string }[];
|
||||
|
||||
for (let { x, ...restOf } of array) {
|
||||
>x : number
|
||||
>restOf : { y: string; }
|
||||
>restOf : Rest<{ x: number; y: string; }, "x">
|
||||
>array : { x: number; y: string; }[]
|
||||
|
||||
[x, restOf];
|
||||
>[x, restOf] : (number | { y: string; })[]
|
||||
>[x, restOf] : (number | Rest<{ x: number; y: string; }, "x">)[]
|
||||
>x : number
|
||||
>restOf : { y: string; }
|
||||
>restOf : Rest<{ x: number; y: string; }, "x">
|
||||
}
|
||||
let xx: number;
|
||||
>xx : number
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(2,10): error TS2462: A rest element must be last in a destructuring pattern.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(6,10): error TS2322: Type '{ a: number; }' is not assignable to type '{ a: string; }'.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(6,10): error TS2322: Type 'Rest<{ a: number; b: string; }, "b">' is not assignable to type '{ a: string; }'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(9,31): error TS2462: A rest element must be last in a destructuring pattern.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(11,30): error TS7008: Member 'x' implicitly has an 'any' type.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(11,33): error TS7008: Member 'y' implicitly has an 'any' type.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(12,17): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/conformance/types/rest/objectRestNegative.ts(17,9): error TS2701: The target of an object rest assignment must be a variable or a property access.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/rest/objectRestNegative.ts (7 errors) ====
|
||||
==== tests/cases/conformance/types/rest/objectRestNegative.ts (6 errors) ====
|
||||
let o = { a: 1, b: 'no' };
|
||||
var { ...mustBeLast, a } = o;
|
||||
~~~~~~~~~~
|
||||
@@ -19,7 +18,7 @@ tests/cases/conformance/types/rest/objectRestNegative.ts(17,9): error TS2701: Th
|
||||
let notAssignable: { a: string };
|
||||
({ b, ...notAssignable } = o);
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ a: string; }'.
|
||||
!!! error TS2322: Type 'Rest<{ a: number; b: string; }, "b">' is not assignable to type '{ a: string; }'.
|
||||
!!! error TS2322: Types of property 'a' are incompatible.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
@@ -34,8 +33,6 @@ tests/cases/conformance/types/rest/objectRestNegative.ts(17,9): error TS2701: Th
|
||||
~
|
||||
!!! error TS7008: Member 'y' implicitly has an 'any' type.
|
||||
let { x, ...rest } = t;
|
||||
~~~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
return rest;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ let o = { a: 1, b: 'no' };
|
||||
>'no' : "no"
|
||||
|
||||
var { ...mustBeLast, a } = o;
|
||||
>mustBeLast : { b: string; }
|
||||
>mustBeLast : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
@@ -30,24 +30,24 @@ let notAssignable: { a: string };
|
||||
|
||||
function stillMustBeLast({ ...mustBeLast, a }: { a: number, b: string }): void {
|
||||
>stillMustBeLast : ({ ...mustBeLast, a }: { a: number; b: string; }) => void
|
||||
>mustBeLast : { b: string; }
|
||||
>mustBeLast : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>a : number
|
||||
>b : string
|
||||
}
|
||||
function generic<T extends { x, y }>(t: T) {
|
||||
>generic : <T extends { x: any; y: any; }>(t: T) => any
|
||||
>generic : <T extends { x: any; y: any; }>(t: T) => Rest<T, "x">
|
||||
>x : any
|
||||
>y : any
|
||||
>t : T
|
||||
|
||||
let { x, ...rest } = t;
|
||||
>x : any
|
||||
>rest : any
|
||||
>rest : Rest<T, "x">
|
||||
>t : T
|
||||
|
||||
return rest;
|
||||
>rest : any
|
||||
>rest : Rest<T, "x">
|
||||
}
|
||||
|
||||
let rest: { b: string }
|
||||
|
||||
@@ -21,9 +21,9 @@ suddenly(({ x: a, ...rest }) => rest.y);
|
||||
>x : Symbol(x, Decl(objectRestParameter.ts, 3, 34))
|
||||
>a : Symbol(a, Decl(objectRestParameter.ts, 4, 11))
|
||||
>rest : Symbol(rest, Decl(objectRestParameter.ts, 4, 17))
|
||||
>rest.y : Symbol(y, Decl(objectRestParameter.ts, 3, 48))
|
||||
>rest.y : Symbol(y)
|
||||
>rest : Symbol(rest, Decl(objectRestParameter.ts, 4, 17))
|
||||
>y : Symbol(y, Decl(objectRestParameter.ts, 3, 48))
|
||||
>y : Symbol(y)
|
||||
|
||||
suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka);
|
||||
>suddenly : Symbol(suddenly, Decl(objectRestParameter.ts, 1, 1))
|
||||
@@ -35,12 +35,12 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo'
|
||||
>z : Symbol(z, Decl(objectRestParameter.ts, 5, 56))
|
||||
>ka : Symbol(ka, Decl(objectRestParameter.ts, 5, 62))
|
||||
>y : Symbol(y, Decl(objectRestParameter.ts, 5, 71))
|
||||
>rest.y : Symbol(y, Decl(objectRestParameter.ts, 3, 48))
|
||||
>rest.y : Symbol(y)
|
||||
>rest : Symbol(rest, Decl(objectRestParameter.ts, 5, 37))
|
||||
>y : Symbol(y, Decl(objectRestParameter.ts, 3, 48))
|
||||
>nested.ka : Symbol(ka, Decl(objectRestParameter.ts, 3, 42))
|
||||
>y : Symbol(y)
|
||||
>nested.ka : Symbol(ka)
|
||||
>nested : Symbol(nested, Decl(objectRestParameter.ts, 5, 24))
|
||||
>ka : Symbol(ka, Decl(objectRestParameter.ts, 3, 42))
|
||||
>ka : Symbol(ka)
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(objectRestParameter.ts, 5, 107))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
function cloneAgain({ a, ...clone }: { a: number, b: string }): void {
|
||||
>cloneAgain : ({ a, ...clone }: { a: number; b: string; }) => void
|
||||
>a : number
|
||||
>clone : { b: string; }
|
||||
>clone : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>b : string
|
||||
}
|
||||
@@ -22,9 +22,9 @@ suddenly(({ x: a, ...rest }) => rest.y);
|
||||
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
|
||||
>x : any
|
||||
>a : { z: any; ka: any; }
|
||||
>rest : { y: string; }
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>rest.y : string
|
||||
>rest : { y: string; }
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>y : string
|
||||
|
||||
suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka);
|
||||
@@ -34,8 +34,8 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo'
|
||||
>x : any
|
||||
>z : any
|
||||
>12 : 12
|
||||
>nested : { ka: any; }
|
||||
>rest : { y: string; }
|
||||
>nested : Rest<{ z: any; ka: any; }, "z">
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>{ x: { z: 1, ka: 1 }, y: 'noo' } : { x: { z: number; ka: number; }; y: string; }
|
||||
>x : { z: number; ka: number; }
|
||||
>{ z: 1, ka: 1 } : { z: number; ka: number; }
|
||||
@@ -47,10 +47,10 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo'
|
||||
>'noo' : "noo"
|
||||
>rest.y + nested.ka : string
|
||||
>rest.y : string
|
||||
>rest : { y: string; }
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>y : string
|
||||
>nested.ka : any
|
||||
>nested : { ka: any; }
|
||||
>nested : Rest<{ z: any; ka: any; }, "z">
|
||||
>ka : any
|
||||
|
||||
class C {
|
||||
@@ -59,7 +59,7 @@ class C {
|
||||
m({ a, ...clone }: { a: number, b: string}): void {
|
||||
>m : ({ a, ...clone }: { a: number; b: string; }) => void
|
||||
>a : number
|
||||
>clone : { b: string; }
|
||||
>clone : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>b : string
|
||||
|
||||
@@ -68,7 +68,7 @@ class C {
|
||||
set p({ a, ...clone }: { a: number, b: string}) {
|
||||
>p : { a: number; b: string; }
|
||||
>a : number
|
||||
>clone : { b: string; }
|
||||
>clone : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>b : string
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ suddenly(({ x: a, ...rest }) => rest.y);
|
||||
>x : Symbol(x, Decl(objectRestParameterES5.ts, 3, 34))
|
||||
>a : Symbol(a, Decl(objectRestParameterES5.ts, 4, 11))
|
||||
>rest : Symbol(rest, Decl(objectRestParameterES5.ts, 4, 17))
|
||||
>rest.y : Symbol(y, Decl(objectRestParameterES5.ts, 3, 48))
|
||||
>rest.y : Symbol(y)
|
||||
>rest : Symbol(rest, Decl(objectRestParameterES5.ts, 4, 17))
|
||||
>y : Symbol(y, Decl(objectRestParameterES5.ts, 3, 48))
|
||||
>y : Symbol(y)
|
||||
|
||||
suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka);
|
||||
>suddenly : Symbol(suddenly, Decl(objectRestParameterES5.ts, 1, 1))
|
||||
@@ -35,12 +35,12 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo'
|
||||
>z : Symbol(z, Decl(objectRestParameterES5.ts, 5, 56))
|
||||
>ka : Symbol(ka, Decl(objectRestParameterES5.ts, 5, 62))
|
||||
>y : Symbol(y, Decl(objectRestParameterES5.ts, 5, 71))
|
||||
>rest.y : Symbol(y, Decl(objectRestParameterES5.ts, 3, 48))
|
||||
>rest.y : Symbol(y)
|
||||
>rest : Symbol(rest, Decl(objectRestParameterES5.ts, 5, 37))
|
||||
>y : Symbol(y, Decl(objectRestParameterES5.ts, 3, 48))
|
||||
>nested.ka : Symbol(ka, Decl(objectRestParameterES5.ts, 3, 42))
|
||||
>y : Symbol(y)
|
||||
>nested.ka : Symbol(ka)
|
||||
>nested : Symbol(nested, Decl(objectRestParameterES5.ts, 5, 24))
|
||||
>ka : Symbol(ka, Decl(objectRestParameterES5.ts, 3, 42))
|
||||
>ka : Symbol(ka)
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(objectRestParameterES5.ts, 5, 107))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
function cloneAgain({ a, ...clone }: { a: number, b: string }): void {
|
||||
>cloneAgain : ({ a, ...clone }: { a: number; b: string; }) => void
|
||||
>a : number
|
||||
>clone : { b: string; }
|
||||
>clone : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>b : string
|
||||
}
|
||||
@@ -22,9 +22,9 @@ suddenly(({ x: a, ...rest }) => rest.y);
|
||||
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
|
||||
>x : any
|
||||
>a : { z: any; ka: any; }
|
||||
>rest : { y: string; }
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>rest.y : string
|
||||
>rest : { y: string; }
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>y : string
|
||||
|
||||
suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka);
|
||||
@@ -34,8 +34,8 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo'
|
||||
>x : any
|
||||
>z : any
|
||||
>12 : 12
|
||||
>nested : { ka: any; }
|
||||
>rest : { y: string; }
|
||||
>nested : Rest<{ z: any; ka: any; }, "z">
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>{ x: { z: 1, ka: 1 }, y: 'noo' } : { x: { z: number; ka: number; }; y: string; }
|
||||
>x : { z: number; ka: number; }
|
||||
>{ z: 1, ka: 1 } : { z: number; ka: number; }
|
||||
@@ -47,10 +47,10 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo'
|
||||
>'noo' : "noo"
|
||||
>rest.y + nested.ka : string
|
||||
>rest.y : string
|
||||
>rest : { y: string; }
|
||||
>rest : Rest<{ x: { z: any; ka: any; }; y: string; }, "x">
|
||||
>y : string
|
||||
>nested.ka : any
|
||||
>nested : { ka: any; }
|
||||
>nested : Rest<{ z: any; ka: any; }, "z">
|
||||
>ka : any
|
||||
|
||||
class C {
|
||||
@@ -59,7 +59,7 @@ class C {
|
||||
m({ a, ...clone }: { a: number, b: string}): void {
|
||||
>m : ({ a, ...clone }: { a: number; b: string; }) => void
|
||||
>a : number
|
||||
>clone : { b: string; }
|
||||
>clone : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>b : string
|
||||
|
||||
@@ -68,7 +68,7 @@ class C {
|
||||
set p({ a, ...clone }: { a: number, b: string}) {
|
||||
>p : { a: number; b: string; }
|
||||
>a : number
|
||||
>clone : { b: string; }
|
||||
>clone : Rest<{ a: number; b: string; }, "a">
|
||||
>a : number
|
||||
>b : string
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const { foo, ...rest } = obj
|
||||
>obj : Symbol(obj, Decl(objectRestReadonly.ts, 7, 5))
|
||||
|
||||
delete rest.baz
|
||||
>rest.baz : Symbol(baz, Decl(objectRestReadonly.ts, 2, 13))
|
||||
>rest.baz : Symbol(baz)
|
||||
>rest : Symbol(rest, Decl(objectRestReadonly.ts, 13, 12))
|
||||
>baz : Symbol(baz, Decl(objectRestReadonly.ts, 2, 13))
|
||||
>baz : Symbol(baz)
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ const obj: Readonly<ObjType> = {
|
||||
|
||||
const { foo, ...rest } = obj
|
||||
>foo : string
|
||||
>rest : { baz: string; quux: string; }
|
||||
>rest : Rest<Readonly<ObjType>, "foo">
|
||||
>obj : Readonly<ObjType>
|
||||
|
||||
delete rest.baz
|
||||
>delete rest.baz : boolean
|
||||
>rest.baz : string
|
||||
>rest : { baz: string; quux: string; }
|
||||
>rest : Rest<Readonly<ObjType>, "foo">
|
||||
>baz : string
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ function foobar({ bar = {}, ...opts }: Foo = {}) {
|
||||
"use strict";
|
||||
"Some other prologue";
|
||||
opts.baz(bar);
|
||||
>opts.baz : Symbol(Foo.baz, Decl(parameterInitializerBeforeDestructuringEmit.ts, 1, 14))
|
||||
>opts.baz : Symbol(baz)
|
||||
>opts : Symbol(opts, Decl(parameterInitializerBeforeDestructuringEmit.ts, 5, 27))
|
||||
>baz : Symbol(Foo.baz, Decl(parameterInitializerBeforeDestructuringEmit.ts, 1, 14))
|
||||
>baz : Symbol(baz)
|
||||
>bar : Symbol(bar, Decl(parameterInitializerBeforeDestructuringEmit.ts, 5, 17))
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ class C {
|
||||
"use strict";
|
||||
"Some other prologue";
|
||||
opts.baz(bar);
|
||||
>opts.baz : Symbol(Foo.baz, Decl(parameterInitializerBeforeDestructuringEmit.ts, 1, 14))
|
||||
>opts.baz : Symbol(baz)
|
||||
>opts : Symbol(opts, Decl(parameterInitializerBeforeDestructuringEmit.ts, 12, 27))
|
||||
>baz : Symbol(Foo.baz, Decl(parameterInitializerBeforeDestructuringEmit.ts, 1, 14))
|
||||
>baz : Symbol(baz)
|
||||
>bar : Symbol(bar, Decl(parameterInitializerBeforeDestructuringEmit.ts, 12, 17))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ function foobar({ bar = {}, ...opts }: Foo = {}) {
|
||||
>foobar : ({ bar, ...opts }?: Foo) => void
|
||||
>bar : any
|
||||
>{} : {}
|
||||
>opts : { baz?: any; }
|
||||
>opts : Rest<Foo, "bar">
|
||||
>{} : {}
|
||||
|
||||
"use strict";
|
||||
@@ -23,7 +23,7 @@ function foobar({ bar = {}, ...opts }: Foo = {}) {
|
||||
opts.baz(bar);
|
||||
>opts.baz(bar) : any
|
||||
>opts.baz : any
|
||||
>opts : { baz?: any; }
|
||||
>opts : Rest<Foo, "bar">
|
||||
>baz : any
|
||||
>bar : any
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class C {
|
||||
constructor({ bar = {}, ...opts }: Foo = {}) {
|
||||
>bar : any
|
||||
>{} : {}
|
||||
>opts : { baz?: any; }
|
||||
>opts : Rest<Foo, "bar">
|
||||
>{} : {}
|
||||
|
||||
"use strict";
|
||||
@@ -46,7 +46,7 @@ class C {
|
||||
opts.baz(bar);
|
||||
>opts.baz(bar) : any
|
||||
>opts.baz : any
|
||||
>opts : { baz?: any; }
|
||||
>opts : Rest<Foo, "bar">
|
||||
>baz : any
|
||||
>bar : any
|
||||
}
|
||||
|
||||
@@ -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" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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 "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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; }
|
||||
>tagName : string
|
||||
|
||||
createElement(tagName: 'canvas'): HTMLCanvasElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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 "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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; }
|
||||
>tagName : "canvas"
|
||||
|
||||
createElement(tagName: 'div'): HTMLDivElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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 "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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; }
|
||||
>tagName : "div"
|
||||
|
||||
createElement(tagName: 'span'): HTMLSpanElement;
|
||||
>createElement : { <K extends "object" | "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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 "canvas" | "div" | "span" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "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" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "strong" | "style" | "sub" | "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; }
|
||||
>tagName : "span"
|
||||
}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(27,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(29,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(30,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(31,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(33,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(36,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(37,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(39,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(40,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(42,13): error TS2700: Rest types may only be created from object types.
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(43,13): error TS2700: Rest types may only be created from object types.
|
||||
@@ -16,7 +10,7 @@ tests/cases/compiler/restInvalidArgumentType.ts(51,13): error TS2700: Rest types
|
||||
tests/cases/compiler/restInvalidArgumentType.ts(53,13): error TS2700: Rest types may only be created from object types.
|
||||
|
||||
|
||||
==== tests/cases/compiler/restInvalidArgumentType.ts (16 errors) ====
|
||||
==== tests/cases/compiler/restInvalidArgumentType.ts (10 errors) ====
|
||||
enum E { v1, v2 };
|
||||
|
||||
function f<T extends { b: string }>(p1: T, p2: T[]) {
|
||||
@@ -44,34 +38,22 @@ tests/cases/compiler/restInvalidArgumentType.ts(53,13): error TS2700: Rest types
|
||||
var a: any;
|
||||
|
||||
var {...r1} = p1; // Error, generic type paramterre
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
var {...r2} = p2; // OK
|
||||
var {...r3} = t; // Error, generic type paramter
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
var {...r4} = i; // Error, index access
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
var {...r5} = k; // Error, index
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
|
||||
var {...r6} = mapped_generic; // Error, generic mapped object type
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
var {...r7} = mapped; // OK, non-generic mapped type
|
||||
|
||||
var {...r8} = union_generic; // Error, union with generic type parameter
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
var {...r9} = union_primitive; // Error, union with generic type parameter
|
||||
~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
|
||||
var {...r10} = intersection_generic; // Error, intersection with generic type parameter
|
||||
~~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
var {...r11} = intersection_primitive; // Error, intersection with generic type parameter
|
||||
~~~
|
||||
!!! error TS2700: Rest types may only be created from object types.
|
||||
|
||||
@@ -67,19 +67,19 @@ function f<T extends { b: string }>(p1: T, p2: T[]) {
|
||||
>a : any
|
||||
|
||||
var {...r1} = p1; // Error, generic type paramterre
|
||||
>r1 : any
|
||||
>r1 : T
|
||||
>p1 : T
|
||||
|
||||
var {...r2} = p2; // OK
|
||||
>r2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray<T>[]): T[]; concat(...items: (T | ConcatArray<T>)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter<S extends T>(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }
|
||||
>r2 : T[]
|
||||
>p2 : T[]
|
||||
|
||||
var {...r3} = t; // Error, generic type paramter
|
||||
>r3 : any
|
||||
>r3 : T
|
||||
>t : T
|
||||
|
||||
var {...r4} = i; // Error, index access
|
||||
>r4 : any
|
||||
>r4 : T["b"]
|
||||
>i : T["b"]
|
||||
|
||||
var {...r5} = k; // Error, index
|
||||
@@ -87,7 +87,7 @@ function f<T extends { b: string }>(p1: T, p2: T[]) {
|
||||
>k : keyof T
|
||||
|
||||
var {...r6} = mapped_generic; // Error, generic mapped object type
|
||||
>r6 : any
|
||||
>r6 : { [P in keyof T]: T[P]; }
|
||||
>mapped_generic : { [P in keyof T]: T[P]; }
|
||||
|
||||
var {...r7} = mapped; // OK, non-generic mapped type
|
||||
@@ -95,7 +95,7 @@ function f<T extends { b: string }>(p1: T, p2: T[]) {
|
||||
>mapped : { b: T["b"]; }
|
||||
|
||||
var {...r8} = union_generic; // Error, union with generic type parameter
|
||||
>r8 : any
|
||||
>r8 : T | { a: number; }
|
||||
>union_generic : T | { a: number; }
|
||||
|
||||
var {...r9} = union_primitive; // Error, union with generic type parameter
|
||||
@@ -103,7 +103,7 @@ function f<T extends { b: string }>(p1: T, p2: T[]) {
|
||||
>union_primitive : number | { a: number; }
|
||||
|
||||
var {...r10} = intersection_generic; // Error, intersection with generic type parameter
|
||||
>r10 : any
|
||||
>r10 : T & { a: number; }
|
||||
>intersection_generic : T & { a: number; }
|
||||
|
||||
var {...r11} = intersection_primitive; // Error, intersection with generic type parameter
|
||||
|
||||
@@ -18,7 +18,7 @@ function one() {
|
||||
// 'a' is declared but never used
|
||||
const {a, ...bar} = foo;
|
||||
>a : number
|
||||
>bar : { b: number; }
|
||||
>bar : Rest<{ a: number; b: number; }, "a">
|
||||
>foo : { a: number; b: number; }
|
||||
|
||||
console.log(bar);
|
||||
@@ -26,7 +26,7 @@ function one() {
|
||||
>console.log : (a: any) => void
|
||||
>console : { log(a: any): void; }
|
||||
>log : (a: any) => void
|
||||
>bar : { b: number; }
|
||||
>bar : Rest<{ a: number; b: number; }, "a">
|
||||
}
|
||||
|
||||
function two() {
|
||||
@@ -44,7 +44,7 @@ function two() {
|
||||
const {a: _, ...bar} = foo;
|
||||
>a : any
|
||||
>_ : number
|
||||
>bar : { b: number; }
|
||||
>bar : Rest<{ a: number; b: number; }, "a">
|
||||
>foo : { a: number; b: number; }
|
||||
|
||||
console.log(bar);
|
||||
@@ -52,7 +52,7 @@ function two() {
|
||||
>console.log : (a: any) => void
|
||||
>console : { log(a: any): void; }
|
||||
>log : (a: any) => void
|
||||
>bar : { b: number; }
|
||||
>bar : Rest<{ a: number; b: number; }, "a">
|
||||
}
|
||||
|
||||
function three() {
|
||||
@@ -69,7 +69,7 @@ function three() {
|
||||
// 'a' is declared but never used
|
||||
const {a, ...bar} = foo; // bar should be unused
|
||||
>a : number
|
||||
>bar : { b: number; }
|
||||
>bar : Rest<{ a: number; b: number; }, "a">
|
||||
>foo : { a: number; b: number; }
|
||||
|
||||
//console.log(bar);
|
||||
@@ -90,7 +90,7 @@ function four() {
|
||||
const {a: _, ...bar} = foo; // bar should be unused
|
||||
>a : any
|
||||
>_ : number
|
||||
>bar : { b: number; }
|
||||
>bar : Rest<{ a: number; b: number; }, "a">
|
||||
>foo : { a: number; b: number; }
|
||||
|
||||
//console.log(bar);
|
||||
|
||||
Reference in New Issue
Block a user